Hello Matt,
- From your code I know you want to measure two ADC channels and save the datas to buffer using DMA.
So recommend you use the DMA Ping-Pong mode, you can refer to the below two threads:
DMA Ping-Pong application
LPC54114 DMA Linked Transfer Ping Pong - Circular Buffers
After I test the code and read UM, it seems only set the DMA transfer size to 2 (equal to channel number), then can used burst mode, it means in your code #define NUM_SAMPLES 1U. Because in RM page 1083:
"The burst size can be set to one in
the DMA channel control register. If the number of ADC channels is not equal to one of the
other DMA-supported burst sizes (applicable DMA burst sizes are 1, 4, 8), set the burst
size to one.
The DMA transfer size determines when a DMA interrupt is generated. The transfer size
can be set to the number of ADC channels being converted. Non-contiguous channels
can be transferred by the DMA using the scatter/gather linked lists.
"
Anyway, I think the better way is use Ping-pong mode.
- BTW,If DMA is used for a sequence, the corresponding sequence interrupt must be disabled in the INTEN register.
Hope it helps,
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------