![NXP Semiconductors LPC84x Скачать руководство пользователя страница 406](http://html.mh-extra.com/html/nxp-semiconductors/lpc84x/lpc84x_user-manual_1721742406.webp)
UM11029
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2017. All rights reserved.
User manual
Rev. 1.0 — 16 June 2017
406 of 515
NXP Semiconductors
UM11029
Chapter 21: LPC84x SCTimer/PWM
If an event increments the state number beyond the number of available states, the
SCTimer/PWM enters a locked state in which all further events are ignored while the
counter is still running. Software must intervene to change out of this state.
Software can capture the counter value (and potentially create an interrupt and write to all
outputs) when the event moving the SCTimer/PWM into a locked state occurs. Later,
while the SCTimer/PWM 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 SCTimer/PWM registers an event that forces an abort, putting the SCTimer/PWM 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.
21.7.6 Interrupt generation
The SCTimer/PWM generates one interrupt to the NVIC.
21.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
Fig 49. SCTimer/PWM interrupt generation
(9(1
UHJLVWHU
(YHQWV
&21(1
UHJLVWHU
(9)/$*
UHJLVWHU
&21)/$*6
UHJLVWHU
&RQIOLFWUHVROXWLRQHYHQWV
ZLWKQRFKDQJHVHOHFWHG
6&7LQWHUUXSW