K64F Triggering ADC on DMA major loop completion?

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

K64F Triggering ADC on DMA major loop completion?

677 Views
davenadler
Senior Contributor I

We're evaluating the K64F for an instrumentation application. We'd like to do the following:

  1. Generate an excitation waveform using DMA-to-DAC. I got this working here:
    https://community.nxp.com/message/840245
  2. At the completion of each waveform cycle (completion of DMA major loop), generate a conversion trigger
  3. Initiate an ADC conversion on the trigger
  4. on ADC completion, copy the result via DMA to a buffer (ping-ponged)
  5. When the ADC-DMA fills the buffer (completion of the DMA major loop), ping-pong to the alternate buffer and generate an interrupt signalling a load of data is ready to process
  6. In the ADC-DMA-major-loop-completion ISR, we'll do our processing

Steps 1-5 should proceed without code intervention.

The next question is how to configure K64F to perform steps 2-3:

How do I trigger ADC conversion at the end of each DAC-DMA-major-loop completion?

Thanks in advance,
Best Regards, Dave

0 Kudos
2 Replies

394 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Customer could using ADC software trigger mode.

In Software Trigger mode, when SC2[ADTRG]=0, writes to SC1A subsequently initiate a new conversion, if SC1[ADCH] contains a value other than all 1s.

After DMA to DAC major loop finished, customer could set a major loop link to another DMA channel to transfer already  ADC channel value(variable in RAM) to  ADC Status and Control Registers 1 (ADCx_SC1n) as software trigger ADC conversion. For only the SC1A is used for both software and hardware trigger modes of operation. Customer could using DMA link channel to transfer data to ADCx_SC1A register as software trigger.

Customer could refer application note AN4590, which using a hardware trigger. Customer can use ADC software trigger to instead of the hardware trigger.

AN4590 software could be downloaded from here.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

394 Views
davenadler
Senior Contributor I

Sorry, I think I understand your answer; I will try:

  1. DMA link on completion of DAC-DMA major loop to trigger for example DMA channel 2,
  2. DMA channel 2: transfer a constant value into ADC peripheral to initiate an ADC conversion

Thanks,
Best Regards, Dave

0 Kudos