I'm wokring on STM32 Nucleo board(STM32F070).
I've a requirment to check the baud rate of incoming data on UART2 and verify the packets.
how can i check that?
thanks in advance.
Hi jagadeesh v,
If you have a look to STM32 USART automatic baud rate detection application note, the Software automatic baud rate detection section, may give you an idea to start:
In fact, the idea of the software approach is to send a 0x7F data frame to the USARTx_RX pin. This is connected to the EXTI line, which is configured to generate an interrupt on each rising edge.
The duration of the interval between the two rising edges is measured using the Systick timer. This duration corresponds to the duration of 8 bits, so
The USARTx_BRR register is then programmed, based on the calculated baud rate value.
Would depend on the data and packet format a lot, wouldn't it?
You can use TIM or EXTI to measure minimum bit timing, you wouldn't be able to receive valid data until you selected the right value based on the pulse widths you measured, and computed against the internal time base.
Retrieving data ...