2017-01-04 02:33 AM
Hi all,
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?
Any Idea??
thanks in advance.
#stm32-nucleo #uart #uart-baud-rate #stm32f0702017-01-04 02:55 AM
Hi
v.jagadeesh
,If you have a look to
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
bit time = calculated duration / 8
baud rate = 1/bit time
The USARTx_BRR register is then programmed, based on the calculated baud rate value.
-Nesrine-
2017-01-04 08:08 AM
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.