Looking for some Help with K70/MQX/ADC/DAC/DMA/PDB

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

Looking for some Help with K70/MQX/ADC/DAC/DMA/PDB

1,068 Views
markrobinson
Contributor I

Hi

I am looking for some help with a project, I am new to MQX/CW and working on my first design. I am now struggling and behind schedule and looking for some help.....

I have a system level design and currently have several demo software for ADC and DAC for the Tower/K70. I have the DAC demo task triggered from the PDB(2.5us) and the ADC demo task capturing the signal. However I need to add a DMA to the DAC to control the output signal from an array and a DMA from the ADC into 2 buffer arrays. I am struggling with controlling the ADC to capture the DAC signal at the right phase (ADC taking 2x5 samples for each DAC signal step) and set up both the DMA and associated buffer flow control and interrupts. The module need to run independent of scheduled tasks, just write to the DAC signal buffer and read the two ADC buffers.


Does anyone have a good working example code for DMA/ADC and DMA/DAC with PDB triggering (ADC delay triggered).


Any help with this would be greatly appreciated.


best regards


Mark

Tags (1)
0 Kudos
Reply
2 Replies

502 Views
markrobinson
Contributor I

Ok!,

I have looked at some of the ADC demo code and have the following questions;

  1. what does "(pointer)" do in the following line of code? CW10.6/MQX4.1 throws an error.
  2. when I remove the pointer reference the code appears to work, but I get a warning I don't understand and can't find a solution anywhere, what is the warning for?
  3. How do I change settings on the ADC/initialisation record for the ADC_CLOCK_DIV, SPEED, Long and Short conversions etc?
  4. Assign PDB0 or PDB1, Hardware Average, DIFF, PGA?
  5. Can the Same PBD drive both DAC and ADC triggers? 

  1. ioctl(f, ADC_IOCTL_FIRE_TRIGGER, (pointer) MY_TRIGGER);
  2. ioctl(f, ADC_IOCTL_FIRE_TRIGGER, ADC_PDB_TRIGGER);
DescriptionResourcePathLocationType
passing argument 3 of '_io_ioctl' makes pointer from integer without a cast [enabled by default]adc_task_2.c/TDLsensors K70 1v0/Sourcesline 280C/C++ Problem
0 Kudos
Reply

502 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the below thread.

Operating more than 1 channel per ADC

In addition, maybe you can find the AN4590 application note useful.

AN4590: http://cache.freescale.com/files/32bit/doc/app_note/AN4590.pdf

The IAR project mentioned in the application note (AN4590) can be found here:

http://freescale.com/files/32bit/doc/app_note/AN4590SW.zip

(the .zip contains a .exe that will extract the IAR project mentioned in the AN4590.pdf to a desired location in your computer)


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------