This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
A few questions:
1 - In SFO_V6.h, should I have
#define PWM_CH 9
since the F28069 has 8x HRPWM capable PWMs (8+1)?
Also, I have
int MEP_ScaleFactor = 0; volatile struct EPWM_REGS *ePWM[] = {0, &EPwm1Regs,&EPwm2Regs,&EPwm3Regs,&EPwm4Regs,&EPwm5Regs,&EPwm6Regs,&EPwm7Regs,&EPwm8Regs};
in my main.c file outside of my main function.
2 - Why is there a 0 as a first element in *ePWM[0]?
3 - Should MEP_ScaleFactor be an array with 9 elements of 0? I tried this but only MEP_ScaleFactor[0] was being set, and all other elements remained as 0.
4 - Also, the SFO() as outlined in SPRUH18 has no arguments, however I've seen other examples where they pass which ePWM module they want to calibrate. Does SFO() in this case calculate the MEPs for all ePWMs in *ePWM[]?
5 - Also, I have seen SFO_v7 around in example code for other processors (Concerto). Is it ok to use v7 with F2806x even though in the latest controlSuite, the version for F2806x is v6?
Why are my writes to CMPAHR being ignored?
temp = ((Uint32)(myDuty*PWM_HALF_PERIOD) << 16) + (Uint32)(_IQfrac(myDuty*PWM_HALF_PERIOD) * 256); EPwm2Regs.CMPA.all = temp;
temp is 0x02020085, but when I write to CMPA.all, I only get 0x02020000
Hi Fulano de Tal,
I know a few of these offhand:
1) It depends on how the software is using this variable. However, based on my memory of how we did things in several EVM kits, what you describe is correct.
2) Not using the first element of ePWM[] was a design decision so that channel 1 would correspond to ePWM[1]. If your system is memory-limited you could change things around if desired.
3-5) What system example are you experimenting with?
6) Why are CMPA writes to CMPAHR being ignored.
-They aren't (in this case anyway). Note that CMPA.all is a 32-bit write. The upper 16-bits are the CMPA (non-HiRes) part and the upper 8-bits of the remaining 16 are the CMPAHR part. Therefore temp=0x02020085 should be CMPA=0x0202 and CMPAHR=0x00. temp=0x02028500 should lead to CMPA=0x0202 and CMPAHR=0x85
Thank you,
Brett