Electronic – Decode/Analyse the following UART signals

communicationuart

I have sent a 2 and a 9 using UART. The baud rate is 9600, there is no parity, and it has 8 data bits.

As we know 9 is represented as 1001 in binary. However, this is what I get from my UART signal:

enter image description here

A 2 is represented as 0010 but this is what I get from my UART signal:
enter image description here
I know I have to pay attention to the start bit, but other than that, I have a hard time seing the logic in this signal.

NOTE:

The signal works, but I just need help analysing it.

Best Answer

Let's annotate your first scope shot. When we do this take note that the lowest order bit of the binary value is transmitted first. Conventional notation in this field is to order the bits in a byte like this:

[Bit 7][Bit 6][Bit 5][Bit 4][Bit 3][Bit 2][Bit 1][Bit 0]

So when I annotate and then evaluate the bit positions are flipped from the positions shown on the annotated scope shots.

enter image description here

The bit pattern represented there is 0b00111001.

That is the same as 0x39.

0x39 is the ASCII code for a '9' character.

Let's do the same for your second scope shot.

enter image description here

Here the bit pattern is represented as 0b00110010.

That is same as 0x32.

0x32 is the ASCII code for the '2' character.