0
\$\begingroup\$

I will work with the CH32V003A4M6 microcontroller and must configure its USART for serial communication. My application needs to go up to 460800 baud rate. Does someone know if this is possible, or have you tested the MCU to this baud rate?

Thanks

New contributor
Sebastian Medina is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
2

2 Answers 2

1
\$\begingroup\$

It looks like generic STM32 lookalike.

The main thing is, it depends how much error you tolerate and how are you going to clock it (frequency and type of clock source).

The MCU has 48 MHz max system and peripheral clock.

The USART has a fractional baud rate generator up to 3 Mbps. Which matches what you would expect with 48 MHz peripheral clock.

Based on these facts, yes, 460800 bps is much less than maximum speed so definitely possible.

If you plan to run the MCU at the 48 MHz system clock, then the 460800 is not exactly achievable, but the nearest fractional baud rate divisor is 104.1875, which allows for a baud rate of 460708, which is only a 0.02% error so well within tolerance.

However if you use the HSI as clock source, it may be over the tolerance limit of working USART comms, so my recommendation is to not use internal oscillators but an actual crystal for anything timing sensitive and USART is timing sensitive.

\$\endgroup\$
1
\$\begingroup\$

The English version of the reference manual can be found on their website. On page 135, it says the maximum is 3Mbps.

The formula to compute the USART clock divisor is on page 136. The given example of the calculation shows ~921600bps, which confirms it can go beyond your need.

enter image description here

Here is a guide to configure the USART and transmit & receive data using the HAL library provided by the vendor. The given code set the baudrate to 115200bps. You can change it to the higher baudrate that you need.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.