1 out of 1 members found this post helpful.
Did you find this post helpful?

|
Re: Sleep does not really sleep...
Couple of things that caught my attention
1 - in keyscan, this lne should ensure the rows are high
portb=~dcd ix 'invert polarity
So, I guess, you should add
portb=~(dcd ix) + $78 'invert polarity
2. I infer, the keypress interrupt is just to wake the processor out of sleep. So, the interrupt routine needs to do nothing other than just return when the interrupt occurs. After that, the processor will be awake and the scan, beep, transmit routine can work like normal in the foreground. No need of any flags. If no key is found, the processor can go back to sleep.
This line need not re-scan till it finds a key. If no valid key is found, the processor can just go back to sleep.
if char>11 then keyscan 'wrong key,noise etc
Bookmarks