HSADC data acquisition

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

HSADC data acquisition

334 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jcunha on Tue Dec 29 11:47:24 MST 2015
Hello everyone.
I'm new to LPC microcontrollers.

I need to develop an application for LPC4370. I'm using LPCXpresso v8.0.
For now I'm using a LPC link 2 to test my code.

I already start using it, mainly using the examples from LPCOpen, but I need some help in order to do a project.
I will describe what I need and if someone could steer me in the right direction, I would appreciate.
I need to generate 1 square wave, acquire 2 sine waves and send acquired data to a PC.
The square wave (200 kHz, 50% duty cycle) should be generated for 10 ms, and after 100 ms, generated again for 10 ms, and so on. This wave is generated periodically as long as a button is ON. Button OFF, no square wave.
I also need to start acquiring samples from 2 ADC for 10 ms, when the square wave starts being generated.
I need 20 MS/s sampling frequency (one sample each 50 ns), which gives 200000 samples for each adc.

After acquisition, data needs to be sent through USB to a PC for post processing.
Can anyone help me?
Thanks
Labels (1)
0 Kudos
1 Reply

277 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by metraTec on Mon Feb 29 06:59:41 MST 2016
Hello,
I just started with the same chip some time ago with about the same peripherals.

For the Square wave generation I would use the SGPIO. It is a bit hard to set, but from then on works easy. 200kHz should be generated easily. I'm doing a quiet similar thing and it works fine.

For the ADC:
You can activate the ADCHS manually. Just add an interrupt to your button and you should be fine. You may also use the IRQ of the SGPIO.

The activation of the ADCHS is not that complicated. Use your two channels and just pull them. You have 20 MS in total or per channel?

Just write the data to the RAM to excange to the M0 App and in a Pause (or any time, but you seem to have enough time anyway) send the data via USB.
0 Kudos