Hello,
I'm trying to initialize the ePWM7 on a 28035 to output a high signal on EPWM7A. To do so I'm trying to use the Action Qualifier register "AQCSFRC" to assert the output high continuously. See the code snippet below for what I'm doing.
EALLOW; SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0; SysCtrlRegs.PCLKCR1.bit.EPWM7ENCLK = 1; EDIS; //Time Base Period Register EPwm7Regs.TBPRD = 1; // Period = 1201 TBCLK counts //Time Base Control Register //Time Base Phase Register EPwm7Regs.TBPHS.half.TBPHS = 0; // Set Phase register to zero //Counter Compare Registers //Action Qualifier Registers //Clear the whole register to disable action based on the compare register EPwm7Regs.AQCTLA.bit.CBD = 0; EPwm7Regs.AQCTLA.bit.CBU = 0; EPwm7Regs.AQCTLA.bit.CAD = 0; EPwm7Regs.AQCTLA.bit.CBU = 0; EPwm7Regs.AQCTLA.bit.PRD = 0; EPwm7Regs.AQCTLA.bit.ZRO = 0; //Action Qualifier Software Force Register EPwm7Regs.AQSFRC.bit.RLDCSF = 0x03;//Load immediately EPwm7Regs.AQSFRC.bit.ACTSFA = 0x03;//On one-time software forced event, toggle the output //Not using the deadband submodule //PWM-Chopper Control Register EPwm7Regs.PCCTL.bit.CHPEN = 0; //Disable chopping module //Trip zone submodule registers EPwm7Regs.TZCTL.bit.DCBEVT2 = 0x03; //Disable trip action EPwm7Regs.TZCTL.bit.DCBEVT1 = 0x03; EPwm7Regs.TZCTL.bit.DCAEVT2 = 0x03; EPwm7Regs.TZCTL.bit.DCAEVT1 = 0x03; EPwm7Regs.TZCTL.bit.TZB = 0x03; EPwm7Regs.TZCTL.bit.TZA = 0x03; Gpio_SetMux(40, 1); /* Set GPIO40 to EPWM7A */ EPwm7Regs.AQCSFRC.bit.CSFA = 0x02; //Force a continuous high on output A EPwm7Regs.AQCSFRC.bit.CSFB = 0x02; //Force a continuous high on output B
Up to this point I've tried following the application note examples, (I.E. Controlling Multiple Buck Converters With Independent Frequencies from spruge9e) with no success.
I was able to toggle the output high when I had it configured as a GPIO, but for my application I need to use the PWM peripheral.
Clearly I've missed something, can someone correct me?
Thanks.