Hello,
I am trying to set a PWM duty cycle with an ADC value on a C2000 Launchpad.
I am watching all of the registers and the ADC is reading properly however I am unable to write to the CMPA and CMPB registers to change the duty cycle. I can set the value initially at the start of the program but it becomes unchangeable after that point.
EPwm1Regs.CMPB = PWM;
//Tried directly writing to the register void update_compare(EPWM_INFO *epwm_info, unsigned int *PWM_PTR) { PWM_setCmpA(epwm_info->myPwmHandle, *PWM_PTR);
//And using the example from the PWM tutorials
PWM_setCmpB(epwm_info->myPwmHandle, *PWM_PTR); return; }