I've been struggling to get the timer interrupt working on the 28-x1 chip.
This is the code I have used:
settimer t1s_4
setintflags %10000000,%10000000 ‘ enable timer interrupt
main: pause 1000 ‘ wait 1 seconds
high 0 ‘ Turn LED on
pause 1000 ‘ Wait 1 second
low 0 ‘ Turn LED off
inc b1 ‘ Turn LED on
debug ‘ display variables in debug window
goto main ‘ loop
Interrupt: inc b2 ‘ increment b2 each time the timer overflows
setintflags %10000000,%10000000 ‘ re-activate interrupt
return ‘ return from sub
The main program loop works. The debug statement shows the b1 register incrementing each loop.
The timer variable increments each time the timer overfloes but a timer interrupt does not seem to be generated and the b2 register never gets incremented.
Am I doing something wrong? Any hints as to how to the the rimer interrupt working would be appricated.
May thanks,
Martin
This is the code I have used:
settimer t1s_4
setintflags %10000000,%10000000 ‘ enable timer interrupt
main: pause 1000 ‘ wait 1 seconds
high 0 ‘ Turn LED on
pause 1000 ‘ Wait 1 second
low 0 ‘ Turn LED off
inc b1 ‘ Turn LED on
debug ‘ display variables in debug window
goto main ‘ loop
Interrupt: inc b2 ‘ increment b2 each time the timer overflows
setintflags %10000000,%10000000 ‘ re-activate interrupt
return ‘ return from sub
The main program loop works. The debug statement shows the b1 register incrementing each loop.
The timer variable increments each time the timer overfloes but a timer interrupt does not seem to be generated and the b2 register never gets incremented.
Am I doing something wrong? Any hints as to how to the the rimer interrupt working would be appricated.
May thanks,
Martin