Well it has to go to the ISR, but probably you want to refresh the Payload value with the PushButton?
In this case...
Code:
keys2: ; Called by Interrupt update relay
pause 20 ' small debounce delay
if !PORTB.0 then GetOut ' button up?
' If so, getout of here... no need for noise call
PayLoad = PORTD ' read PushButtons and update Payload Value
UpdatePort:
You could also use a timer interrupt and poll PORTD, this will allow you to remove all those diodes, and leave RB0 for something else. As it is user push-button, you'll probably never feel the latency of the Timer interrupt.
Last edited by mister_e; - 5th May 2009 at 16:42.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks