![Digi Rabbit 5000 User Manual Download Page 167](http://html1.mh-extra.com/html/digi/rabbit-5000/rabbit-5000_user-manual_2496192167.webp)
Chapter 16 Timer C
167
16.3 Operation
The following steps explain how to set up a Timer C timer.
1. Select perclk/2, perclk/16, or countdown Timer A1 in TCCR.
2. Load the desired upper limit for the counter into TCDLR and TCDHR. The overall
clock count per Timer C cycle will be the value loaded into the divider registers plus
one.
3. Load the desired set and reset values for the Timer C outputs into the set and reset
registers (TCSxLR, TCSxHR, TCRxLR, and TCRxHR).
4. If you intend to use DMA control of Timer C, use TCBAR to access the Timer C
register pointed to by TCBPR.
5. Enable the desired output pins for Timer C by writing to the appropriate parallel port
function and alternate output registers.
6. Enable Timer C by writing a 1 to bit 0 of TCCSR.
16.3.1 Handling Interrupts
The following steps explain how an interrupt is used.
1. Write the vector to the interrupt service routine to the internal interrupt table.
2. Configure TCCR to select the interrupt priority (note that interrupts will be enabled
once this value is set).
The interrupt request is cleared by reading from TCCSR.
16.3.2 Example ISR
A sample interrupt handler is shown below.
timerC_isr::
push af ; save used registers
ioi ld a, (TCCSR) ; clear the interrupt request and get status
; handle all interrupts flagged in TCCSR here
pop af ; restore used registers
ipres
ret
Summary of Contents for Rabbit 5000
Page 1: ...Rabbit 5000 Microprocessor User s Manual 019 0168_E...
Page 11: ...Table of Contents Appendix B Rabbit 5000 Errata 401 B 1 Errata 401 Index 405...
Page 12: ...Rabbit 5000 Microprocessor User s Manual...
Page 20: ...20 Rabbit 5000 Microprocessor User s Manual...
Page 36: ...36 Rabbit 5000 Microprocessor User s Manual...
Page 56: ...56 Rabbit 5000 Microprocessor User s Manual...
Page 92: ...92 Rabbit 5000 Microprocessor User s Manual...
Page 104: ...104 Rabbit 5000 Microprocessor User s Manual...
Page 122: ...122 Rabbit 4000 Microprocessor User s Manual...
Page 142: ...142 Rabbit 5000 Microprocessor User s Manual...
Page 214: ...214 Rabbit 5000 Microprocessor User s Manual...
Page 228: ...228 Rabbit 5000 Microprocessor User s Manual...
Page 280: ...280 Rabbit 5000 Microprocessor User s Manual...
Page 298: ...298 Rabbit 5000 Microprocessor User s Manual...
Page 306: ...306 Rabbit 5000 Microprocessor User s Manual...
Page 314: ...314 Rabbit 5000 Microprocessor User s Manual...
Page 368: ...368 Rabbit 5000 Microprocessor User s Manual...
Page 388: ...388 Rabbit 5000 Microprocessor User s Manual...
Page 396: ...396 Rabbit 5000 Microprocessor User s Manual...
Page 404: ...404 Rabbit 5000 Microprocessor User s Manual...