
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
283 of 487
NXP Semiconductors
UM10800
Chapter 16: LPC82x SCTimer/PWM
An event n is disabled when its EVn_STATE register contains all zeros, since it is masked
regardless of the current state.
In simple applications that do not use states, write 0x01 to this register to enable each
event in exactly one state. Since the state doesn’t change (that is, the state variable
always remains at its reset value of 0), writing 0x01 permanently enables this event.
16.6.25 SCT event control registers 0 to 7
This register defines the conditions for an event to occur based on the counter values or
input and output states.Once the event is configured, it can trigger any of the actions for
which it has been selected (for example stop the counter and toggle an output) unless the
event is blocked in the current state of the SCT or the counter is halted. To block a
particular event from occurring in any given context, use the EV_STATE register. To block
all events for a given counter, set the HALT bit in the CTRL register or select an event to
halt the counter.
An event can be programmed to occur based on a selected input or output edge or level
and/or based on its counter value matching a selected match register. In bi-directional
mode, events can also be enabled based on the direction of count.
When the UNIFY bit is 0, each event is associated with a particular counter by the
HEVENT bit in its event control register. An event is permanently disabled when its event
state mask register contains all 0s.
Each event can modify its counter STATE value. If more than one event associated with
the same counter occurs in a given clock cycle, only the state change specified for the
highest-numbered event among them takes place. Other actions dictated by any
simultaneously occurring events all take place.
Table 246. SCT event state mask registers 0 to 7 (EV[0:7]_STATE, addresses 0x5000 4300
(EV0_STATE) to 0x5000 4338 (EV7_STATE)) bit description
Bit
Symbol
Description
Reset
value
7:0
STATEMSKn
If bit m is one, event n (n= 0 to 7) happens in state m of the
counter selected by the HEVENT bit (m = state number; state 0 =
bit 0, state 1= bit 1,..., state 7 = bit 7).
0
31:8
-
Reserved.
-
Table 247. SCT event control register 0 to 7 (EV[0:7]_CTRL, address 0x5000 4304 (EV0_CTRL) to 0x5000 433C
(EV7_CTRL)) bit description
Bit
Symbol
Value Description
Reset
value
3:0
MATCHSEL
-
Selects the Match register associated with this event (if any). A match can occur only
when the counter selected by the HEVENT bit is running.
0
4
HEVENT
Select L/H counter. Do not set this bit if UNIFY = 1.
0
0
Selects the L state and the L match register selected by MATCHSEL.
1
Selects the H state and the H match register selected by MATCHSEL.
5
OUTSEL
Input/output select
0
0
Selects the inputs elected by IOSEL.
1
Selects the outputs selected by IOSEL.