Freescale Semiconductor Demonstration Board for Freescale MC9S12XHY256 Microcontroller DEMO9S12XHY256 DEMO9S12XHY256 Manual De Usuario

Los códigos de productos
DEMO9S12XHY256
Descargar
Página de 924
Motor Controller (MC10B8CV1)
MC9S12XHY-Family Reference Manual, Rev. 1.04
Freescale Semiconductor
691
20.4.2
PWM Duty Cycle
The PWM duty cycle for the motor controller channel x can be determined by dividing the decimal
representation of bits D[10:0] in MCDCx by the decimal representation of the bits P[10:0] in MCPER and
multiplying the result by 100% as shown in the equation below:
NOTE
x = PWM Channel Number = 0, 1, 2, 3 ... 8. This equation is only valid if
DUTY <= MCPER and MCPER is not equal to 0.
Whenever D[10:0] >= P[10:0], a constant low level (RECIRC = 0) or high level (RECIRC = 1) will be
output.
20.4.3
Motor Controller Counter Clock Source
 shows how the PWM motor controller timer counter clock source is selected.
Figure 20-22. Motor Controller Counter Clock Selection
The peripheral bus clock is the source for the motor controller counter prescaler. The motor controller
counter clock rate, f
TC
, is set by selecting the appropriate prescaler value. The prescaler is selected with
the MCPRE[1:0] bits in motor controller control register 0 (MCCTL0). The motor controller channel
frequency of operation can be calculated using the following formula if DITH = 0:
Effective PWM Channel X % Duty Cycle
DUTY
MCPER
---------------------
100%
=
 1
1/2
1/4
1/8
Motor Controller Timer
Counter Prescaler
Motor Controller
Timer
Counter Clock
Prescaler Select
MPPRE0, MPPRE1
11-Bit Motor Controller
Timer Counter
Peripheral
Bus
Clock f
BUS
Clock
Generator
CLK
Clocks and
Reset
Generator
Module
Motor Controller Timer
Counter Clock f
TC
Motor Channel Frequency (Hz)
f
TC
MCPER M
-------------------------------
=