UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
843 of 1269
NXP Semiconductors
UM10503
Chapter 28: LPC43xx State Configurable Timer (SCT)
–
When the counters are stopped, both an event configured to clear the STOP bit or
software writing a zero to the STOP bit can start the counter again.
–
When the counter are halted, only a software write to clear the HALT bit can start
the counter again. No events can occur.
–
When the counters are halted, software can set any SCT output HIGH or LOW
directly by writing to the OUT register.
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.
28.7.10.3 Configure the SCT without using states
The SCT can be used as standard counter/timer with external capture inputs and match
outputs without using the state logic. To operate the SCT without states, configure the
SCT 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 EVSTATEMASK 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.
28.7.10.4 Example
shows a simple application of the SCT using two sets of match events (EV0/1
and EV3/4) to set/clear SCT output 0. A third match event (EV2) is used to reset the
counter regardless of the current state.
In the initial state 0, match event EV0 sets output 0 to HIGH and match event EV1 clears
output 0. The SCT input 0 is monitored: If the input transitions from HIGH to LOW (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 transitions from LOW to HIGH, the
associated event (EV5) causes the state to change back to state 0. In state 0, the events
EV0 and EV1 are enabled.
The example uses the following SCT configuration:
•
1 input
•
1 output
•
5 match registers
•
7 events
•
2 states