Skip to main content
ivan239955_stm1_stmicro_com
Associate III
March 14, 2016
Question

Wrong high Baud Rate on STM32L052 [SOLVED]

  • March 14, 2016
  • 2 replies
  • 702 views
Posted on March 14, 2016 at 18:58

I am setting the Baud Rate of USART1 by the HAL MX_USART1_UART_Init() function as

huart1.Init.BaudRate = br;

I am also checking the BRR register setting by debugger and I am measuring a real BR on TXD by scope.

BR source clock is PCLK2 from MSI (f = 4.192 MHz). Oversampling remains 16.

Output is correct up to br=260000 (BRR=16) but for br>=270000 (BRR<=15) is output about 1000 Bd or even lower.

Is it a severe hardware bug or what?

Thank you for any information.

Ivan

    This topic has been closed for replies.

    2 replies

    TDK
    March 15, 2016
    Posted on March 15, 2016 at 05:58

    I doubt you can set your USART clock divider lower than 1 (BRR=16).

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    ivan239955_stm1_stmicro_com
    Associate III
    March 15, 2016
    Posted on March 15, 2016 at 17:24

    Thank you, Tim, for the notice.

    I missed the note on the next page of the Baud Rate generation in the datasheet.