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
391 of 515
NXP Semiconductors
UM11029
Chapter 21: LPC84x SCTimer/PWM
21.6.8 SCTimer/PWM 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.
21.6.9 SCTimer/PWM 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).
The state variable is the main feature that distinguishes the SCTimer/PWM from other
counter/timer/ PWM blocks. Events can be made to occur only in certain states. Events, in
turn, can perform the following actions:
•
set and clear outputs
•
limit, stop, and start the counter
•
cause interrupts and DMA requests
•
modify the state variable
The value of a state variable is completely under the control of the application. If an
application does not use states, the value of the state variable remains zero, which is the
default value.
Table 392. SCTimer/PWM counter register (COUNT, offset 0x040) 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