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
411 of 515
NXP Semiconductors
UM11029
Chapter 21: LPC84x SCTimer/PWM
The current state can be read at any time by reading the STATE register.
To change the current state by software (that is independently of any event occurring), set
the HALT bit and write to the STATE register to change the state value. Writing to the
STATE register is only allowed when the counter is halted (the HALT_L and/or HALT_H
bits are set) and no events can occur.
21.7.12 Configure the SCTimer/PWM without using states
The SCTimer/PWM can be used as standard counter/timer with external capture inputs
and match outputs without using the state logic. To operate the SCTimer/PWM without
states, configure the SCTimer/PWM as follows:
•
Write zero to the STATE register (zero is the default).
•
Write zero to the STATELD and STATEV fields in the EVCTRL registers for each
event.
•
Write 0x1 to the EVn_STATE register of each event. Writing 0x1 enables the event.
In effect, the event is allowed to occur in a single state which never changes while the
counter is running.
21.7.13 SCTimer/PWM PWM Example
shows a simple application of the SCTimer/PWM using two sets of match
events (EV0/1 and EV3/4) to set/clear SCTimer/PWM output 0. The timer is automatically
reset whenever it reaches the MAT0 match value.
In the initial state 0, match event EV0 sets output 0 to HIGH and match event EV1 clears
output 0. The SCTimer/PWM input 0 is monitored: If input0 is found LOW by the next time
the timer is reset(EV2), the state is changed to state 1, and EV3/4 are enabled, which
create the same output but triggered by different match values. If input 0 is found HIGH by
the next time the timer is reset, the associated event (EV5) causes the state to change
back to state 0where the events EV0 and EV1 are enabled.
The example uses the following SCTimer/PWM configuration:
•
1 input
•
1 output
•
5 match registers
•
6 events and match 0 used with autolimit function
•
2 states