HOW TO USE ADC

cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO USE ADC

1,791 Views
letseatorange
Contributor III

I want to use one  AD channel,like ad13 ,contine to collect 100 data, how should i deal with

4 Replies

921 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

There is an example code in Design Studio for ADC you can refer to.

 

Regards,

Daniel

0 Kudos

921 Views
letseatorange
Contributor III

It's only can get one value ,how can i continue to get more valeu ,and then store in an array。

0 Kudos

921 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

You can enable continuous conversion in ADC_SC3[ADCO] register. Then a new conversion will be automatically triggered on completion of the previous one on the same channel (or configuration) until it is aborted (see 38.5.4.3 Aborting conversions). When each conversion is done, ADC interrupt can be triggered, so you can collect data in the interrupt handler.

 

To reduce load of the CPU, the conversion can be initiated with hardware trigger through PDB or TRGMUX. Also, the ADC can trigger a DMA request on conversion completion.

There is an example code Example S32K144 PDB ADC trigger DMA ISR S32DS, which can help.  

 

Regards,

Daniel

921 Views
letseatorange
Contributor III

Hi,support team,now i want to use DMA to transfere some datas from Peripherals ADC0 to memory.but i don't use PDB.

I use a certain sample frequency to sample about 50 datas, then  using DMA to transfere data to memory, I use sdk to complete, but found that data can not be transferred to memory, how should I do? thanks!

0 Kudos