As a complete NOOB I am struggling again, my interrupt handler doesn't work. It's for a timer
and this code is only part of the complete project. It should pulse portb.0 and susequently portb.2 It does not work. Please help if you have the time. Rgds Mike
'Using 16F628 4MHz crystal
secs var byte
mins var byte
clear
option_reg = %10000111
intcon = %10110010
test:
on interrupt goto seconds
goto test
disable
seconds: 'Interrupt Handler 'Disable interrupts during Handler
secs=secs+1
intcon.2=0 'interrupt bit 2 must be rest in software
if secs=10 then
mins=mins+1
secs=0
high portb.0
pause 1
low portb.0
endif
if mins=5 then gosub minutes
resume test
enable 'Re-enable interrupts after Handling
minutes:
mins=0
intcon.2=0
secs=0
high portb.2
pause 5
low portb.2
return
Bookmarks