How to make analogRead() faster?

don't know the DUE yet in detail, but with the UNO I did the following trick once:

I split the analogRead() in three functions:

  • one to start conversion: void analogReadStart(int pin);
  • one to check if it is ready: bool analogReadReady(int pin);
  • one to read the data when conversion was ready int analogRead(int pin);

This allowed me to do the following:

void setup()
{
  ...
  analogReadStart(A0);
}

void loop()
{
  if (analogReadReady(A0))
  {
    value = analogRead(A0); 
    analogReadStart(A0);  // restart the next conversion immediately

    process(value);
  }
  // do other things here

}

It is an "analogRead() without (polling) delay" construct. It allowed me to process more samples per second than wit the standard analogRead().

Don't know if similar trick is possible with DUE

Another possibility might be a continuous mode conversion that triggers an ISR() when a new reading is ready. For an UNO this exists, agian don't know for the DUE.