Other Parts Discussed in Thread: MOTORWARE
I am trying out some simple programs on the Instaspin card so that I have a better understanding of the programming involved.
I tried to set the parameters for the ePWM module. I started with the existing example projects and changed the code to mine. When I run this program the changes in the ePWM registers only occur during the PWM enable command. When the commands that I have written in the program are executed, the registers remain unchanged.
This is what I'm trying to do,
PWM_setPeriod(pwmHandle,period);
PWM_setCounterMode(pwmHandle,PWM_CounterMode_Up);
PWM_setRunMode(pwmHandle,PWM_RunMode_FreeRun);
PWM_setSyncMode(pwmHandle,PWM_SyncMode_Disable);
PWM_setClkDiv(pwmHandle,PWM_ClkDiv_by_128);
PWM_setLoadMode_CmpA(pwmHandle,PWM_LoadMode_Zero);
PWM_setActionQual_Zero_PwmA(pwmHandle,PWM_ActionQual_Set);
PWM_setActionQual_CntUp_CmpA_PwmA(pwmHandle,PWM_ActionQual_Clear);
PWM_setLoadMode_CmpB(pwmHandle,PWM_LoadMode_Zero);
PWM_setActionQual_Zero_PwmB(pwmHandle,PWM_ActionQual_Clear);
PWM_setActionQual_CntUp_CmpB_PwmB(pwmHandle,PWM_ActionQual_Set);
PWM_Obj *pwm1 = (PWM_Obj *)pwmHandle;
pwm1->CMPA=300;
pwm1->CMPB=300;
Can someone tell me where I am going wrong?