I am trying to enable the HRPWM registers. When I view the PWM waveform, it does not appear that the resolution has been increased. I think my error is with the initialization routine. My system clock is 150 kHz and my power supply operates with a switching frequency of 250kHz.
In my PWM setup up function I have the following lines of code after the basic initialization:
asm(" EALLOW");
*EPWM2_HRCNFG |= (0x01 << EPWM2_EDGEMODE); //control rising edge
*EPWM2_HRCNFG |= (0x00 << EPWM2_CTLMODE); //
*EPWM2_HRCNFG |= (0x00 << EPWM2_HRLOAD);
asm(" EDIS");
In my main function, I used the initialization code from control suite:
while(1)
{
for(duty_fine = 0; duty_fine < 255; duty_fine++)
{
*EPWM1_CMPAHR |= (duty_fine << 8);
*EPWM2_CMPAHR |= (duty_fine << 8);
}
asm(" EALLOW");
*WDKEY_E = PREP;
*WDKEY_E = REFILL;
asm(" EDIS");
}
Could someone give me some assistance on how to setup the HRPWM feature?
Thanks!