Skip to main content
rsoc
Associate III
February 5, 2021
Solved

Use of Odd Parity in USART1 Configuration -- stm32L452RE uC

  • February 5, 2021
  • 2 replies
  • 1328 views

Hi--

I/m pretty stumped. I am trying to implement a odd parity configuration for USART1 in an stm32L452RE micro. I've confirmed without parity the usart behaves as expected at the needed baud. When i introduce parity into the code and sniff the data out of a logic analyzer, the data is error filled. I am probably doing something stupid, but wondering if someone sees something in my function to initialize the USART1 i am missing...

If it is not the init function, is the transmit using parity different than typical usart? Could I be getting caught there?

Thank you!

This topic has been closed for replies.
Best answer by waclawek.jan

In STM32, quite untypically, the parity bit counts towards the total number of bits. So, if you want to implement 8P1, you have to set 9 data bits.

JW

2 replies

waclawek.jan
waclawek.janBest answer
Super User
February 5, 2021

In STM32, quite untypically, the parity bit counts towards the total number of bits. So, if you want to implement 8P1, you have to set 9 data bits.

JW

rsoc
rsocAuthor
Associate III
February 5, 2021

for whatever reason my code didnt paste, but the response is spot on. good to go, thank you!