cancel
Showing results for 
Search instead for 
Did you mean: 

How to get ADC samples of injected more then one per trigger of PWM

EDuat.1
Associate III

Hello I am using STM32G4 and I need to get number of samples per PWM trigger.Normally it can reach in the interrupt for end of the sequence of conversion and get rank values for one time for every trigger but I would like it that for every trigger getting for example 50 sample for 2 rank.

What is the way for it using injected mode.

1 REPLY 1
Igor Cesko
ST Employee

Hi EDuat.1,

If there are requested huge samples per one trigger (50 samples in your case) then I suggest to configure ADC in continuous mode (regular mode) and set rigger to given timer. Continuous sequence will be started by trigger. Best way is then to configure DMA to transfer ADC data to memory. After 50 samples are transferred the "DMA end of transfer" interrupt (code inside interrupt service routine) can stop ADC and reconfigure it to next trigger.

Regards

Igor