Part Number: TMS320F28388D
Greetings E2E Community!
I am requesting advice about how to configure EPWMs for moderately complex sampling and processing schedule. I am using F28388D.
Multiple PWM outputs are being generated and multiple A/D channels are being sampled per EPWM.
The goal is to have four PWMS running in a 25 uS cycle, with a defined phase offset among them. Each cycle generates two SOCs to drive ADC sampling, and each ADC sample triggers a CLA task. One SOC is generated every cycle and triggers the "Fast Task", and another SOC is generated every fourth cycle and triggers the "Slow Task".
This all works fine by using TBPHS to offset the PWM phases (I use the C200ware calls, such as EPWM_setPhaseShift()), and EPWM_setADCTriggerEventPrescale() to cause the Slow SOC to be generated every fourth cycle.
However the computations that run on every fourth cycle (the "Slow Tasks") need to be scheduled such that they occupy a particular one of the cycles, so that the "Slow Tasks" don't try to execute simultaneously. So the "Slow Task SOC1" should be generated on the first of four cycles of EPWM1, the "Slow Task SOC2" on the second of four cycles of EPWM2, and so forth.
I tried to use EPWM_setADCTriggerEventCountInitValue() to stagger the slow tasks, but when I do that, the slow task is no longer launched at all, so it seems like trying to initialize the event count causes SOC to never be generated. I don't see any example code that uses this feature. Can I get guidance about how to properly use EPWM_setADCTriggerEventCountInitValue()?
Are there other feature of EPWM or ADC that I can exploit to implement the schedule I described?