Pulse-Width Modulation (PWM) ModuleMCF5272 ColdFire ® Integrated Microprocessor User’s Manual, Rev. 318-2 Freescale SemiconductorSummary of the main features include:• Double-buffered width register• Variable-divide prescale• Three independent PWM modules• Byte-wide width register provides programmable duty cycle control18.2 PWM OperationThe PWM is a simple free-running counter combined with a pulse-width register and a comparator suchthat the output is cleared whenever the counter value exceeds the width register value. When the counteroverflows, or “wraps around,” its value becomes less than or equal to the value of the width register, andthe output is set. With a suitable low-pass filter, the PWM can be used as a digital-to-analog converter.The width register is double-buffered so that a new value can be loaded for the next cycle without affectingthe current cycle. At the beginning of each period, the value of the width buffer register is loaded into thewidth register, which feeds the comparator. This value is used for comparison during the next cycle. Theprescaler contains a variable divider that can reduce the incoming clock frequency by certain valuesbetween 1 and 32768.18.3 PWM Programming ModelThis section describes the registers and control bits in the PWM module. There are three independentPWM modules, each with its own control and width registers. The memory map for the PWM is shown inTable 18-1.Table 18-1. PWM Module Memory MapMBAROffset [31:24] [23:16] [15:8] [7:0]0x00C0 PWM Control Register 0(PWCR0)Reserved0x00C4 PWM Control Register 1(PWCR1)Reserved0x00C8 PWM Control Register 2(PWCR2)Reserved0x00D0 PWM Pulse-Width Register 0(PWWD0)Reserved0x00D4 PWM Pulse-Width Register 1(PWWD1)Reserved0x00D8 PWM Pulse-Width Register 2(PWWD2)Reserved