Hello,
I am using a picollo 28035 for high speed regulation application, and i met some concern with adc timing.
My picollo is cadenced as 60Mhz
I am using two PWM as ADC trigger, one as 200kHz in up down mode, so TBPRD is 150 (I have no prescaler on PWM), and the second as 400kHz in up down mode, so TBPRD is 75. The two PWM are in phase.
I checked PWM timming with a oscilloscope, and it is good (I have unit test too on the configuration)
My 200kHz PWM is generating two interrupt with CMPA, the interrupt A with CMPA up and the second with CMPA down. CMPA is at 100 always. (I use this PWM only as ADC trigger)
My second PWM is generating an interrupt when counter reaches 0, once every two. I am using interrupt force register in way two have this interrupt the first and not the second time, so I have this interrupt, and then 100 tickst later my 200khz first interrupt, and 100 ticks later my third interrupt.
so my three PWM interrupt are on a range of 100 count. Each of this interrupt generate an adc trigger.
I dispose then my ADC conversion in three groups A, B and C.
In group A I have 6 conversion, and 5 in groups B and C.
My first interrupt of each group have a length of 7 tick (there are used as "garbage" conversion, as specified in silicon errata), so ACQPS is 6
The other conversion have a length of 15 tick, so ACQPS is 14.
I checked ACQPS configuration with units tests. (as well as trigger configuration)
so for my group A adc conversion, I expeded that conversion time is 7 + (15 * 5) + 13 = 95 ticks, with 2 ticks as start conversion (as specified as Figure 34 of the Spurg5f), and 2 ticks for last result latch, total time for groupe A is 99).
As well, for my groupe B and C conversion, I need 7 + (15 * 5) + 13 + 4= 71 ticks.
So normally, each conversion group as finished when then soc signal append for next group.
I enable an adc interrupt for one of EOC of group A interrupt, and the swith a led.
My problem is that when i check at the oscilloscope my led signal and my 200khz PWM, there are not synchronised. So i have a problem whith my adc timing configuration
When I change ACQPS for 13 (so 14 ticks of sample), I observe no problem, and my led signal is phasing with my pwm as expected.
When ACQPS is at 14 and I disable one of the PWM interrupt, I observe no problem too.
I checked my configuration, ADCNONOVERLAP is at 0, whit unit test and debug mode, clock divider are at 0 too.
I don't understand where is my timing problem.
Can you confirm to me that my timing calculation is right?
Thank you