I can't get the EPWM to generate any output. I can't even get TBCTR to count at all. I used HalCoGen to generate initialization code with the ETPWM1A and ETPWM1B pins enabled in the PINMUX driver. I have tried many different things, but nothing works. Here is my current initialization code:
pinMuxReg->PINMMR37 |= 0x100; // Enable clocks EPWM1
pinMuxReg->PINMMR37 &= ~2; // Disable time base
etpwmREG1->TBPRD = 4000;
etpwmREG1->CMPA = 2000;
etpwmREG1->CMPB = 1000;
etpwmREG1->TBCTL = 0x30;
etpwmREG1->CMPCTL = 0x00; // Immediate load of CMPA
etpwmREG1->AQCTLA = 0x24; // Set on CMPA, clear on PRD
etpwmREG1->AQCTLB = 0x24; // Set on CMPA, clear on PRD
etpwmREG1->TZCTL = 0xFFF; // Disable all trip zones
etpwmREG1->TZCLR = 0x3F; // Clear all trip zones
etpwmREG1->DBRED = 0;
etpwmREG1->DBFED = 0;
etpwmREG1->PCCTL = 0;
pinMuxReg->PINMMR37 |= 2; // Enable time base
Any ideas on why TBCTR isn't counting? I see a lot of references to VCLK4 but don't see any programming information or any settings in HalCoGen.
I have also tried to force the output pins high with the following lines:
etpwmREG1->AQSFRC = 0x6;
etpwmREG1->AQCSFRC = 0x2;
I never see anything at the output. Any ideas on what I'm doing wrong would be helpful.
Thank you,
Jeremy