Understanding UART Serial DATA

Thread Starter

camerart

Joined Feb 25, 2013
3,176
Hi,
I'm using UART serial DATA all of the time, and I have only the basics of how it works.
I have a DATA analyser, and now know that it reads backwards (So helpful)
Here is a screen shot:
It shows 3x runs. In the top one, I send nothing via HSEROUT, second I sent a '0' bottom '255'.
I can kind of see '0', but can someone breakdown the 255 please?
Cheers, Camerart.
 

Attachments

jjw

Joined Dec 24, 2013
784
Hi,
I'm using UART serial DATA all of the time, and I have only the basics of how it works.
I have a DATA analyser, and now know that it reads backwards (So helpful)
Here is a screen shot:
It shows 3x runs. In the top one, I send nothing via HSEROUT, second I sent a '0' bottom '255'.
I can kind of see '0', but can someone breakdown the 255 please?
Cheers, Camerart.
Something is wrong.The runs are identical.
Show the code for different runs.
 

Ian0

Joined Aug 7, 2020
6,322
Did you send the number 255 or the text "255". I think you sent the text.
If you sent the number 255, you would see: Start bit (zero) , data LSB first, stop bit (one), then the line would return high.
255 would look like a low-going pulse one bit-time wide, 0 would look like a low-going pulse 9 bit-times wide.
"255" would be ASCII encoded as 0x32, 0x35, 0x35, then maybe followed by a line-feed(0x0A), carriage return (0x0D) or null 0
in which case you would see
0010011001-0101011001-0101011001-0101100001 (assuming it was terminated by carriage return) which is maybe what you have seen.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,176
Something is wrong.The runs are identical.
Show the code for different runs.
hI J,
I tried 3x runs all on the same image, hopefully, I've clarified it in #1.
C
Here is a picture about sending one byte:
Nothing
0 or 0x00
255 or 0xFF
5 or 0x05
Bit 0 is sent first
Hi J,
Thanks,
I see yours is backwards like my analyser LSB first, but also upside down SCK high when OFF. I'm sure I can change the analyser settings, but I tend to leave things alone, until I'm sure.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,176
Did you send the number 255 or the text "255". I think you sent the text.
If you sent the number 255, you would see: Start bit (zero) , data LSB first, stop bit (one), then the line would return high.
255 would look like a low-going pulse one bit-time wide, 0 would look like a low-going pulse 9 bit-times wide.
"255" would be ASCII encoded as 0x32, 0x35, 0x35, then maybe followed by a line-feed(0x0A), carriage return (0x0D) or null 0
in which case you would see
0010011001-0101011001-0101011001-0101100001 (assuming it was terminated by carriage return) which is maybe what you have seen.
Hi 1,
Thanks for your comprehensive answer.
Using your description, plus the maybe LSB or HSB first, plus the maybe upside downness, plus my slight dyslexia, I alsmost got it, but my eyes got crossed :)

I thought logically, abaout the logic analyser, and why doesn't it decode it. I looked at all of the analiser choices and saw the ASYNCH SERIAL, which of course decoded it, happy days. It now looks different, but it could be another plus option, of did I use the '#' or not originally.
Anyway, I should be able to figure it out now.
Thanks all.
C
 

Attachments

Top