2022-02-21 07:25 AM
2022-02-21 09:14 AM
Your code have primary trouble handle how many timer reloads occurs over first to last for example device send FF FF FE on USART ...
Too __HAL_TIM_SET_COUNTER(htim, 0); why
Read STM32 USART automatic baud rate detection AN4908
2022-02-21 09:14 AM
Your code have primary trouble handle how many timer reloads occurs over first to last for example device send FF FF FE on USART ...
Too __HAL_TIM_SET_COUNTER(htim, 0); why
Read STM32 USART automatic baud rate detection AN4908
2022-02-21 09:22 AM
You can change the UART->BRR by clearing the UE (Uart Enable) bit first in UART-CR1, and then re-enable.
With some awareness of the uint16_t number space, the delta time is actually less complicated to compute than you're making it.
You'd perhaps use PWM Input Capture and filter/check based on normative baud rate expectations. Have patterns or pairs in your a stream you can recognize/verify.