I'm a new user for arduino DUE and i have a problem for configuration : I want another POT for making special filtrers and I can't find explications for configuration of ADC_CHER[] and the while :
(extract from original code)
ADC->ADC_CHER=0x1CC0; // Enable ADC channels 0,1,8,9 and 10
while((ADC->ADC_ISR & 0x1CC0)!=0x1CC0)
we want to enable ADCs 0, 1, 8, 9 and 10 that correspond to ADC7, AD6, AD10, AD11, AD12 respectively (you canverify it looking at this image www.robgray.com/temp/Due-pinout-A4.png).
Hello and thanks for clarifying this. The original Pedal Due code had confused me:
ADC->ADC_CHER=0x1CC0; // Enable ADC channels 0,1,8,9 and 10 (???)
The comment says ADC channels but the numbers apparently refer to Arduino pin pad numbers.
And the SAM3 data sheet isn't all that clear. It uses the term "ADC channel" on page 1338 but refers to its pins as AD0..AD15 elsewhere. Plus the somewhat perverse mapping of Arduino pin pads and labeling adds more confusion.
The reality is that the pedal code assigns ADC_CHER=0x1CC0 which enables ADC channels 7, 6, 10, 11, & 12 ( not 0,1,8,9 and 10). However those ADC channels do correspond to Arduino pin pad numbers 0,1,8,9 and 10.
So if I wanted to use just ADC channel 0, I would assign ADC_CHER=0x0001
and connect my input to Arduino Dup pin pad number A7, yes?
The reality is that the pedal code assigns ADC_CHER=0x1CC0 which enables ADC channels 7, 6, 10, 11, & 12 ( not 0,1,8,9 and 10). However those ADC channels do correspond to Arduino pin pad numbers 0,1,8,9 and 10.
Yes, as I mentioned before the way the Atmel datasheet labels the ADCs is different from the Arduino labels. It is confusing yes, if you name them one way or the other, somebody is going to be confused.
So if I wanted to use just ADC channel 0, I would assign ADC_CHER=0x0001
and connect my input to Arduino Dup pin pad number A7, yes?
You post alone solved three of my problems! Thank you! Just a typo: the first binary should have one less 1, so 0001_1100_1100_0000. Easy enough to spot, but might help future visitors? Edit: this reply refers to post #499 by Ray
Last edit: 5 years 5 days ago by ulf. Reason: specifying what post I'm commenting on