S32K multiple ADC trigger DMA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K multiple ADC trigger DMA

2,741 Views
zhengjianfei1
Contributor III

Hi , DOC 'S32K-RM'  says ' the DMA can be triggered after multiple ADC conversion completion instead of every ADC conversion completion.' . But how can i trigger DMA after multiple ADC conversion completion? Using the Adc0Sc1aCoco To trigger DMA channel?

   I need to get 4 channels ADC value 25 times,and transfer those 100 values to a buffer using DMA,  Thanks!

   

pastedImage_1.png

2 Replies

2,236 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, the Adc0Sc1aCoco can be used for this. Also you can trigger DMA using PDBx CH0 TRIG. The setting for those 2 ways could be following.

Adc0Sc1aCoco:

PDB is used to trigger 4 ADC channels (ideally first four) and can be started periodically. Pretrigger 0, controlled by PDB channel delay registers (triggers Sc1a), must be triggered as last one in the bunch of 4 conversions, so Adc0Sc1aCoco can be used to trigger DMA and read first 4 ADC result registers. The CITER/BITER will be set for 25 and DMA can be disabled after major iteration finished.

PDBx CH0 TRIG:

PDB will be set to perform back-2-back conversions of 4 ADC channels, or individual trigger delays can be set as above. The PDBx_IDLY can be used to trigger the DMA which will be set similarly as in first way. Again you have to arrange the timing correctly for the backtoback ADC triggering and DMA triggering so that the DMA is triggered after 4 ADC channel conversions have been finished.

Unfortunately we do not have examples for this. You can find some demos here, but it uses DMA transfer after each single conversion. But at least you can refer to it.

nonSDK: Example S32K144 PDB ADC trigger DMA ISR S32DS 

SDK: https://community.nxp.com/docs/DOC-343295 

BR, Petr

2,236 Views
zhengjianfei1
Contributor III

Hi Petr,

    I do appreciate your timely help. :smileyhappy:

0 Kudos