Owner's manual
MAXQ7665/MAXQ7666 User’s Guide
7-26
7.4.5 Overflow/Interrupt on Cumulative Time
To cause an overflow only when the T0 pin has been low for some cumulative duration, the Type 2 timer can be configured to the gated
compare mode of operation with an initial starting value appropriate for the cumulative duration to be detected.
; ------------------ Reset State: T2R0 = T2V0 = T2C0 = 0000h ------------------------
MOVE T2V0, #1234h ; Overflow after T0 input low for (10000h-01234h) T2CLKs
MOVE T2CFG0, #01110000b ;
; T2DIV[2:0] =111 (/128)
; T2MD =0 (16-bit)
; CCF[1:0] =00 (no edges)
; C/T2 =0 (timer/compare)
MOVE T2CNA0, #10101001b ; ET2 =1 (enable Timer ints)
; T2OE0 =0 (input)
; T2POL0 =1 (gating level = ‘1’)
; TR2L:TR2 =01 (start timer)
; CPRL2 =0 (no capture possible)
; SS2 =0 (not single shot mode)
; G2EN =1 (gating enabled)
; ------------------ TF2 Interrupt : Cumulative low duration reached
T0 PIN
CODE EXECUTION:
POINT A
CODE EXECUTION:
POINT B
1A
1B
2A
2B
EVENTS:
1A: GATING CONDITION IS REMOVED; TIMER BEGINS TO RUN.
2A: TIMER OVERFLOWS.
1B–2B: SAME SEQUENCE AS 1A–2A, EXCEPT THAT TIMER STARTS RUNNING IMMEDIATELY SINCE IT IS NOT GATED.
Figure 7-10. Type 2 Timer Application Example—Overflow/Interrupt on Cumulative Time
Maxim Integrated