
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
260 of 487
NXP Semiconductors
UM10800
Chapter 16: LPC82x SCTimer/PWM
An additional feature contributing to the versatility of the SCT is the concept of “events”.
The SCT 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 SCT inputs or outputs, the direction of count, and other
factors.
Every action that the SCT block can perform occurs in direct response to one if 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 uni-directional mode or change
its direction in bi-directional mode.
•
Set, clear, or toggle any SCT output.
•
Force a capture of the count value into any capture registers.
•
Generate an interrupt of DMA request.
Regarding states, maybe include something like this:
The SCT 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 SCT.
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 SCT 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 SCT the unique capability to
be utilized as a highly complex State Machine engine. Events identify the occurrence of
conditions that warrant state changes and determine the next state to move to. This
provides an extremely powerful control tool - particularly when the SCT inputs and outputs
are connected to other on-chip resources (comparators, ADC triggers, other timers etc.) in
addition to general-purpose I/O.
In addition to events and states, the SCTimer/PWM provides other enhanced features:
•
Four alternative clocking modes including a fully asynchronous mode.
•
Selection of any SCT input as a clock source or a clock gate.
•
Capability of selecting a “greater-than-or-equal-to” match condition for the purpose of