imxrt 1052, adc convert with dma

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

imxrt 1052, adc convert with dma

Jump to solution
1,211 Views
ccc_clive
Contributor III

imxrt 1052, is adc module has that convert with dma? sdk 2.13 has no sample with this.

I have 13 ADC channels to convert ,so I want make a convert group with dma ,and period triggered by pit or not.So adc module can auto convert with index grop,without cpu options.Convert result  will be save to user-specified address by dma.

Labels (1)
0 Kudos
Reply
1 Solution
1,163 Views
MultipleMonomials
Contributor IV

To use the ADC with many channels in a sane way, you will probably need to make use of the ADC ETC (External Trigger Control) peripheral.  This peripheral allows you to define ADC "trigger chains" containing lists of up to 8 channels.  When triggered by an XBAR trigger, the ETC will convert the specified channels sequentially and store the results in its own registers.  It can then generate a DMA request which your DMA channel can use to read out and store the register data.  To initially kick off the process, you can use the PIT to trigger the ETC to start converting.

The only issue is that, with more than 8 ADC channels, you will need to use more than 1 ETC trigger chain to do your conversion.  Probably the easiest way is to assign some channels to ADC1 and other channels to ADC2, and then let them convert in parallel.  Or, alternately, you might be able to link multiple ETC trigger chains together sequentially using the XBAR, though I've not done this.

Additionally, since the FSL HAL library doesn't really directly support using DMA with the ADC ETC, you'll have to a bit of DMA programming yourself, e.g. setting the transfer source address to &ADC_ETC->TRIG[0]->TRIGn_RESULT_1_0 to get the data out.

I can confirm that this sort of setup is possible; we have done something fairly similar at my place but I am unable to share code due to company policy.  Soooo... have fun with that part .  Just try not to go insane reading the ADC_ETC documentation, it's some of the hardest to understand that I have ever seen.

View solution in original post

0 Kudos
Reply
4 Replies
1,164 Views
MultipleMonomials
Contributor IV

To use the ADC with many channels in a sane way, you will probably need to make use of the ADC ETC (External Trigger Control) peripheral.  This peripheral allows you to define ADC "trigger chains" containing lists of up to 8 channels.  When triggered by an XBAR trigger, the ETC will convert the specified channels sequentially and store the results in its own registers.  It can then generate a DMA request which your DMA channel can use to read out and store the register data.  To initially kick off the process, you can use the PIT to trigger the ETC to start converting.

The only issue is that, with more than 8 ADC channels, you will need to use more than 1 ETC trigger chain to do your conversion.  Probably the easiest way is to assign some channels to ADC1 and other channels to ADC2, and then let them convert in parallel.  Or, alternately, you might be able to link multiple ETC trigger chains together sequentially using the XBAR, though I've not done this.

Additionally, since the FSL HAL library doesn't really directly support using DMA with the ADC ETC, you'll have to a bit of DMA programming yourself, e.g. setting the transfer source address to &ADC_ETC->TRIG[0]->TRIGn_RESULT_1_0 to get the data out.

I can confirm that this sort of setup is possible; we have done something fairly similar at my place but I am unable to share code due to company policy.  Soooo... have fun with that part .  Just try not to go insane reading the ADC_ETC documentation, it's some of the hardest to understand that I have ever seen.

0 Kudos
Reply
1,144 Views
ccc_clive
Contributor III

First,thanks for your answer.It is similar with my application scenarios.But unfortunately,I have no more gpio pins to use.All available pins have been used.So,I use the last way to resolve ,that is changing channel by mannual(with cpu options),so this make execution efficiency very low.But there is no other way.

0 Kudos
Reply
1,128 Views
MultipleMonomials
Contributor IV

Well, for what I described, you don't need any GPIO pins!  All of the connections can be made internally to the chip using the XBAR switch!

0 Kudos
Reply
1,187 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

Yes, the ADC supports DMA, however we do not have the specific SDK example you are looking for so far.

Sorry for the inconvenience.

Have a nice day!

0 Kudos
Reply