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.
2022-02-04 01: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
2022-02-04 01: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