UM11029
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2017. All rights reserved.
User manual
Rev. 1.0 — 16 June 2017
376 of 515
NXP Semiconductors
UM11029
Chapter 21: LPC84x SCTimer/PWM
21.5 General description
The SCTimer/PWM is a powerful, flexible timer module capable of creating complex PWM
waveforms and performing other advanced timing and control operations with minimal or
no CPU intervention.
The SCTimer/PWM can operate as a single 32-bit counter or as two independent, 16-bit
counters in unidirectional or bidirectional mode. As with most timers, the SCTimer/PWM
supports a selection of match registers against which the count value can be compared,
and capture registers where the current count value can be recorded when some
pre-defined condition is detected.
An additional feature contributing to the versatility of the SCTimer/PWM is the concept of
“events”. The SCTimer/PWM module supports multiple separate events that can be
defined by the user based on some combination of parameters including a match on one
of the match registers, and/or a transition on one of the SCTimer/PWM inputs or outputs,
the direction of count, and other factors.
Every action that the SCTimer/PWM block can perform occurs in direct response to one of
these user-defined events without any software overhead. Any event can be enabled to:
•
Start, stop, or halt the counter.
•
Limit the counter which means to clear the counter in unidirectional mode or change
its direction in bidirectional mode.
•
Set, clear, or toggle any SCTimer/PWM output.
•
Force a capture of the count value into any capture registers.
•
Generate an interrupt or DMA request.
The SCTimer/PWM allows the user to group and filter events, thereby selecting some
events to be enabled together while others are disabled. A group of enabled and disabled
events can be described as a state, and several states with different sets of enabled and
disabled events are allowed. Changing from one state to another is event driven as well
and can therefore happen without software intervention. By defining these states, the
SCTimer/PWM provides the means to run entire state machines in hardware with any
desired level of complexity to accomplish complex waveform and timing tasks.
In a simple system such as a classical timer/counter with capture and match capabilities.
all events that could cause the timer to capture the timer value or toggle a match output
are enabled and remain enabled at all times while the counter is running. In this case, no
events are filtered and the system is described by one state that does not change. This is
the default configuration of the SCTimer/PWM.
In a more complex system, two states could be set up that allow some events in one state
and not in the other. An event itself, enabled in both states, can then be used, to move
from one state to the other and back while filtering out events in either state. In such a
two-state system different waveforms at the SCTimer/PWM output can be created
depending on the event history. Changing between states is event-driven and happens
without any intervention by the CPU.
Formally, the SCTimer/PWM can be programmed as state machine generator. The ability
to perform switching between groups of events provides the SCTimer/PWM the unique
capability to be utilized as a highly complex State Machine engine. Events identify the