MK60: 1. How to detect an ADC result overrun? 2. How to use DMA for ADC results?

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

MK60: 1. How to detect an ADC result overrun? 2. How to use DMA for ADC results?

650 Views
hape_mk
Contributor I

Hi,

I want to get certainly all results of an ADC on MK60 which is working in Continuous Conversion mode (SC3 ADCO=1).

I have two questions relating to this:

1. Is there a register flag (or a other possibility) to detect when a new ADC result overwrites an old result before it was read?

2. Which DMA registers have to be set (with which values) to use a DMA for transferring the ADC2 results to a memory address and get a DMA interrupt after 200 ADC samples?

I have checked some application notes already but the DMA usage seemed always very complex.

So I would be glad if you could specify the DMA register contents which are essential to be set.

Thanks a lot for your help.

Best regards

Hape

Labels (1)
0 Kudos
2 Replies

526 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Although there is no ADC_EDMA example in MK60 SDK, you can find such example in other Kinetis K series device's SDK, like K64 or K22. They share same ADC and EDMA module.

Regards,

Jing 

0 Kudos

526 Views
mjbcswitzerland
Specialist V

Hi Hape

The ADC itself has no overflow flag however it is possible to detect an overflow if using the PDB as trigger since the PDB's channel status reguster will flag en error if it can't complete a seuqence becaus ethe last sample has not yet been read (see PDBx_CHns).

For ADC DMA see this document for some ideas: http://www.utasker.com/docs/uTasker/uTaskerADC.pdf

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K60:
- http://www.utasker.com/kinetis/TWR-K60N512.html
- http://www.utasker.com/kinetis/TWR-K60D100M.html
- http://www.utasker.com/kinetis/TWR-K60F120M.html
- http://www.utasker.com/kinetis/ELZET80_NET-KBED.html
- http://www.utasker.com/kinetis/ELZET80_NET-K60.html
For less questions and faster, cheaper developments: try uTasker for Kinetis

0 Kudos