cancel
Showing results for 
Search instead for 
Did you mean: 

USART receiving 8-bit data with parity

I am supposed to be receiving 8-bit data with even parity.  The blocks are defined with a header of 'F0', this is S.Bus data if anyone knows that that is.  I setup a simple program that just does receive data.  I get data but nowhere does it show an 'F0'.  Am I supposed to use 'LL_USART_ReceiveData8' or 'LL_USART_ReceiveData9' to read this data?  Is the parity supposed to be read with the data and discarded?  It's not at all clear how the parity is handled. 

22 REPLIES 22

Try to transmit and observe the signal you've transmitted.

JW

You are correct.  I had the pin inverted at first, then re-read the documention, and set it to non-inverted. You try to make sense of this:

Bit 16 RXINV: RX pin active level inversion
This bit is set and cleared by software.
0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd=0/mark)
1: RX pin signal values are inverted (VDD =0/mark, Gnd=1/idle).

Anyway, I misread this documentation.   The 9-bit data is correct with parity.  I don't know what you mean by "2 parity" bits.  The format is 8-bit data, parity and 2 stop bits.  

It works now, at least I get the "0F" where I expect it.  I need to check the number if IDLEs I got. 

Thanks for sticking with me though this. 

Thanks for stick with me though this.  The data was inverted.  I misread the documentation.  It's confusing as to what the USART expects.  

Bit 16 RXINV: RX pin active level inversion
This bit is set and cleared by software.
0: RX pin signal works using the standard logic levels (VDD =1/idle, Gnd=0/mark)
1: RX pin signal values are inverted (VDD =0/mark, Gnd=1/idle).