Rabbit 6000 User Manual page 166

Table of Contents

Advertisement

16.3 Operation
The following steps explain how to set up a Timer A timer.
1. Use the default perclk/2 in TAPR as the Timer A input clock. You may instead select to divide per-
clk by 1–256 in TAPR.
2. Select the source clocks for Timers A2–A7 in TACR. Select the source clocks for Timers A8–A11
in TAECR.
3. Write the desired divider value to TATxR for all timers that will be used.
4. Enable Timer A by writing a 1 to bit 0 of TACSR.
16.3.1 Handling Interrupts
The following steps explain how an interrupt is set up and used.
1. Write the vector to the interrupt service routine to the internal interrupt table.
2. Configure TACSR to select which timers will generate an interrupt.
3. Configure TACR to select the interrupt priority (note that interrupts will be enabled once this value
is set). This should be done last.
The interrupt request is cleared by reading from TACSR.
16.3.2 Example ISR
A sample interrupt handler is shown below.
timerA_isr::
push af
ioi ld a, (TACSR)
; handle all interrupts flagged in TACSR here
pop af
ipres
ret
Rabbit 6000 User's Manual
; save used registers
; clear the interrupt request and get status
; restore registers
digi.com
166

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 6000 and is the answer not in the manual?

Table of Contents