1 architecture, 1 modes of operation for, 1 architecture -3 – Maxim Integrated MAXQ7667 User Manual
Page 97: 1 modes of operation for type 2 timer/counter -3, Maxq7667 user’s guide
6-3
___________________________________________________________________________________________________________
MAXQ7667 User’s Guide
SECTION 6: TYPE 2 TIMER/COUNTER MODULE
The MAXQ7667 microcontroller has three Type 2 timer/counters. The Type 2 timer/counter is an autoreload 16-bit timer/counter with the
following functions:
•
8-bit/16-bit timer/counter
•
Up/down autoreload
•
Counter function of external pulse
•
Capture
•
Compare
•
Input/output enhancements
The three Type 2 timer/counter modules supported in the MAXQ7667 are referred to as timer 0, timer 1, and timer 2. To simplify the discus-
sion, the generic notation "x" is appended to register and pin names to denote to which timer/counter module they belong (x = 0, 1, 2).
6.1 Architecture
6.1.1 Modes of Operation for Type 2 Timer/Counter
16-Bit Autoreload/Compare Timer: In this mode a timer is generated that can be used internally or sent out via the primary and/or
the secondary pin as a waveform or PWM. This mode allows the flexibility to control the waveform output either through firmware or
through an external signal on the primary pin.
16-Bit Capture: In this mode, only the primary pin is used, as an input to time an event on a waveform (e.g., duty cycle, period, etc.).
No waveform output is allowed.
16-Bit Counter: In this mode, the primary pin is used to count transitions on an input signal. This transition can be a rising edge, a
falling edge, or both rising and falling edges. The secondary pin is used to output the generated waveform resulting from compare
match and overflow conditions for the counter.
Dual 8-Bit Autoreload Timers: In this mode two timers are generated that can be used internally or delivered as a waveform/PWM to
the primary pin and to the secondary pin; otherwise it serves as an internal timer.
8-Bit Capture and 8-Bit Timer/PWM: The primary pin can be used to time an event on a waveform. The secondary timer/compare
can be either used internally or delivered as a waveform/PWM to the secondary pin (not available for timer 1).
8-Bit Counter and 8-Bit Timer/PWM: The primary pin can be used to count transitions in an input signal. This transition can be a ris-
ing edge, a falling edge, or both rising and falling edge. The secondary timer/compare can be used internally or delivered as a wave-
form/PWM to the secondary pin (not available for timer 1).
Figure 6-1 shows the 16-bit operation of the timer/counter and Figure 6-2 shows the 8-bit operation of the timer/counter.
The 16-bit Type 2 timer value is contained in the T2Vx register. The upper byte is always accessible through the T2Hx 8-bit register.
When the Type 2 timer is operated in the dual 8-bit mode of operation, the high byte of T2Vx always reads x00h and is not write acces-
sible. The low byte of the T2Vx is often referenced as T2Lx. Similar registers and nomenclature are used for the Type 2 timer autore-
load register, T2Rx. A separate 8-bit T2RHx register allows read/write access to the high byte. The low byte of T2Rx is often referred
to as T2RLx. The capture/compare functionality is supported by the timer through the 16-bit T2Cx capture register and the 8-bit T2CHx
high-byte access register.
For convenience, the lower byte of T2Vx is referred to as T2Lx. Unlike T2Hx, there is no separate T2Lx register and the low byte is
always accessed through T2Vx. Similarly, the lower byte of T2Rx is referred to as T2RLx and the lower byte of T2Cx is referred to as
T2CLx. There are no separate T2RLx and T2CLx registers.