|
|
View previous topic :: View next topic |
Author |
Message |
homfray
Joined: 19 Nov 2003 Posts: 45 Location: Oxford
|
Wake from SLEEP if PORTF keyboard used |
Posted: Fri Dec 02, 2005 10:32 am |
|
|
Ok I have been bloody silly I have built and programmed some harware using a 18F8621 (and PCH) and because I hadn't thought about what happens to the circuit when nothing is happening, I put the matrix (4x3) keyboard on PORTF and not on an interrupt port B pin.
I would like to wake up when a button is pressed and do stuff and go back to sleep if there is inactivity, not bothered how its done and would be willing to go down the WDT route if its the best method.
It is probably not possible, but if theres a way one of you dudes will know. Any clues for the stupid one _________________ Nice!!! |
|
|
Ttelmah Guest
|
|
Posted: Fri Dec 02, 2005 11:16 am |
|
|
No easy 'trick', but you can bodge round this. Why not enable the watchdog. Set this to wake at (say) 50mSec intervals, and just make one test on the input port, and then if nothing is seen, go back to sleep. Total time awake, can be below perhaps 10 instructions. If a key is seen, set a flag, and sleep again. If the key is still there on the next interrupt, this has provided a nice 'debounce', and you can respond. The total percentage of the time 'awake, will be tiny. Unfortunately, the power will be slightly worse than on some other chips, because there is no internal oscillator (these wake up faster, reducing consumption when working like this), but you will still get over 90% of the power saving available from sleep, and be able to detect the keyboard.
Best Wishes |
|
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|