MCXA156VLL ADC mulit channel read with DMA

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

MCXA156VLL ADC mulit channel read with DMA

跳至解决方案
385 次查看
yaowei
Contributor I

Hi,

I am using the FRDMMCXA156 board and referring to the SDK (25.09.00) example lpadc_edma.
 
The example only shows how to read one ADC channel using LPTMR and DMA.
 
However, I need to read 7 ADC channels, and the trigger ID only 0 to 3. How can I perform multi-channel ADC read with DMA?
标签 (2)
标记 (2)
0 项奖励
回复
1 解答
348 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @yaowei 

You can use a single trigger source to collect multiple channels.

You can concatenate multiple sampling commands under a trigger source, allowing the ADC to automatically sample 7 channels in sequence after triggering.

The chainedNextCommandNumber field allows the ADC to automatically execute the next command after completing a sample.

BR

Harry

在原帖中查看解决方案

0 项奖励
回复
2 回复数
283 次查看
yaowei
Contributor I

Hi @Harry_Zhang

Thank you very much for your reply. I was able to achieve my goal using chainedNextCommandNumber, but I still have a few questions.

I'm using LPTIMER to trigger both ADC0 and ADC1, and I'm transferring the ADC data using DMA0 Channel 0 and Channel 1. The reason I use two DMA channels is because lpadcDmaChnlConfig.channelRequestSource can only be set to either kDma0RequestMuxAdc1FifoRequest or kDma0RequestMuxAdc0FifoRequest.

In this case, is it possible to use only one DMA channel to handle both ADCs?



Thanks

0 项奖励
回复
349 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @yaowei 

You can use a single trigger source to collect multiple channels.

You can concatenate multiple sampling commands under a trigger source, allowing the ADC to automatically sample 7 channels in sequence after triggering.

The chainedNextCommandNumber field allows the ADC to automatically execute the next command after completing a sample.

BR

Harry

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2199636%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMCXA156VLL%20ADC%20%E5%A4%9A%E9%80%9A%E9%81%93%E8%AF%BB%E5%8F%96%EF%BC%88%E5%B8%A6%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20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%3E%3CSPAN%3E%20ADC%3C%2FSPAN%3E%3CSPAN%3E%20%E8%AF%BB%E5%8F%96%20%EF%BC%9F%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2199636%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E6%A8%A1%E6%8B%9F%EF%BC%88ADC%7CCMP%7CDAC%7COPAMPS%EF%BC%89%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMCXA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201611%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MCXA156VLL%20ADC%20mulit%20channel%20read%20with%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201611%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F229957%22%20target%3D%22_blank%22%3E%40Harry_Zhang%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E4%BD%A0%E7%9A%84%E7%AD%94%E5%A4%8D%E3%80%82%E6%88%91%E4%BD%BF%E7%94%A8%3CSTRONG%3EchainedNextCommandNumber%3C%2FSTRONG%3E%20%E5%AE%9E%E7%8E%B0%E4%BA%86%E7%9B%AE%E6%A0%87%EF%BC%8C%E4%BD%86%E4%BB%8D%E6%9C%89%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20LPTIMER%20%E6%9D%A5%E8%A7%A6%E5%8F%91%20ADC0%20%E5%92%8C%20ADC1%EF%BC%8C%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20DMA0%20%E9%80%9A%E9%81%93%200%20%E5%92%8C%E9%80%9A%E9%81%93%201%20%E4%BC%A0%E8%BE%93%20ADC%20%E6%95%B0%E6%8D%AE%E3%80%82%E6%88%91%E4%B9%8B%E6%89%80%E4%BB%A5%E4%BD%BF%E7%94%A8%E4%B8%A4%E4%B8%AA%20DMA%20%E9%80%9A%E9%81%93%EF%BC%8C%E6%98%AF%E5%9B%A0%E4%B8%BA%3CSTRONG%3ElpadcDmaChnlConfig%3C%2FSTRONG%3E%3CSTRONG%3E.channelRequestSource%3C%2FSTRONG%3E%E5%8F%AA%E8%83%BD%E8%AE%BE%E7%BD%AE%E4%B8%BA%3CSTRONG%3EkDma0RequestMuxAdc1FifoRequest%3C%2FSTRONG%3E%E6%88%96%3CSTRONG%3EkDma0RequestMuxAdc0FifoRequest%3C%2FSTRONG%3E%E3%80%82%3C%2FP%3E%3CP%3E%E5%9C%A8%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8C%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E5%8F%AA%E4%BD%BF%E7%94%A8%E4%B8%80%E4%B8%AA%20DMA%20%E9%80%9A%E9%81%93%E6%9D%A5%E5%A4%84%E7%90%86%E4%B8%A4%E4%B8%AA%20ADC%EF%BC%9F%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E8%B0%A2%E8%B0%A2%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2199983%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MCXA156VLL%20ADC%20mulit%20channel%20read%20with%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2199983%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F256581%22%20target%3D%22_blank%22%3E%40yaowei%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E5%8D%95%E4%B8%AA%E8%A7%A6%E5%8F%91%E4%BF%A1%E5%8F%B7%E6%BA%90%E6%9D%A5%E6%94%B6%E9%9B%86%E5%A4%9A%E4%B8%AA%E9%A2%91%E9%81%93%E3%80%82%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E5%8F%AF%E4%BB%A5%E5%9C%A8%E8%A7%A6%E5%8F%91%E4%BF%A1%E5%8F%B7%E6%BA%90%E4%B8%8B%E8%BF%9E%E6%8E%A5%E5%A4%9A%E4%B8%AA%E9%87%87%E6%A0%B7%E5%91%BD%E4%BB%A4%EF%BC%8C%E4%BB%8E%E8%80%8C%E5%85%81%E8%AE%B8%20ADC%20%E5%9C%A8%E8%A7%A6%E5%8F%91%E5%90%8E%E8%87%AA%E5%8A%A8%E6%8C%89%E9%A1%BA%E5%BA%8F%E5%AF%B9%207%20%E4%B8%AA%E9%80%9A%E9%81%93%E8%BF%9B%E8%A1%8C%E9%87%87%E6%A0%B7%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EchainedNextCommandNumber%20%E5%AD%97%E6%AE%B5%3C%2FSTRONG%3E%E5%85%81%E8%AE%B8%20ADC%20%E5%9C%A8%E5%AE%8C%E6%88%90%E9%87%87%E6%A0%B7%E5%90%8E%E8%87%AA%E5%8A%A8%E6%89%A7%E8%A1%8C%E4%B8%8B%E4%B8%80%E6%9D%A1%E5%91%BD%E4%BB%A4%E3%80%82%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3E%E5%93%88%E5%88%A9%3C%2FP%3E%3C%2FLINGO-BODY%3E