
Pulse-Width Modulation (PWM) Module
26-18
Freescale Semiconductor
Figure 26-17. PWM Left-Aligned Output Example Waveform
26.3.2.6
Center-Aligned Outputs
For center-aligned output mode selection, set the PWMCAE[CAE
n
] bit and the corresponding PWM
output is center-aligned.
The 8-bit counter operates as an up/down counter in this mode and is set to up when the counter is equal
to 0x00. The counter compares to two registers, a duty register and a period register, as shown in the block
diagram in
. When the PWM counter matches the duty register, the output flip-flop changes
state, causing the PWM waveform to also change state. A match between the PWM counter and the period
register changes the counter direction from an up-count to a down-count. When the PWM counter
decrements and matches the duty register again, the output flip-flop changes state causing the PWM output
to also change state. When the PWM counter decrements and reaches zero, the counter direction changes
from a down-count back to an up-count, and a load from the double buffer period and duty registers to the
associated registers is performed as described in
. The counter counts from 0 up to the value
in the period register and then back down to 0. Thus the effective period is PWMPER
n
×
2.
Changing the PWM output mode from left-aligned output to center-aligned output (or vice versa) while
channels are operating can cause irregularities in the PWM output. It is recommended to program the
output mode before enabling the PWM channel.
Figure 26-18. PWM Center-Aligned Output Waveform
To calculate the output frequency in center-aligned output mode for a particular channel, take the selected
clock source frequency for the channel (A, B, SA, or SB) and divide it by twice the value in the period
register for that channel.
Eqn. 26-9
The PWM
n
duty cycle (high time as a percentage of period) is expressed as:
PERIOD = 50ns
DUTY CYCLE = 75%
E = 12.5ns
PPOLn = 0
PPOLn = 1
Period = PWMPERn
×
2
PWMDTYn
PWMPERn
PWMPERn
PWMDTYn
PWM
n
frequency
Clock (A, B, SA, or SB)
2
P
×
WMPER
n
----------------------------------------------------------
=
MCF5329 Reference Manual, Rev 3
Содержание MCF5329
Страница 106: ...ColdFire Core 3 32 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 126: ...Enhanced Multiply Accumulate Unit EMAC 4 20 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 148: ...Cache 5 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 154: ...Static RAM SRAM 6 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 184: ...Power Management 8 18 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 204: ...Reset Controller Module 10 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 220: ...System Control Module SCM 11 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 228: ...Crossbar Switch XBS 12 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 268: ...General Purpose I O Module 13 40 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 392: ...SDRAM Controller SDRAMC 18 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 436: ...Fast Ethernet Controller FEC 19 44 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 564: ...Liquid Crystal Display Controller LCDC 22 44 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 594: ...FlexCAN 23 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 678: ...Pulse Width Modulation PWM Module 26 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 684: ...Watchdog Timer Module 27 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 692: ...Programmable Interrupt Timers PIT0 PIT3 28 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 704: ...DMA Timers DTIM0 DTIM3 29 12 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 720: ...Queued Serial Peripheral Interface QSPI 30 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 754: ...UART Modules 31 34 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 770: ...I2 C Interface 32 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 790: ...Message Digest Hardware Accelerator MDHA 33 20 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 866: ...Debug Module 36 50 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 902: ...Register Memory Map Quick Reference A 26 Freescale Semiconductor MCF5329 Reference Manual Rev 3...