2024-08-28 11:19 PM - last edited on 2024-08-29 08:18 AM by Tesla DeLorean
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
2024-08-28 11:34 PM
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
2024-08-29 06:06 AM
CubeMX settings for 7E1 are as follows:
Note that "word length" includes the parity bit.
2024-08-29 06:34 AM
>>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.
2024-08-29 08:21 AM
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;