cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8T6 UART 8-bits and Even parity

Yeswanth
Associate II

Hii

 

I am using STM32F103C8T6 controller. In this controller I am using the UART1 and UART2 transmitting and receiving data. In UART1 I adjust 9600 Baud rate, 8-data bits, None parity and 1 stop in these configuration I am transmitting and receiving data is good, But in UART2 I adjust 9600 Baud rate, 8-data bits, Even parity and 1 stop in these configuration I am transmitting and receiving garbage data.

Please help me to use the UART2 in these configurations.

1 ACCEPTED SOLUTION

Accepted Solutions

In the configuration parity is counted as a bit being transmitted 

So 8E1 is set as 9 bits and even parity

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

In the configuration parity is counted as a bit being transmitted 

So 8E1 is set as 9 bits and even parity

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Karl Yamashita
Lead II

If you only send ASCII characters, then 8,E,1 will work because you only need 7 bits. Then in  serial interface you set it up to receive 7,E,1. The 8th bit is the parity which should get set to zero by the serial interface.

But if you want to send data in full 8 bits or byte values greater than 0x7F, then you need to set up the STM32 as 9,E,1 so you get your full 8 bits + parity bit. The serial interface can be set up to receive as 8,E,1.

 

 

If you find my answers useful, click the accept button so that way others can see the solution.

@Tesla DeLorean wrote:

In the configuration parity is counted as a bit being transmitted 

So 8E1 is set as 9 bits and even parity


@Tesla DeLorean I believe you've meant to say 8E1 is set up as 7 bits and even parity.

If you find my answers useful, click the accept button so that way others can see the solution.