Other Parts Discussed in Thread: CONTROLSUITE
Tool/software: Code Composer Studio
Hi,everybody, I have several questions about SDFM and ePWM.
1. We use ePWM1-3 as the motor PWM output and use ePWM12 to sync reset SDFM module, but we want SDFM module to grab data at each time ePWM1-3 start trigger. How can I sync ePWM1 and ePWM12?
2. In the TI demo (D:\ti\controlSUITE\development_kits\TMDSIDDK_v2.0\IDDK_PM_Servo_F2837x_v2_00_00_00), I find follow settings:
"EPwm11Regs.CMPC = EPwm11Regs.TBPRD - SDFM_TICKS*(OSR_RATE+1)*3/2;
EPwm11Regs.CMPA.bit.CMPA = (SDFM_TICKS*(OSR_RATE+1)*3/2) + 500; // 500 is arbitrary
EPwm11Regs.CMPD = 0;"
As we want to grab SDFM data when ePWM1-3 start trigger, but SDFM module need a latency(our latency is 38.9us), I set ePWM11: CMPC/D = CMPA = 0; and in the 100us-MotorControlISR module, I add a "while", waiting(about 38.9us) for SDFM.SDIFLG.AF1-3 to be all 1, then clear the flag. But I failed, only to find the program stop running after a few second. Why?
3. I don't quite understand the setting of CMPC and CMPA values, according to spec of 28379: Latency of Sinc filter = Order of Sinc filter * OSR /Modulator data rate, then fomula in CMPC and CMPA should be (3*(OSR_RATE+1)/SDFM_TICKS/2)*100, but why TI demo set values as above?
Thanks forward.