rosflight / airbourne_f4

Be the Jason Bourne of the skies
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

SBUS: USART_WordLength #32

Open plusk01 opened 6 years ago

plusk01 commented 6 years ago

SBUS is 8E2:

This is being set here:

  case MODE_8E2:
    USART_InitStruct.USART_WordLength = USART_WordLength_8b;
    USART_InitStruct.USART_Parity = USART_Parity_Even;
    USART_InitStruct.USART_StopBits = USART_StopBits_2;
    break;

I'm looking at the very vague F4 (and F3) documentation, and Figure 297 seems to imply that the word length should actually be USART_WordLength_9b because of the parity bit. The only reason I came across is this is because I couldn't get valid SBUS data in airdamon_f3 until I used 9 bit word length.

stm32f4_uart_word_length

I don't have an F4 to try this on, and I'm assuming that SBUS has been working for you just fine -- so really, I'm just curious if you have any thoughts about why 8b works for you, but 9b works for me...

superjax commented 6 years ago

Haha, well, it seems to be working... That is strange. I never looked into that.