Skip to main content
Visitor II
April 30, 2024
Solved

STM32G0 Uart Prescaler

  • April 30, 2024
  • 2 replies
  • 2071 views

I work on a project with the STM32G0 and one difference between the F0 series is, that the UART has a clock prescaler. The maximum UART peripheral clock (usart_ker_ck) is 64 MHz (max of SYSCLK and PCLK) and this clock can be prescaled with PRESC -> usart_ker_ck_pres = usart_ker_ck / PRESC. PRESC can be 2^x ( 0<=x<=8). The minimum USARTDIV value is 16. Due to oversampling, there are two different calculations for the baudrate, but I will talk only about the 16 bit oversampling, since it will produce smaller baudrates.

baudrate = usart_ker_ck_pres / USARTDIV = usart_ker_ck / (PRESC * USARTDIV)

 

USARTDIV can be 2^16 - 1 resulting in a minum baudrate of 3.8!

Without the prescaler (PRESC=1) the minimum baudrate is 976.5!

 

My question is, am I right with all that I stated here, and was the prescaler only implemented for baudrates smaller than 976.5 or am I missing something? Is there a real application for this case? I am just curious

 

    This topic has been closed for replies.
    Best answer by Uwe Bonnes

    Lower usart_ker_ck_pres will also mean lower usart current. Not that much needed in G0, but Usart IP is the same in U0.

    2 replies

    ST Employee
    May 2, 2024

    Hi @simountain 

     

    This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

     

    Regards,

    Billy

    Graduate II
    May 2, 2024

    Lower usart_ker_ck_pres will also mean lower usart current. Not that much needed in G0, but Usart IP is the same in U0.

    Visitor II
    May 3, 2024

    Thanks for answering my question. I never worked on low power applications, that's why my brain was confused :)