38
JN-DS-JN5142 1v0
© NXP Laboratories UK 2012
11 Timers
11.1 Peripheral Timer/Counters
A general-purpose timer/counter unit, Timer0, is available that can be configured to operate in one of five possible
modes. This has:
5-bit prescaler, divides system clock by 2
prescale
value
as the clock to the timer (prescaler range is 0 to 16)
Clocked from internal system clock (16MHz)
16-bit counter, 16-bit Rise and Fall (period) registers
Timer: can generate interrupts off Rise and Fall counts. Can be gated by external signal
Counter: counts number of transitions on external event signal. Can use low-high, high-low or both
transitions
PWM/Single pulse: outputs repeating Pulse Width Modulation signal or a single pulse. Can set period and
mark-space ratio
Capture: measures times between transitions of an applied signal
Delta-Sigma: Return-To-Zero (RTZ) and Non-Return-to-Zero (NRZ) modes
Timer usage of external IO can be controlled on a pin by pin basis
Three further timers are also available that support the same functionality but have no Counter or Capture mode.
Additionally, is not possible to gate these three timers with an external signal.
>=
D Q
Rise
=
<
Fall
Delta Sigma
Interrupt
Generator
Counter
Interrupt Enable
Capture
Generator
Prescaler
SYSCLK
TIMxCK_GT
TIMxCAP
Interrupt
PWM/
DS
PWM/
DS
PWM/
DS
Reset
Generator
Edge
Select
EN
EN
TIMxOut
Sw
Reset
System
Reset
Single
Shot
-1
Figure 26: Timer Unit Block Diagram