watchdog
Does any one have any advice on using the sleep command with the SX28 , I am using it to control a door lock and scan a keypad, want to put it to sleep and wake it up using·the # key to wake up. Gunther Daubach says that you must use the RB I/0 in order· pull-down the·I/0 pin, does it mater which·pin you use?·I'm not to clear on how the resistors are configured·1k and 10k· the 1k should go to Rb0 and then to VSS ? but if the rows are not being scanned how does this wake up the SX, also can you use the·watchdog timmer with the sleep command, Thanks David
····················································· ········
····················································· ········
Comments
The SX can be configured to wake-up when any of the RB pins change state and/or when the watchdog timer times out.
You would need to setup the rows so that when the "#" key is pressed the state changes on one of the RB Pins.
OR you could use the watchdog to wakeup the SX and then scan the keys and determine if the "#" is pressed.
The first method would be the most straight forward and conserve the most power.
Without a schematic I cannot comment on you other questions.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
·
Keys··········· VAR···· RB····················· ' keyboard scan port
TRIS_Keys······ VAR···· TRIS_B
PLP_Keys······· VAR···· PLP_B
Col1··········· VAR···· Keys.7················· ' column inputs
Col2··········· VAR···· Keys.6
Col3··········· VAR···· Keys.5
Col4··········· VAR···· Keys.4
tmpB1 = 0···································· ' reset keyboard value
· Keys = %0000_0111······················ ' activate first row
· TRIS_Keys = %1111_0000··············· ' refresh IO state
· PLP_Keys = %0000_1111················· ' pull-up input pins
Post Edited (dbj) : 12/12/2006 12:20:32 PM GMT
I finally understand why all the RB pins do wake up.
I had never thought that a matrix keyboard would be involved.
With 8 bits one could actually do 8X8 or 64 keys at maximum.
I seem to have been thinking I only needed one bit unless I was trying to do some complex robotic scheme.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
······················································· David