Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
i want to update compare register value. in this example they have updated compare register value for all 3 ePWM module in just one function . but i want to update my new value to compare register value in this example. a modified code by me u can see. what should write to update all 3 ePWM module compare value as they have written? in yellow color i have modified code. i have called this function for all three ePWM module.
void update_compare(EPWM_INFO *epwm_info, Uint16 REF_H, Uint16 TIMER_PRD)
{
Uint16 CMPA1;
Uint16 CMPB1;
CMPA1 = REF_H+TIMER_PRD/2;
CMPB1 = -CMPA1;
EPwm_Regs.CMPA.half.CMPA = CMPA1; //at this point what should i write instead of EPwm_Regs??
EPwm_Regs.CMPB=CMPA1;
/*
if(epwm_info->EPwmTimerIntCount == 10)
{
epwm_info->EPwmTimerIntCount = 0;
if(epwm_info->EPwm_CMPA_Direction == EPWM_CMP_UP)
{
if(epwm_info->EPwmRegHandle->CMPA.half.CMPA <
epwm_info->EPwmMaxCMPA)
{
epwm_info->EPwmRegHandle->CMPA.half.CMPA++;
i tried with just writing EPwmRegHandle.CMPA.half.CMPA=CMP1 & EPwmRegs.CMPA.half.CMPA=CMPA1 & epwm_info->EPwmRegHandle->CMPA.half.CMPA=CMPA1;but it is not working.