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
183 of 464
NXP Semiconductors
UM10850
Chapter 13: LPC5410x SCTimer/PWM (SCT0)
Each bit of the register is associated with a different event (bit 0 with event 0, etc.). Setting
a bit will cause its associated event to serve as a START event. When any START event
occurs, hardware will clear the STOP bit in the Control Register CTRL. Note that a START
event has no effect on the HALT bit. Only software can remove a HALT condition. To
define the actual event that starts the counter (an I/O pin toggle or an event generated by
the other running counter in dual-counter mode), see the EVn_CTRL register.
If UNIFY = 1 in the CONFIG register, only the _L bits are used.
If UNIFY = 0 in the CONFIG register, this register can be written to as two registers
START_L and START_H. Both the L and H registers can be read or written individually or
in a single 32-bit read or write operation.
13.6.8 SCT counter register
If UNIFY = 1 in the CONFIG register, the counter is a unified 32-bit register and both the
_L and _H bits are used.
If UNIFY = 0 in the CONFIG register, this register can be written to as two registers
COUNT_L and COUNT_H. Both the L and H registers can be read or written individually
or in a single 32-bit read or write operation. In this case, the L and H registers count
independently under the control of the other registers.
Writing to the COUNT_L, COUNT_H, or unified register is only allowed when the
corresponding counter is halted (HALT bits are set to 1 in the CTRL register). Attempting
to write to the counter when it is not halted causes a bus error. Software can read the
counter registers at any time.
13.6.9 SCT state register
Each group of enabled and disabled events is assigned a number called the state
variable. For example, a state variable with a value of 0 could have events 0, 2, and 3
enabled and all other events disabled. A state variable with the value of 1 could have
events 1, 4, and 5 enabled and all others disabled.
Remark:
The EVm_STATE registers define which event is enabled in each group.
Software can read the state associated with a counter at any time. Writing to the
STATE_L, STATE_H, or unified register is only allowed when the corresponding counter is
halted (HALT bits are set to 1 in the CTRL register).
Table 215. SCT start event select register (START, address 0x5000 4014) bit description
Bit
Symbol
Description
Reset value
15:0
STARTMSK_L
If bit n is one, event n clears the STOP_L bit in the CTRL register (event 0 = bit 0,
event 1 = bit 1, …). The number of bits = number of events in this SCT.
0
31:16
STARTMSK_H
If bit n is one, event n clears the STOP_H bit in the CTRL register (event 0 = bit 16,
event 1 = bit 17, …). The number of bits = number of events in this SCT.
0
Table 216. SCT counter register (COUNT, address 0x5000 4040) bit description
Bit
Symbol
Description
Reset value
15:0
CTR_L
When UNIFY = 0, read or write the 16-bit L counter value. When UNIFY = 1, read or write
the lower 16 bits of the 32-bit unified counter.
0
31:16
CTR_H
When UNIFY = 0, read or write the 16-bit H counter value. When UNIFY = 1, read or write
the upper 16 bits of the 32-bit unified counter.
0