Microchip Technology MA330028 Fiche De Données
2011-2014 Microchip Technology Inc.
DS80000533H-page 19
dsPIC33EPXXXGP50X, dsPIC33EPXXXMC20X/50X and PIC24EPXXXGP/MC20X
35. Module: PWM
In Center-Aligned Complementary mode with
Independent Time Base, if the value in the PDCx
register is less than one-half the value in the
ALTDTRx register, the PWM generator will force
the PWMxL to low, and on the PWMxH, generate
pulses of width less than twice the dead time, as
shown in
Independent Time Base, if the value in the PDCx
register is less than one-half the value in the
ALTDTRx register, the PWM generator will force
the PWMxL to low, and on the PWMxH, generate
pulses of width less than twice the dead time, as
shown in
.
FIGURE 4:
PWM GENERATOR TIMING DIAGRAM
Work around
Include a software routine to ensure that the duty
cycle value written to the PDCx register is always at
least one-half of the value in ALTDTRx.
cycle value written to the PDCx register is always at
least one-half of the value in ALTDTRx.
shows one method, with PDCtemp representing the
variable which has the value to be written to the
PDCx register. Alternatively, for duty cycle values
less than half the desired dead time value, zero out
the ALTDTRx register or dynamically reduce the
value in the ALTDTRx register, such that ALTDTRx is
always equal to 2 * PDCx, as shown in
variable which has the value to be written to the
PDCx register. Alternatively, for duty cycle values
less than half the desired dead time value, zero out
the ALTDTRx register or dynamically reduce the
value in the ALTDTRx register, such that ALTDTRx is
always equal to 2 * PDCx, as shown in
EXAMPLE 3:
WORK AROUND CODE
Period
PTMRx
PWMxH
PWMxL
PWMxH
PWMxL
2 x Period
PDCx = ALTDTRx /2
PDCx < ALTDTRx /2
0
PHASEx
Altdtr_by2 = ALTDTRx / 2;
if (PDCtemp < Altdtr_by2)
{
PDCx = Altdtr_by2;
}
else
{
PDCx = PDCtemp;
}