Nice example.
Although in a real program you should avoid to save and restore registers which don't change. This wastes a lot of time each interrupt:
Code:
myTimerInterrupt:
;tst.w 8(a1)
;beq.b .exit
movem.l d2-d7/a2-a6,-(sp)
add.l #1,t10ms
movem.l (sp)+,d2-d7/a2-a6
moveq #1,d0
.exit:
rts
Quote:
Originally Posted by xArtx
I assume because both chips are driven by the same clock,
that those two timers can't go out of sync?
|
Yes. All timers use the same 02 clock (0.7 MHz). Alternatively you can let the timers count positive CNT transitions on the serial port. And timer B can also count timer A underflows.