Hi Roe,
Check out example code at :
http://www.at91.com/Project/Controleurs ... sation=315 NOTE: password is adc.
I have 7 A/D's connected. Here is THE CORRECT code:
*********************************************************************
volatile UINT16 adc_array[80];
#define ADC_PDC_COUNT 7 // If you set this to 70, then 10 sets of 7 ADC will be performed.
ADC_PTCR = 0x0201; // xfer Control, disabe dma xfer, enable dma recv.
ADC_RPR = (UINT32) adc_array;
ADC_RCR = ADC_PDC_COUNT;
while ( 1 )
{
if (ADC_RCR == 0)
{
for (i=0; i<ADC_PDC_COUNT; i=i+7)
{
if (adc_array[i] < 0x200)
{
i=i; // never hit this breakpoint
}
}
ADC_RPR = (UINT32) adc_array;
ADC_RCR = ADC_PDC_COUNT;
}
}