Skip to main content
AV.9
Associate II
February 4, 2022
Solved

How to still listen to UART1 or any other UART using 115200 baud rate in STOP mode ? (STM32L053 has an LSE of 32.768kHz and LSI of 37kHz)

  • February 4, 2022
  • 1 reply
  • 1428 views

I want to listen to UART (using receive interrupt) at a baud rate of 115200 while in stop mode and retain the received characters (which are stored in a buffer) after I wake up from STOP mode using the RTC. Is that possible?

If so, how do I implement it? I am using the STM32Cube IDE to generate the config and debugand HAL functions.

This topic has been closed for replies.
Best answer by waclawek.jan

You don't have too much options at 115200. LSI is hopelessly unprecise, and both LSI and LSE run at too low a frequency - for 115200 in LPUART you need at least 3x the frequency, i.e. 345.6kHz. LSE with crystal is specified only for 32.768kHz.

There are programmable oscillators out there, but I don't know about their precision, availability at odd frequencies nor power consumption (probably won't be very low). This may be the only viable option, though.

You can run HSI16 during STOP by setting RCC_CR.HSI16KERON, but it has a 100uA typ current consumption, probably not what you want.

Waking up at falling edge is not an option either, as bit time is cca 8us and the HSI wakeup time (which is shortest of all oscillators) is typ. 3.7us max 6us, there's no way this could receive reliably, even if you could cope with HSI's imprecision by trimming.

JW

1 reply

waclawek.jan
waclawek.janBest answer
Super User
February 4, 2022

You don't have too much options at 115200. LSI is hopelessly unprecise, and both LSI and LSE run at too low a frequency - for 115200 in LPUART you need at least 3x the frequency, i.e. 345.6kHz. LSE with crystal is specified only for 32.768kHz.

There are programmable oscillators out there, but I don't know about their precision, availability at odd frequencies nor power consumption (probably won't be very low). This may be the only viable option, though.

You can run HSI16 during STOP by setting RCC_CR.HSI16KERON, but it has a 100uA typ current consumption, probably not what you want.

Waking up at falling edge is not an option either, as bit time is cca 8us and the HSI wakeup time (which is shortest of all oscillators) is typ. 3.7us max 6us, there's no way this could receive reliably, even if you could cope with HSI's imprecision by trimming.

JW