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
409 of 515
NXP Semiconductors
UM11029
Chapter 21: LPC84x SCTimer/PWM
–
Each match reload register MATCHRELOAD sets a reload value that is loaded into
the match register when the counter reaches a limit condition or the value 0.
21.7.10.3 Configure events and event responses
1. Define when each event can occur in the following way in the EVn_CTRL registers
(up to 6, one register per event):
–
Select whether the event occurs on an input or output changing, on an input or
output level, a match condition of the counter, or a combination of match and
input/output conditions in field COMBMODE.
–
For a match condition:
Select the match register that contains the match condition for the event to occur.
Enter the number of the selected match register in field MATCHSEL.
If using L and H counters, define whether the event occurs on matching the L or
the H counter in field HEVENT.
–
For an SCTimer/PWM input or output level or transition:
Select the input number or the output number that is associated with this event in
fields IOSEL and OUTSEL.
Define how the selected input or output triggers the event (edge or level sensitive)
in field IOCOND.
2. Define what the effect of each event is on the SCTimer/PWM outputs in the
OUTn_SET or OUTn_CLR registers (up to 4 outputs, one register per output):
–
For each SCTimer/PWM output, select which events set or clear this output. More
than one event can change the output, and each event can change multiple
outputs.
3. Define how each event affects the counter:
–
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 SCTimer/PWM interrupt:
–
Set the corresponding event bit in the EVEN and the EVFLAG registers to enable
the event to contribute to the SCTimer/PWM interrupt.