cancel
Showing results for 
Search instead for 
Did you mean: 

Uart Parity and Data bit issue in STM32C0 Series

praveen2
Associate II

Hi all,i am using STM32C011F4U6 and i want communication between Uart1 _baud rate -115200 _8N1 and Uart2_Baud rate _4800_7E1.But STM32C0 haven't 7 bit communication option. How can i do this?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Rest-of-World

8E1

ST

UartHandle.Init.WordLength = UART_WORDLENGTH_9B; // 8+Parity
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_EVEN;

 

Rest-of-World

7E1

ST

UartHandle.Init.WordLength = UART_WORDLENGTH_8B; // 7+Parity
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_EVEN;

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

5 REPLIES 5
Peter BENSCH
ST Employee

Welcome @praveen2, to the community!

first of all: please don't post the same question twice.

Then: what makes you think that the C011 cannot be set to 7bit?
As @Tesla DeLorean explained in the other thread, you have to programme a word length of 8 bits for 7N1. The RM0490 also mentions under USART main features: Programmable data word length (7, 8 or 9 bits).

Does it answer your question?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
TDK
Guru

CubeMX settings for 7E1 are as follows:

TDK_0-1724936783598.png

Note that "word length" includes the parity bit.

If you feel a post has answered your question, please click "Accept as Solution".

>>i want communication between

How exactly?

The data rates are significantly different, so you'll likely need some depth of buffering to cope, as long as the overall volume is manageable.

You want to forward data between the two UARTs? One direction, or both?

Writing code will be easier if you can clearly communicate what the actual task is. Perhaps draw a diagram if that's helpful. Break the problem in to pieces.

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

Rest-of-World

8E1

ST

UartHandle.Init.WordLength = UART_WORDLENGTH_9B; // 8+Parity
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_EVEN;

 

Rest-of-World

7E1

ST

UartHandle.Init.WordLength = UART_WORDLENGTH_8B; // 7+Parity
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_EVEN;

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

Thanks for your support ,problem solved.I did as above setting @Tesla DeLorean .