DMA _flexible scan

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

DMA _flexible scan

1,241 Views
amal_jose
Contributor II

Hi,

 I need to read multiple ADC channels using DMA, I found a document
(Using DMA to emulate flexible scan method )which describes about a flexible scan method using DMA . I feel some difficulties regarding configuration and linking process in the development stage of the code. so I need solve it with the help of a sample code, for :- Using DMA to emulate flexible scan. 

using latest MCU Xpresso for the board  FRDM K64f 

#ADC #DMA #flexible scan method #K64F #MCUXpresso 

jorge_a_vazquez

Thanks,

5 Replies

1,062 Views
amal_jose
Contributor II

 Hinxf58474 ,

    Thanks, It is possible, but I wanted to know that, is it possible to configure both ADC0(PTB2,PTB3) and ADC1(PTB10,PTB11) channels using the same method ? doubts regarding Different trigger source for DMA1 and TCD configuration,

0 Kudos

1,062 Views
nxf58474
NXP Employee
NXP Employee

Hi amal.jose@nestgroup.net,

 

As you might know, the structure of the example proposed is that one DMA channel is in charge of transfer from ADC register to memory buffer, and the other channel is in charge of modify the ADC channel configuration (from memory g_ADC_mux to ADC_SC1 peripheral register). With this structure, you can add more channels, with the FRDM up to 4 channels.

 pastedImage_2.png

 pastedImage_4.png

 

This is the purpose of the original example, to be able to multiplex between different channels of the same ADC.

 pastedImage_6.png

ADC0 Channel 12

PTB2

ADC0 Channel 13

PTB3

ADC0 Channel 14

PTC0

ADC0 Channel 15

PTC1

 

pastedImage_8.png

 

Best Regards,

Ricardo

0 Kudos

1,062 Views
nxf58474
NXP Employee
NXP Employee

Hi amal.jose@nestgroup.net,

 

Hope you are doing well. Please check the original document, the project has been uploaded. Hope this helps.

 

Best Regards,

Ricardo

1,062 Views
amal_jose
Contributor II

Hi nxf58474,

Thanks, how can I configure both ADC0 and ADC1 channels using the same method , Is it possible to configure both ADC's Using Flexible scan method ? how to configure EDMA .

#ADC #DMA #flexible scan method #K64F #MCUXpresso

0 Kudos

1,062 Views
nxf58474
NXP Employee
NXP Employee

Hi amal.jose@nestgroup.net,

 

With the code from the document, you can change the mux of ADC0 Channels. If you make a small change in the code, you can add the Channel 13, and modify the g_ADC_mux array.

 

pastedImage_2.png

 

With this, you have the Channel 12 in PTB2 and the Channel 13 in PTB3, both Channels of ADC0.

 pastedImage_4.png

 

Hope this helps. If you have any question please let me know.

 

Best Regards,

Ricardo