Page 1 of 1

Putting PIC16F18857 MCU in to sleep mode and coming out from sleep mode

Posted: Tue Nov 24, 2020 8:39 am
by megha
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??

Re: Putting PIC16F18857 MCU in to sleep mode and coming out from sleep mode

Posted: Tue Nov 24, 2020 10:27 am
by QMESAR
HI.

I would advise you to ask this at the Microchip forum ,People here work with Flowcode on PIC

Re: Putting PIC16F18857 MCU in to sleep mode and coming out from sleep mode

Posted: Tue Nov 24, 2020 10:55 am
by megha
Hi,
thanks for reply.. actually i was much struggling to post this problem in microchip forum..

if have any idea about my problem means please help me , it will needful for me..

Re: Putting PIC16F18857 MCU in to sleep mode and coming out from sleep mode

Posted: Tue Nov 24, 2020 8:25 pm
by kersing
Having issues posting on the microchip forum does not mean you should post messages unrelated to flowcode on this forum.

Re: Putting PIC16F18857 MCU in to sleep mode and coming out from sleep mode

Posted: Thu Nov 26, 2020 12:43 pm
by Benj
Hello,

It's hard to know whithout seeing your code, are you reading the port register on the IOC interrupt and when arming the interrupt? Without doing this the interrupt won't fire.