This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to make the serial port baud rate not change with temperature?

How to select nrf528332 UART clock source, how to make the serial port baud rate not change with temperature?When the baud rate is 9,600, the baud rate varies greatly with the temperature.Baud rate when - 25 ℃ maximum deviation to -3.5%, when to 55 ℃ baud rate deviation of 2.1%.

Parents
  • FormerMember
    +1 FormerMember

    By default, UART uses HFINT as clock source. For a more stable clock source, it may be better to use the external crystal (HFXO). For the external crystal, the datasheet should specify how its frequency varies with temperature.

    To use uart with the HFXO, it has to be explicitly started before using uart.

     NRF_CLOCK->TASKS_HFCLKSTART = 1;
     while (NRF_CLOCK->EVENTS_HFCLKSTARTED==0);

    Could you test if using the HFXO makes the baudrate more stable?

Reply
  • FormerMember
    +1 FormerMember

    By default, UART uses HFINT as clock source. For a more stable clock source, it may be better to use the external crystal (HFXO). For the external crystal, the datasheet should specify how its frequency varies with temperature.

    To use uart with the HFXO, it has to be explicitly started before using uart.

     NRF_CLOCK->TASKS_HFCLKSTART = 1;
     while (NRF_CLOCK->EVENTS_HFCLKSTARTED==0);

    Could you test if using the HFXO makes the baudrate more stable?

Children
Related