Im using a 18f4620 with a keypad linked to portB using the internal pullups. I am trying to put the PIC into sleep mode by pressing a button on my keypad and waking it up by pressing the same key, or even a different key at a later time. Any help will be appreciated.
By entering sleep mode the PIC should save floating integers that were inputs from previously running the main function correct? Becasue this is the main reason I want to use sleep mode. I enter data from the keypad that are stored as floating integers but all is lost when I power down my ciruit by simlpy cutting all power to the circuit by a switch. But I want to use these inputs upon powering the circuit backup without going through the entire input process again.
Also if I am using an LCD for my outputs how shall I get my LCD to power down when entering sleep mode? Or should I simply display that the PIC is asleep on the LCD and use a switch for the LCD after the PIC has entered sleep mode?
Thanks,
Jeff
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sun Dec 10, 2006 10:34 pm
Quote:
I am trying to put the PIC into sleep mode by pressing a button on my
keypad and waking it up by pressing the same key, or even a different
key at a later time.
Also if I am using an LCD for my outputs how shall I get my LCD to power down when entering sleep mode?
Two commonly used methods are:
1. Use a logic-level FET (which is controlled by a PIC pin) to switch
the power on/off to external circuits.
2. If the current in the external circuits is low enough (< 5 ma), then
a PIC pin could be used to provide power. The LCD and its contrast
trimpot (or resistors) probably use only about 2 ma typically.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum