Is it possible to know if LPC4370 ADC filled a sample?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Is it possible to know if LPC4370 ADC filled a sample?

1,003件の閲覧回数
JiaAn
Contributor I

Hi,

LPC4370 has HSADC.

In the example code, it just enable it and uses DMA to fill the samples.

Chip_GPDMA_PrepareDescriptor(LPC_GPDMA,&adc_lli[0], 30, (uint32_t)&sample, DMA_TRANSFER_SIZE, GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA, &adc_lli[1]);
Chip_GPDMA_PrepareDescriptor(LPC_GPDMA,&adc_lli[1], 30, (uint32_t)&sample_2, DMA_TRANSFER_SIZE, GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA, &adc_lli[0]);

So is it possible to get a flag or what every time ADC filled a sample?

Like if I use M0 to run ADC. after adc_lli[0] filled sample. Send a flag to M4. And then start adc_lli[1] and fill sample_2.

ラベル(2)
0 件の賞賛
返信
1 返信

992件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, JiaAn,

Regarding your question, as you know that it is impossible to read the ADC result from FIFO and write it to memory if you sample the analog channel with 80MSPS, that is why that you have top use DMA to transfer the ADC result from FIFO to memory. Of course, in low sampling frequency, you can use interrupt mode, and in the ISR, you can read the sample from FIFO, and write it to memory.

For your question, if you set the INTERRUPT bit in the corresponding Descriptor, when the descriptor is executed, the DSCR_DONE bit in HSADC status0 register will be set, and an interrupt can be triggered.

In other words, when the analog channel in the descriptor has sampled, the DSCR_DONE bit is set, an interrupt is triggered, you can read the sample from FIFO in ISR in low speed sampling frequency.

Hope it can help you

BR

XiangJun Rong

xiangjun_rong_1-1626342735277.png

 

 

xiangjun_rong_0-1626342507916.png

 

0 件の賞賛
返信