
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
512 of 808
NXP Semiconductors
UM10360
Chapter 25: LPC17xx Motor Control PWM
8.2 Shadow registers and simultaneous updates
The Limit, Match, and Communication Pattern registers (MCLIM, MCMAT, and MCCP) are
implemented as register pairs, each consisting of a write register and an operational
register. Software writes into the write registers. The operational registers control the
actual operation of each channel and are loaded with the current value in the write
registers when the TC starts counting up from 0.
Updating of the functional registers can be disabled by setting a channel’s DISUP bit in
the MCCON register. If the DISUP bits are set, the functional registers are not updated
until software stops the channel.
If a channel is not running when software writes to its LIM or MAT register, the functional
register is updated immediately.
Software can write to a TC register only when its channel is stopped.
8.3 Fast Abort (ABORT)
The MCPWM has an external input MCABORT. When this input goes low, all six MCO
outputs assume their “A passive” states, and the Abort interrupt is generated if enabled.
The outputs remain locked in “A passive” state until the ABORT interrupt flag is cleared or
the Abort interrupt is disabled. The ABORT flag may not be cleared before the MCABORT
input goes high.
8.4 Capture events
Each PWM channel can take a snapshot of its TC when an input signal transitions. Any
channel may use any combination of rising and/or falling edges on any or all of the MCI0-2
inputs as a capture event, under control of the MCCAPCON register. Rising or falling
edges on the inputs are detected synchronously with respect to PCLK.
If a channel’s HNF bit in the MCCAPCON register is set to enable “noise filtering”, a
selected edge on an MCI pin starts the dead-time counter for that channel, and the
capture event actions described below are delayed until the dead-time counter reaches 0.
This function is targeted specifically for performing three-phase brushless DC motor
control with Hall sensors.
A capture event on a channel (possibly delayed by HNF) causes the following:
•
The current value of the TC is stored in the Capture register (CAP).
•
If the channel’s capture event interrupt is enabled (see
), the capture
event interrupt flag is set.
•
If the channel’s RT bit is set in the MCCAPCON register, enabling reset on a capture
event, the input event has the same effect as matching the channel’s TC to its LIM
register. This includes resetting the TC and switching the MCO pin(s) in edge-aligned
mode as described in
and
.
8.5 External event counting (Counter mode)
If a channel’s MODE bit is 1 in MCCNTCON, its TC is incremented by rising and/or falling
edge(s) (synchronously detected) on the MCI0-2 input(s), rather than by PCLK. The PWM
functions and capture functions are unaffected.