Timer 2 Mode 2 (Capture) - CMOSTEK CMT2380F17 Manual

Ultra low power sub-1ghz wireless mcu
Table of Contents

Advertisement

CMT2380F17

16.2.3 Timer 2 Mode 2 (Capture)

Figure 16–14 shows the capture mode there are two options selected by bit EXEN2 in T2CON. If
EXEN2=0, Timer 2 is a 16-bit timer or counter which, upon overflow, sets bit TF2 (Timer 2 overflow flag). This
bit can then be used to generate an interrupt (by enabling the Timer 2 interrupt bit in the IE register). If
EXEN2=1, Timer 2 still does the above, but with the added feature that a 1-to-0 transition at T2EXI, one of 8
Timer 2 external inputs, that causes the current value in the Timer 2 registers, TH2 and TL2, to be captured
into registers RCAP2H and RCAP2L, respectively. In addition, the transition at T2EXI causes bit EXF2 in
T2CON to be set, and the EXF2 bit (like TF2) can generate an interrupt which vectors to the same location as
Timer 2 overflow interrupt. T2EXH performs the same function as EXEN2 but it enables the detecting a 0-to-1
transition at T2EXI input.
Figure 16-14. Timer 2 Mode 2 Structure (Capture Mode)
www.cmostek.com
Rev0.1 | 143/347

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents