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.

How to increase the ADC sampling frequency within a ePWM period

Other Parts Discussed in Thread: CONTROLSUITE, POWERSUITE

Dear Sir/Madam,


I want to increase my ADC's frequency such that I can sample more points in one ePWM switching cycle and then do the averaging to make the measurement more accurate. In this way, I expect to measure a triangle waveform and then count the average value of it. However, it seems like if I only change the parameter of "EPwm2Regs.CMPA.half.CMPA" to make it 1/2 or 1/4 the value of the parameter "EPwm2Regs.TBPRD" (I use ePWM2 as the ADC triggering), I am not able the achieve what I expected above. It seems like the ePWM's frequency all follow the change of  EPwm2Regs.CMPA.half.CMPA and thus the ADC can still only sample one point within a period.

Can you please help me on this? The code I am working on is based on "Example_2833xEPwmDeadBand" from the controSUITE.

Thanks.

  • Hi Lin,

    Do you want to get the ePWM trigger and then sample multiple points all back-to-back, average them, and then wait for the next trigger?

    Or, do you want to trigger evenly spaced samples throughout the ePWM periode?

    For the first scenario, you will want to setup multiple slots in the ADC sequencer all pointing to the same channel. You can then read multiple result registers and average them together in the ADC ISR.

    For the second scenario you will need to use a second ePWM synchronized with the main ePWM, but running some multiple faster.
  • Hi, Devin, my case is the second one. Can you please provide an example code or point it out for me which code in the ControlSuit should I refer to? In my mind, I just need to make the "EPwm2Regs.TBPRD" value 1/10 of other ePWM signals so as to make the ADC sampling speed 10 times higher (here I use ePWM2 as the trigger to start the ADC). Is this correct? Thanks.

  • Hi Lin,

    Yeah, you can setup an ePWM with 10x higher sampling rate. The challenge then is how to efficiently process the data. If you are using a device with a DMA (e.g. F2806x) then you may want to use the DMA to collect these samples and then trigger an ISR after 10 samples are collected. If you are using a device with "burst mode" (e.g. F2807x) then you can use that sampling mode to only trigger an ISR after 10 samples are collected.

    There is an example of using multiple ePWM modules with the same period but different trigger points to do oversampling in ControlSUITE in \controlSUITE\development_kits\ILPFC_v1.2\IL_PFC_F28035_powerSUITE. I don't think we have an example of using a fast ePWM module to do oversampling.