![Rabbit Rabbit 4000 Скачать руководство пользователя страница 121](http://html1.mh-extra.com/html/rabbit/rabbit-4000/rabbit-4000_user-manual_3116714121.webp)
111
13.2.4 Interrupts
A Timer A interrupt can be generated whenever timers A1–A7 decrement to zero by
enabling the appropriate bit in TACSR. The interrupt request is cleared when TACSR is
read.
The Timer A interrupt vector is in the IIR at offset 0x0A0. It can be set as priority 1, 2, or
3 in TACR.
13.3 Operation
The following steps explain how to set up a Timer A timer.
1. Select perclk as the Timer A input clock in TAPR (default is perclk/2).
2. Select the source clocks for timers A2–A7 in TACR.
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.
13.3.1 Handling Interrupts
The following steps explain how an interrupt is set up and used. Remember to set up the
interrrupt vector
before
you enable the interrupts.
1. Write the vector of 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.
13.3.2 Example ISR
A sample interrupt handler is shown below.
timerA_isr::
push af ; save used registers
ioi ld a, (TACSR) ; clear the interrupt request and get status
; handle all interrupts flagged in TACSR here
pop af ; restore registers
ipres
ret
Содержание Rabbit 4000
Страница 1: ...Rabbit 4000 Microprocessor User s Manual 019 0152 070720 H...
Страница 18: ...8 Rabbit 4000 Microprocessor User s Manual...
Страница 40: ...30 Rabbit 4000 Microprocessor User s Manual...
Страница 74: ...64 Rabbit 4000 Microprocessor User s Manual...
Страница 82: ...72 Rabbit 4000 Microprocessor User s Manual...
Страница 86: ...76 Rabbit 4000 Microprocessor User s Manual...
Страница 96: ...86 Rabbit 4000 Microprocessor User s Manual...
Страница 182: ...172 Rabbit 4000 Microprocessor User s Manual...
Страница 240: ...230 Rabbit 4000 Microprocessor User s Manual...
Страница 248: ...238 Rabbit 4000 Microprocessor User s Manual...
Страница 256: ...246 Rabbit 4000 Microprocessor User s Manual...
Страница 310: ...300 Rabbit 4000 Microprocessor User s Manual...
Страница 330: ...320 Rabbit 4000 Microprocessor User s Manual...
Страница 348: ...338 Rabbit 4000 Microprocessor User s Manual...