English
Language : 

RF60 Datasheet, PDF (137/157 Pages) –
RF60 CRYSTAL-LESS SOC TRANSMITTER v1.0
33.2. 16-bit Timer with Auto Reload (Wide Mode)
When TMR2SPLIT=0 and TMR2L_CAP=0, the timer operates as a 16-bit timer with auto reload.
As the 16-bit timer register increments and overflows from 0xFFFF to 0x0000, the 16-bit value in the time
reload registers (TMR2RH and TMR2RL) is loaded into the timer register as shown in Figure 33.2, and the
timer High Byte Overflow Flag TMR2INTH (TMR2CTRL.7) is set. If timer interrupts are enabled (see IE
and EIE1 registers), an interrupt will be generated on each timer overflow. Additionally, if timer interrupts
are enabled and the TMR2INTL_EN bit is set (TMR2CTRL.5), an interrupt will be generated each time the
lower 8 bits (TMR2L) overflow from 0xFF to 0x00.
TMR_CLKSEL
clk_sys
clk_sys/12
rtc_tick (5.33us)
rtc_pulse (100us)
2
0
1
2
3
TMR2L_RUN
TMR2L
TMR2L overflow
TMR2H
TMR2RL
TMR2RH
Reload
TMR2INTH
TMR2INTL
TMR2INTL_EN
TMR2SPLIT
TMR2H_CAP
TMR2L_CAP
TMR2H_RUN
TMR2L_RUN
Figure 33.2. Timer 16-bit Mode Block Diagram (Wide Mode)
Interrupt
33.3. 16-bit Capture Mode (Wide Mode)
When TMR2SPLIT=0 and TMR2L_CAP=1, the timer operates in a 16-bit capture mode. The capture event
is INT0 for Timer 2 and INT1 for Timer 3. It is the same edge event as programmed to generate external
interrupt INT0 or INT1, respectively. The capture event can be positive edge, negative edge, or both edges
of the GPIO associated with the INT0 and INT1. Capture mode can be used for measurement of time inter-
vals on external signals.
Timer counts up and overflows from 0xFFFF to 0x0000. Each time a capture event is received, the con-
tents of the timer registers (TMR2H:TMR2L) are latched into the timer reload registers
(TMR2RH:TMR2RL). A timer high half interrupt TMR2INTH is generated by capture event. Additionally, the
low byte interrupt flag TMR2INTL is set whenever the timer overflows from 0xFFFF to 0x0000. This addi-
tional information may be used by and application.
Note that the capture event can also generate its own external interrupt on top of the timer interrupt, if
enabled by the application. Also note that if the capture timer is stopped (TMR2L_RUN=0) the capture
event still captures the current counter registers (TMR2H:TMR2L) into the timer reload registers
(TMR2H:TMR2RL) and sets the flag TMR2INTH.
Tel: +86-755-82973805
Fax: +86-755-82973550
137
E-mail: sales@hoperf.com http://www.hoperf.com