2023-06-21 05:40 AM
i am sending data on serial is 3 when is display is this 3 but i can conver in bninary then become 00110011 instead 00000011.and when i invert it then i got 01100110 instead of 11111100 ,why so ?
2023-06-21 12:46 PM
We have no idea what you're doing unless you show some code. And what is "display"?
2023-06-21 12:52 PM
Hello. I guess you are mixing Ascii and binary coding. Ascii symbol '3' equals 51 decimal value and it is 00110011 in binary
2023-06-22 04:50 AM
noting in the code just sent data on serial
2023-06-22 04:50 AM
2023-06-22 04:51 AM
you are right ,but how it inverting ?
2023-06-22 06:43 AM
It's hard to understand what you're explaining here. Show code that's sending the data, and how you determine it's inverted, like a scope or logic analyzer plot.
'3' (the character) and 3 the number are represented differently inside the computer.
Serial UART data is typically shifted least-significant bit FIRST.
Data shifted out at CMOS levels, the line is normally HIGH between bytes, and there is a LOW start bit, and a high STOP bit.
0110000001 with start and stop bits (10 clocked bits in 8N1 format)
RS232 level converters effectively invert the signal.
2023-06-27 05:19 AM
how to invert it
2023-06-27 06:34 AM
@Ranjeet Singh wrote:how to invert it
Perhaps you are looking for this? (bitwise)
var2 = ~(val1);
https://gist.github.com/Vitorbnc/e35f1ff1485d660edf365241dacfa387
2023-07-12 04:00 AM
this is just make 0 to 1 and 1 to 0 but not inverting as the Microcontroller/CRO invert