PIC32 ADC with DMA problem
I'm trying to load ADC samples to a buffer using DMA. So I set Timer 3 to trigger ADC convertions and once the convertion is complete it will trigger a DMA transfer. My objective is to load a buffer with all the ADC samples and once the buffer is complete I have to send it. My buffer is defined as "uint16_t buffer".
So I set the DMA as follows:
void *srcAddr = (void *) &ADC1BUF0;
void *destAddr = (void *) buffer
DMAC_ChannelTransfer(DMAC_CHANNEL_1, srcAddr, 2, destAddr, sizeof(buffer), 2);
But all I get is the same sample being loaded in all of the buffers positions.