DMA + ADC + PDB with Processor Expert (Kinetis K22 - MK22FN512VLH12)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DMA + ADC + PDB with Processor Expert (Kinetis K22 - MK22FN512VLH12)

5,187 次查看
felipeveraa
Contributor II

Hi, I need to take samples periodically (@11050 Hz, 16-bit, differential between pins ADC0_DP0 and ADC0_DM0), and store it into a double buffer, in order to run DSP algorithms like FFT on one of these buffers while DMA writes into the other.

 

I'm trying to use PDB to trigger ADC0 to take samples and put them in a buffer using eDMA.

I used an application note AN4688 "Sampling Audio with ADC on Kinetis KwikStik", detailing step by step how to implement them using low level blocks: Init_eDMA, Init_ADC and Init_PDB.

I did it exactly as the guide said and I cannot manage the ADC to run nor enter to any of those interrupts. Can you tell me if there is something I am doing wrong, please?

 

I dumped some code and the Processor Expert code in the zip archive attached.

I also attached the AN4688 Application Note.

Original Attachment has been moved to: adc-dma-pdb.zip

标签 (1)
0 项奖励
回复
4 回复数

4,338 次查看
mjbcswitzerland
Specialist V

Hi

For ready-made solution see
http://www.utasker.com/docs/uTasker/uTaskerADC.pdf
http://www.utasker.com/docs/uTasker/uTasker_DSP.pdf

K22 operation in video:
https://www.youtube.com/watch?v=n-GABeILGV8&feature=youtu.be

which includes DMA, ping-pong buffer management and also FFT which can operate directly in circular buffer (avoiding the main complications, source of errors and loss of development time in such configurations).
Video using 50% overlapping buffers with input windowing

Regards

Mark

Kinetis solutions for professionals: http://www.utasker.com/

0 项奖励
回复

4,338 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Felipe,

Can you post your project code here so that we can review and debug?

BR

Xiangjun Rong

0 项奖励
回复

4,338 次查看
felipeveraa
Contributor II

Thanks! But I solved that question by myself, and it was a little big detail I was left.

I left unchecked the PDB trigger for DMA, so it didn't transfer samples periodically.

0 项奖励
回复

4,338 次查看
dhruvonline
Contributor III

Hi Felipe Vera

Could you please upload the Working project(

DMA + ADC + PDB with Processor Expert (Kinetis K22 - MK22FN512VLH12)

) with K22. I have followed the same steps and configured the PE, I am not able to run the program. It is going to DEBUG Halt when I run the program.

Regards,

Dhruv

0 项奖励
回复