Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Pic 16f877 sleep & wake up mode

Status
Not open for further replies.

zalmay

Newbie level 4
Newbie level 4
Joined
Mar 27, 2009
Messages
7
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
pakistan peshawar
Activity points
1,345
HI Everyone;
i want my PIC to go to sleep mode when no key from keypad is pressed and wake up when any key is pressed.
i have googled alot but didn't concluded an idea for the code.

can anyone provide me the sketch for coding this function??
 

Hi zalmay,
Before enter in sleep mode, with SLEEP() instruction, you first should enable the keypad interrupt (clear interrupt flag and set interrupt enable flag). Then put PIC into sleep mode.
When MCU is in sleep mode, and keypad intterupt is occured, then PIC will awake from sleep, and program will continue with the next instruction.
If you want PIC to stay in sleep mode only for the fixed time, then before enter in sleep mode, enable WDT timer, clear it with CLRWDT() instruction, and then go to sleep mode. After fixed time interval (WDT timeout), if keypad interrupt is not occured, then WDT interrupt will awake PIC from sleep mode.

Best regards,
Taner
 
Last edited:
thanks TANER;
i have tried the SLEEP() instruction but it wasn't working in MICRO-C complier.i then found solution i used asm(sleep) and it worked its in sleep mode.but problem is i have tried the keypad inturrupt i-e change in port b inturrupt but didn't worked.i have the problem of how to code keypad interrupt to wake it up.
 
i have the 4*3 keypad attached with PORT B of PIC16f877 and also i want to use the key press as the interrupt change on port b to wake it up from sleep.please provide me with the wakeup code i have implemented the code to make PIC sleep if no key is pressed for 15 sec but prrrroblems with wakeup..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top