Wake up from interrupt when use a keypad in polling mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 5:59 AM
In my design i have 5 gpio that connecting my keypad , i have 3 row (gpio output ) an 2 col how input , one button keypad is ON/OFF.
For me the OFF state corrrespond to sleep state .
This is my problem -
Before of while i enter i sleep mode :
void PWR_EnterSleepMode(void)
{
/* Suspend tick increment to prevent wake up by SysTick interrupt. */
HAL_SuspendTick();
/* Enter Sleep mode. */
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFE);
/* The codes below will be executed only after waked up from the Sleep
* mode. */
/* Resume tick interrupt if disabled prior to sleep mode entry. */
HAL_ResumeTick();
}
Then how wakeup my STM32l1 from sleep if I defined my gpio how input and output gpio .
The Mcu wake up just if hear a interrupt event (is right?)
I don't know.
Yu can help me .
BR.
- Labels:
-
Power
-
STM32L1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-17 8:06 PM
Hello
Connecting a keypad like you wrote, implies an allways running scanning code.
An aproach to solve this is to use the col input on/off key's pin with EXTI to produce interrupts both edge.
Just before put mcu to sleep ensure that row output on/off key's pin is not in analog state but other rows are.
After wakeup from sleep, restore the functionality of rows and columns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-18 7:34 AM
Thanks
this is my problem
I put power sleep before while loop
When i Press the button the led of callback lighted but then i stopped here with led lighted and I not entry in while loop.
WHY?????
I post my code .
Thank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-18 10:39 AM
unfortunately source file is empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-18 11:06 AM
SORRY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-19 12:21 AM
