LPC43xx ADC using 16 channels

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

LPC43xx ADC using 16 channels

1,494 Views
jonathansmith
Contributor III

I am using an LPC4333 and am implementing voltage and current monitoring using the built in ADCs. There are 16 different signals to monitor so the inputs pins are multiplexed using 2-way logic to enable me to switch between the two banks of 8 signals.

I would like to call just one function periodically which starts the sampling and fills a structure with the results. A call from a central processor to retrieve the data will then be given the most up to date results.

There is no specific requirment to sample the signals quickly, a few times a second is fine, but the processor has plenty of other thing to do so I want to use interrupt or dma to retrieve the sampled data. However, I am not sure how to implement it. The examples I have found online seem to be for one channel only. Would you recommend I use interrupts or DMA? Any suggestions?

Many thanks, Jonathan

Labels (1)
0 Kudos
Reply
3 Replies

1,195 Views
jonathansmith
Contributor III

I have successfully got the ADC sampling 8 channels, triggered by the SCTimer. I am now working on the DMA code. I have based my code on the periph_adc example in lpcopen, but I am struggling a bit.

Can anyone help me figure out when I should be doing the DMA transfers? It looks like I can only use DMA to read the GDR register, rather than use DMA to get the data from the DR0 to DR7 registers in one go. Is that correct? If that is the case, I am thinking that I have to trigger a DMA transfer after each ADC sample, incrementing the destination address each time. If so, how should I setup the ADC interrupts, and how should I increment the DMA desination address?

Many thanks, Jonathan

0 Kudos
Reply

1,195 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jonathan Smith,
Thanks for your reply.
1) It looks like I can only use DMA to read the GDR register, rather than use DMA to get the data from the DR0 to DR7 registers in one go. Is that correct?
    No, DMA can acquire the value of DR0~DR7 regster, however, Obtaing the GDR register is the best solution.
2) To ustizing the GPDMA, you can refer to misc_gpdma_speed demo in the LPCOpen library whose link is below.
https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-corte...

Have a great day,
TIC

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

0 Kudos
Reply

1,195 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jonathan Smith,

Thank you for your interest in NXP Semiconductor products and
the opportunity to serve you.
To implementing it, you can use a hard trigger which starts a consecutive ADC converting periodically such as SCTimer, etc. and after converting completes, DMA would retrieve the sampled data.
Hope it helps.

Have a great day,
TIC

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

0 Kudos
Reply