cancel
Showing results for 
Search instead for 
Did you mean: 

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)

AV.9
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

1 REPLY 1

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