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
200 of 464
NXP Semiconductors
UM10850
Chapter 13: LPC5410x SCTimer/PWM (SCT0)
–
Set the corresponding event bit in the LIMIT register for the event to set an upper
limit for the counter.
When a limit event occurs in unidirectional mode, the counter is cleared to zero
and begins counting up on the next clock edge.
When a limit event occurs in bidirectional mode, the counter begins to count down
from the current value on the next clock edge.
–
Set the corresponding event bit in the HALT register for the event to halt the
counter. If the counter is halted, it stops counting and no new events can occur.
The counter operation can only be restored by clearing the HALT_L and/or the
HALT_H bits in the CTRL register.
–
Set the corresponding event bit in the STOP register for the event to stop the
counter. If the counter is stopped, it stops counting. However, an event that is
configured as a transition on an input/output can restart the counter.
–
Set the corresponding event bit in the START register for the event to restart the
counting. Only events that are defined by an input changing can be used to restart
the counter.
4. Define which events contribute to the SCT interrupt:
–
Set the corresponding event bit in the EVEN and the EVFLAG registers to enable
the event to contribute to the SCT interrupt.
13.7.10.4 Configure multiple states
1. In the EVn_STATE register for each event (up to the maximum number of events on
this device, one register per event), select the state or states (up to 2) in which this
event is allowed to occur. Each state can be selected for more than one event.
2. Determine how the event affects the system state:
In the EVn_CTRL registers (up to the maximum number of events on this device, one
register per event), set the new state value in the STATEV field for this event. If the
event is the highest numbered in the current state, this value is either added to the
existing state value or replaces the existing state value, depending on the field
STATELD.
Remark:
If there are higher numbered events in the current state, this event cannot
change the state.
If the STATEV and STATELD values are set to zero, the state does not change.
13.7.10.5 Miscellaneous options
•
There are a certain (selectable) number of capture registers. Each capture register
can be programmed to capture the counter contents when one or more events occur.
•
If the counter is in bidirectional mode, the effect of set and clear of an output can be
made to depend on whether the counter is counting up or down by writing to the
OUTPUTDIRCTRL register.
13.7.11 Run the SCT
1. Configure the SCT (see
Section 13.7.10 “Configure the SCT”
2. Write to the STATE register to define the initial state. By default the initial state is state
0.