
Pulse-Width Modulation (PWM) Module
26-14
Freescale Semiconductor
26.3.1.2
Scaled Clock (SA or SB)
The scaled A (SA) and scaled B (SB) clocks use clock A and B respectively as inputs, divide it further with
a user programmable value, then divide this by 2. The rates available for clock SA are programmable to
run at clock A divided by 2, 4,..., or 512. Similar rates are available for clock SB.
Clock SA equals clock A divided by two times the value in the PWMSCLA register:
Eqn. 26-5
Similarly, clock SB is generated according to the following equation:
Eqn. 26-6
As an example, consider the case in which the user writes 0xFF into the PWMSCLA register. Clock A for
this case is selected to be internal bus clock divided by 4. A pulse occurs at a rate of once every 255
×
4 bus
cycles. Passing this through the divide by two circuit produces a clock signal of the internal bus clock
divided by 2040. Similarly, a value of 0x01 in the PWMSCLA register when clock A is internal bus clock
divided by 4 produces an internal bus clock divided by 8 rate.
Writing to PWMSCLA or PWMSCLB causes the associated 8-bit down counter to be re-loaded.
Otherwise, when changing rates, the counter would have to count down to 0x01 before counting at the
proper rate. Forcing the associated counter to re-load the scale register value every time PWMSCLA or
PWMSCLB is written prevents this.
Writing to the scale registers while channels are operating can cause irregularities in the PWM outputs.
26.3.1.3
Clock Select
Each PWM channel has the capability of selecting one of two clocks. For channels 0, 1, 4, and 5 the clock
choices are clock A or SA. For channels 2, 3, 6 and 7, the choices are clock B or SB. The clock selection
is done with the PWMCLK[PCLK
x
] control bits.
Changing clock control bits while channels are operating can cause irregularities in the PWM outputs.
26.3.2
PWM Channel Timers
The main part of the PWM module is the actual timers. Each of the timer channels has a counter, a period
register, and a duty register (each are 8-bit). The waveform output period is controlled by a match between
the period register and the value in the counter. The duty is controlled by a match between the duty register
and the counter value and causes the state of the output to change during the period. The starting polarity
of the output is also selectable on a per channel basis.
shows a block diagram for a PWM
timer.
Clock SA
Clock A
2
PWMSCLA
×
-----------------------------------------
=
Clock SB
Clock B
2
PWMSCLB
×
----------------------------------------
=
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...