Putting PIC16F18857 MCU in to sleep mode and coming out from sleep mode
Posted: Tue Nov 24, 2020 8:39 am
Hi,
I am using PIC16F18857 MCU and MPLAB code configurator and XC8 compiler..
Creating the project using MPLAB X IDE ...
For Normal operation IOC interrupt is generating after pressing the switch and setting the flag after interrupt trigger and i am checking that flag in timer and once the switch status becomes high means i am setting one more and processing that in to main while loop...
It working fine as i expected...
but i need to use SLEEP() in my code.. to avoid power consumption..
after adding the SLEEP() instruction in while loop.. it is going in to SLEEP mode by checking reduced current ..i am confirming SLEEP mode it is entering ...
after switch press IOC is generating but why it is not waking the device i am not getting..
Again it is going to sleep mode showing same current ..
can anybody please suggest me.. how to wakeup the MCU from sleep mode using IOC interrupt??
I am using PIC16F18857 MCU and MPLAB code configurator and XC8 compiler..
Creating the project using MPLAB X IDE ...
For Normal operation IOC interrupt is generating after pressing the switch and setting the flag after interrupt trigger and i am checking that flag in timer and once the switch status becomes high means i am setting one more and processing that in to main while loop...
It working fine as i expected...
but i need to use SLEEP() in my code.. to avoid power consumption..
after adding the SLEEP() instruction in while loop.. it is going in to SLEEP mode by checking reduced current ..i am confirming SLEEP mode it is entering ...
after switch press IOC is generating but why it is not waking the device i am not getting..
Again it is going to sleep mode showing same current ..
can anybody please suggest me.. how to wakeup the MCU from sleep mode using IOC interrupt??