
UM10850
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 2.4 — 13 September 2016
203 of 464
NXP Semiconductors
UM10850
Chapter 13: LPC5410x SCTimer/PWM (SCT0)
Define match values
MATCH
0/1/2/3/4
Set a match value MATCH0/1/2/4/5_L in each register. The match 0 register
serves as an automatic limit event that resets the counter. without using an
event. To enable the automatic limit, set the AUTOLIMIT bit in the CONFIG
register.
Define match reload
values
MATCHREL
0/1/2/3/4
Set a match reload value RELOAD0/1/2/3/4_L in each register (same as the
match value in this example).
Define when event 0
occurs
EV0_CTRL
•
Set COMBMODE = 0x1. Event 0 uses match condition only.
•
Set MATCHSEL = 1. Select match value of match register 1. The match
value of MAT1 is associated with event 0.
Define when event 1
occurs
EV1_CTRL
•
Set COMBMODE = 0x1. Event 1 uses match condition only.
•
Set MATCHSEL = 2 Select match value of match register 2. The match
value of MAT2 is associated with event 1.
Define when event 2
occurs
EV2_CTRL
•
Set COMBMODE = 0x3. Event 2 uses match condition and I/O condition.
•
Set IOSEL = 0. Select input 0.
•
Set IOCOND = 0x0. Input 0 is LOW.
•
Set MATCHSEL = 0. Chooses match register 0 to qualify the event.
Define how event 2
changes the state
EV2_CTRL
Set STATEV bits to 1 and the STATED bit to 1. Event 2 changes the state to
state 1.
Define when event 3
occurs
EV3_CTRL
•
Set COMBMODE = 0x1. Event 3 uses match condition only.
•
Set MATCHSEL = 0x3. Select match value of match register 3. The match
value of MAT3 is associated with event 3..
Define when event 4
occurs
EV4_CTRL
•
Set COMBMODE = 0x1. Event 4 uses match condition only.
•
Set MATCHSEL = 0x4. Select match value of match register 4.The match
value of MAT4 is associated with event 4.
Define when event 5
occurs
EV5_CTRL
•
Set COMBMODE = 0x3. Event 5 uses match condition and I/O condition.
•
Set IOSEL = 0. Select input 0.
•
Set IOCOND = 0x3. Input 0 is HIGH.
•
Set MATCHSEL = 0. Chooses match register 0 to qualify the event.
Define how event 5
changes the state
EV5_CTRL
Set STATEV bits to 0 and the STATED bit to 1. Event 5 changes the state to
state 0.
Define by which events
output 0 is set
OUT0_SET
Set SET0 bits 0 (for event 0) and 3 (for event 3) to one to set the output when
these events 0 and 3 occur.
Define by which events
output 0 is cleared
OUT0_CLR
Set CLR0 bits 1 (for events 1) and 4 (for event 4) to one to clear the output
when events 1 and 4 occur.
Configure states in which
event 0 is enabled
EV0_STATE
Set STATEMSK0 bit 0 to 1. Set all other bits to 0. Event 0 is enabled in state 0.
Configure states in which
event 1 is enabled
EV1_STATE
Set STATEMSK1 bit 0 to 1. Set all other bits to 0. Event 1 is enabled in state 0.
Configure states in which
event 2 is enabled
EV2_STATE
Set STATEMSK2 bit 0 to 1. Set all other bits to 0. Event 2 is enabled in state 0.
Configure states in which
event 3 is enabled
EV3_STATE
Set STATEMSK3 bit 1 to 1. Set all other bits to 0. Event 3 is enabled in state 1.
Configure states in which
event 4 is enabled
EV4_STATE
Set STATEMSK4 bit 1 to 1. Set all other bits to 0. Event 4 is enabled in state 1.
Configure states in which
event 5 is enabled
EV5_STATE
Set STATEMSK5 bit 1 to 1. Set all other bits to 0. Event 5 is enabled in state 1.
Table 238. SCT configuration example
Configuration
Registers
Setting