2021-01-08 03:16 AM
Hi @All ALL @Martin KJELDSEN
I am using STM32F412CGU6 microcontroller.
I would like to Configure UART1 with following settings.
• Baud Rate: 9600
• Start bits: 1
• Parity: Even
• Data Bits: 7
• Flow Control: Off
• Stop Bits: 1
In STM32CubeMX, There is no configuration available for Data Bits 7.
So, How can I configure the above UART settings.
Thanks
Nikunj Patel
Solved! Go to Solution.
2021-01-08 07:01 AM
Setting a word length of 8 bits and even parity will get you what you want. The word length is inclusive of the parity bits.
2021-01-08 04:13 AM
That is correct, as the USART in the STM32F4xx only support a data word length of 8 or 9 bit.
You need to switch to another STM32, e.g. STM32L4xx to be able to use a data word length of 7, 8 or 9 bit.
Good luck!
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
/Peter
2021-01-08 07:01 AM
Setting a word length of 8 bits and even parity will get you what you want. The word length is inclusive of the parity bits.
2021-01-08 07:12 AM
@TDK is absolutely right, I haven't seen the parameter Parity: Even.