In my project, I have the following segment of code:
The only thing is that the button may never be pressed by
the user, and I want to be able to break out of this loop.
How do I use the watchdog timer exactly? I can't understand
the data sheet! The above code is executed after some other
code and basically, I want to require the user to press a
button within 1 second or so (which is within the abilities of the
watchdog timer for the 16F628A), if the button isn't pressed,
I'd like for execution to jump to a function that I define.
Is there extremely simple sample code for using the
watchdog timer that somebody could point me to?
Thank you.
kcn
Code:
wait
btfss PORTA, 0 ;wait for button
goto wait ;if it is high, break out of loop
The only thing is that the button may never be pressed by
the user, and I want to be able to break out of this loop.
How do I use the watchdog timer exactly? I can't understand
the data sheet! The above code is executed after some other
code and basically, I want to require the user to press a
button within 1 second or so (which is within the abilities of the
watchdog timer for the 16F628A), if the button isn't pressed,
I'd like for execution to jump to a function that I define.
Is there extremely simple sample code for using the
watchdog timer that somebody could point me to?
Thank you.
kcn