STM32L5 Stop2 and Comparator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-05 3:44 AM - edited 2025-03-05 4:56 AM
Hello,
I'm trying to enable the stop2 mode and using the analog comparators on STM32L5.
It seems that no interrupt is fired when turning the voltage in input+ at a higher leveln than input-. The same code work fine, when entering stop1 instead of stop2.
There's also no problem when running the RTC or waking up via GPIO event if the compartor is not initilized.
Hardware:
- Nucleo STM32L5 Nucleo-144 board (MB1361)
- Current is measured on Header IDD
Software:
- Clocks: LSI as source for RTC and MSI @ 1 MHz as system clock (MSI is also configured as wakup source clock)
- GPIOs: All pins are configured as analog inputs without pull
- Comparator is configured using PB2 as input+ and PB1 as input-
How can I use the comperator in stop2 mode?
Thanks for help,
Sven
- Labels:
-
COMP
-
STM32L5 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-11 5:28 AM
Hello @svenifax and welcome to the community;
What are the plus and minus assignments of COMP inputs?
I recommend you to read and check COMP1, EXTI and relevant GPIO registers content.
Could you please try with this sequence:
- Enable COMPx and wait the associated startup times.
- Configure and enable the EXTI lines corresponding to the COMPx output event in interrupt mode and select the rising, falling or both edges sensitivity.
- Clear any possible pending flag for given EXTI lines.
- Configure and enable the NVIC IRQ channel mapped to the corresponding EXTI lines.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
