DRAFT
DRAFT DRAFT DR
DRAFT DRAFT DRAFT
D
RAF
DRAFT DRAFT DRA
FT D
RAFT DR
AFT D
DRA
FT DRAFT DRAFT
D
RAFT
DRAFT
D
RAFT
DRA
UM10601
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
Preliminary user manual
Rev. 1.0 — 7 November 2012
135 of 313
NXP Semiconductors
UM10601
Chapter 10: LPC800 State Configurable Timer (SCT)
10.7.8 SCT operation
In its simplest, single-state configuration, the SCT operates as an event controlled one- or
bidirectional counter. Events can be configured to be counter match events, an input or
output level, transitions on an input or output pin, or a combination of match and
input/output behavior. In response to an event, the SCT output or outputs can transition,
or the SCT can perform other actions such as creating an interrupt or starting, stopping, or
resetting the counter. Multiple simultaneous actions are allowed for each event.
Furthermore, any number of events can trigger one specific action of the SCT.
An action or multiple actions of the SCT uniquely define an event. A state is defined by
which events are enabled to trigger an SCT action or actions in any stage of the counter.
Events not selected for this state are ignored.
In a multi-state configuration, states change in response to events. A state change is an
additional action that the SCT can perform when the event occurs. When an event is
configured to change the state, the new state defines a new set of events resulting in
different actions of the SCT. Through multiple cycles of the counter, events can change
the state multiple times and thus create a large variety of event controlled transitions on
the SCT outputs and/or interrupts.
Once configured, the SCT can run continuously without software intervention and can
generate multiple output patterns entirely under the control of events.
•
To configure the SCT, see
.
•
To start, run, and stop the SCT, see
•
To configure the SCT as simple event controlled counter/timer, see
10.7.9 Configure the SCT
To set up the SCT for multiple events and states, perform the following configuration
steps:
10.7.9.1 Configure the counter
1. Configure the L and H counters in the CONFIG register by selecting two independent
16-bit counters (L counter and H counter) or one combined 32-bit counter in the
UNIFY field.
2. Select the SCT clock source in the CONFIG register (fields CLKMODE and CLKSEL)
from any of the inputs or an internal clock.
10.7.9.2 Configure the match and capture registers
1. Select how many match and capture registers the application uses (total of up to 5):
–
In the REGMODE register, select for each of the 5 match/capture register pairs
whether the register is used as a match register or capture register.
2. Define match conditions for each match register selected:
–
Each match register MATCH sets one match value, if a 32-bit counter is used, or
two match values, if the L and H 16-bit counters are used.
–
Each match reload register MATCHRELOAD sets a reload value that is loaded into
the match register when the counter reaches a limit condition or the value 0.