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
197 of 464
NXP Semiconductors
UM10850
Chapter 13: LPC5410x SCTimer/PWM (SCT0)
Software can capture the counter value (and potentially create an interrupt and write to all
outputs) when the event moving the SCT into a locked state occurs.Later, while the SCT is
in the locked state, software can read the counter again to record the time passed since
the locking event and can also read the state variable to obtain the current state number
If the SCT registers an event that forces an abort, putting the SCT in a locked state can be
a safe way to record the time that has passed since the abort event while no new events
are allowed to occur. Since multiple states (any state number between the maximum
implemented state and 31) are locked states, multiple abort or error events can be defined
each incrementing the state number by a different value.
13.7.6 Interrupt generation
The SCT generates one interrupt to the NVIC.
13.7.7 Clearing the prescaler
When enabled by a non-zero PRE field in the Control register, the prescaler acts as a
clock divider for the counter, like a fractional part of the counter value. The prescaler is
cleared whenever the counter is cleared or loaded for any of the following reasons:
•
Hardware reset
•
Software writing to the counter register
•
Software writing a 1 to the CLRCTR bit in the control register
•
an event selected by a 1 in the counter limit register when BIDIR = 0
When BIDIR is 0, a limit event caused by an I/O signal can clear a non-zero prescaler.
However, a limit event caused by a Match only clears a non-zero prescaler in one special
case as described
A limit event when BIDIR is 1 does not clear the prescaler. Rather it clears the DOWN bit
in the Control register, and decrements the counter on the same clock if the counter is
enabled in that clock.
13.7.8 Match vs. I/O events
Counter operation is complicated by the prescaler and by clock mode 01 in which the SCT
clock is the bus clock. However, the prescaler and counter are enabled to count only when
a selected edge is detected on a clock input.
Fig 27. SCT interrupt generation
(QDEOH
UHJLVWHU
(YHQWV
)ODJV
UHJLVWHU
1R &KDQJH
&RQIOLFWHYHQWV
6&7LQWHUUXSW
&RQIOLFW
(QDEOH
UHJLVWHU
&RQIOLFW
)ODJV
UHJLVWHU