3 measure period, 3 measure period -29, Maxq7667 user’s guide – Maxim Integrated MAXQ7667 User Manual
Page 123

6-29
__________________________________________________________________________________________________________
MAXQ7667 User’s Guide
T2P0 PIN
CODE EXECUTION:
POINT A
CODE EXECUTION:
POINT B
1A
2A
1B
2B
EVENTS:
1A: FALLING EDGE CAUSES CAPTURE/RELOAD; SINGLE-SHOT CAPTURE CYCLE BEGINS.
2A: FALLING EDGE CAUSES CAPTURE/RELOAD; SINGLE-SHOT CAPTURE CYCLE ENDS; PERIOD = T2C0.
1B AND 2B: SAME SEQUENCE AS 1A–2A, EXCEPT THAT THE SINGLE-SHOT CAPTURE CYCLE DOES NOT BEGIN UNTIL THE FIRST FALLING EDGE IS DETECTED.
Figure 6-10. Type 2 Timer Application Example—Measure Period
6.7.9.3 Measure Period
To measure the period of the signal seen on the T2P0 input pin, the Type 2 timer is configured for a single-shot capture, no gating,
either edge (selected by the CCF[1:0] bits). The CPRL2 bit can be set to generate a reload on each capture edge.
; ------------------ Reset State: T2R0 = T2V0 = T2C0 = 0000h ------------------------
MOVE T2CFG0, #00000100b
; T2CI
=0
(sysclk/N input)
; T2DIV2:0
=000
(/1)
; T2MD
=0 (16-bit)
; CCF1:0
=10 (falling
edge)
; C/T2
=0 (timer/capture)
MOVE T2CNA0, #10000110b
; ET2
=1
(enable Type 2 Timer ints)
; T2OE0
=0
(input)
; T2POL0
=0
(gating level = ‘0’)
; TR2L:TR2
=00
(don’t start timer )
; CPRL2
=1
(reload on capture edge)
; SS2
=1
(single shot mode)
; G2EN
=0
(gating disabled)
; ------------------ TCC2 Interrupt : PERIOD = T2C0