Hi XiangJun,
I was thinking of triggering my ADC sample near the end of the period (this helps with phase erosion) so my ADC interrupt would occur near the end of my period. FORCE_SEL would set to EXT_SYNC from the comparator output, then in my ADC interrupt I would
- set SEL23 to PWM23
- use SMnCTRL2[FORCE] to latch in PWM23
- set SEL23 to OUT23

Would this work? or do I need to mess around with FORCE_SEL?
This leaves the following problems
- I need to generate a 4 phase peak current mode controller
- Each buck will run at out of phase with each other
- Sample the ADC at 4 different points and call a different ADC interrupt.
- I need to generate 4 blanking windows, each one out of phase to each comparator
- I need slope compensation on each DAC output
I have 4 eFlexPWM submodules, so generating 4 PWMs is sorted. To make these out of phase I will have to adjust VAL2/3 to turn on/off at the correct time, eg
- PWM0_VAL2/3 -> 0=on 0+max duty=off
- PWM1_VAL2/3 -> 0+1/4 period = on, 0+1/4 period+max duty = off
- PWM2_VAL2/3 -> 0+2/4 period = on, 0+2/4 period+max duty = off
- PWM3_VAL2/3 -> 0+3/4 period = on, 0+3/4 period+max duty = off
On each ADC interrupt I would set the ADC trigger to be generated in the next 1/4 period and change the ADC inputs to sample my next buck Vout and to reset PWM23 from OUT23 on each submodule.. I'm happy with this.
I don't know how I can generate the 4 out of phase blanking windows ;-(
We only have two Programmable Delay blocks (PDB), so I can't use this to generate my windows. I can't use PWM_B to generate a window since it has no connection to the XBARA.
The only crazy idea I have come up with is to add a small RC filter to output pin PWM_A0 and feed this back in to the chip and use the XBARA to connect this to the comparator window signal. This isn't a great for a digital solution. Do you have any ideas?
I also need slope compensation on the 6 bit DAC. In the app note AN4485 it talks about using the 12 bit DAC which has some special feature to do this, but that's totally missing from the 6 bit DACs ;-(
Your help in this matter is greatly appreciated.
chris