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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-04 12:37 PM
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.
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
-
STM32L0 Series
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-04 1:55 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-04 1:55 PM
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
