Download MCF5373 Reference Manual
Transcript
Pulse-Width Modulation (PWM) Module 25.3.2.5 Left-Aligned Outputs The PWM timer provides the choice of two types of outputs: left- or center-aligned. They are selected with the PWMCAE[CAEn] bits. If the CAEn bit is cleared, the corresponding PWM output is left-aligned. In left-aligned output mode, the 8-bit counter is configured as an up counter only. It compares to two registers, a duty register and a period register, as shown in the block diagram in Figure 25-15. 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 resets the counter and the output flip-flop, as shown in Figure 25-16, as well as performing a load from the double buffer period and duty register to the associated registers, as described in Figure 25.3.2.3. The counter counts from 0 to the value in the period register minus 1. NOTE Changing the PWM output mode from left-aligned 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. PPOLn = 0 PPOLn = 1 PWMDTYn Period = PWMPERn Figure 25-16. PWM Left-Aligned Output Waveform To calculate the output frequency in left-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 the value in the period register for that channel. Clock (A, B, SA, or SB) PWMn frequency = ---------------------------------------------------------PWMPERn Eqn. 25-7 The PWMn duty cycle (high time as a percentage of period) is expressed as: PWMDTYn Duty Cycle = ⎛ 1 – PWMPOL [ PPOLn ] – -------------------------------⎞ × 100% ⎝ PWMPERn ⎠ 25.3.2.5.1 Eqn. 25-8 Left-Aligned Output Example As an example of a left-aligned output, consider the following case: Clock source = internal bus clock, where internal bus clock = 80 MHz (12.5 ns period) PPOLn = 0, PWMPERn = 4, PWMDTYn = 1 PWMn frequency = 80 MHz ÷ 4 = 20 MHz PWMn period = 50 ns 1 PWMn Duty Cycle = ⎛ 1 – ---⎞ × 100% = 75% ⎝ 4⎠ The output waveform generated is below: MCF5373 Reference Manual, Rev 3 Freescale Semiconductor 25-17
Related documents
MCF5329 - Reference Manual
MCF5208RM, MCF5208
Motorola ColdFire MCF5281 Specifications
MCF5235RM, MCF5235
MCF5485 Reference Manual - Freescale Semiconductor
NetBurner User`s Manual - Bluewater Designworks, LLC
User Manual
AN2866:Migrating from the MC68332 to the ColdFire MCF523x
View/Open - Oregon State University
BlueNRG(-MS) - STMicroelectronics