2
\$\begingroup\$

I have a Sam3x (Arduino Due hardware, but I don't use the Arduino IDE or libraries, and I don't use the Atmel libraries, just the register interface in sam.h).

I have multiple pins configures as ADC pins. How can I do an AD conversion on one of these pins? The way the relevant datasheet chapter is written seems to suppose that I always want to do a conversion of ALL pins that are configured as input.

Datasheet http://www.atmel.com/images/atmel-11057-32-bit-cortex-m3-microcontroller-sam3x-sam3a_datasheet.pdf ADC starts at page 1317.

\$\endgroup\$
2
  • \$\begingroup\$ Can you give the datasheet's page the ADC register and the actual code of sam.h? Normally, you set the value in the register which represent which ADC will be turn on. \$\endgroup\$
    – MathieuL
    May 23, 2016 at 15:39
  • \$\begingroup\$ That seems to be my problem: enabling the ADC function on a pin seems to imply that it will be included in a conversion. But IFAIK it is bad practice to put an anlog value onto a digital pun, so all pins that receive an analog value should be configuerd as analog. \$\endgroup\$ May 23, 2016 at 15:53

1 Answer 1

1
\$\begingroup\$

The user sequence register looks like it can support multiple conversions of a single input during the sequence, so this may serve your purpose. However, with Schmitt trigger inputs on the PIO I think maybe you are overly concerned (unless noise breakthrough from the unsampled analogues is your concern).

\$\endgroup\$
2
  • \$\begingroup\$ I recall from other chips that applying a signal that is not a defined digital level results in bad or sub-standard behaviour, but maybe I am too paranoid. \$\endgroup\$ May 23, 2016 at 19:56
  • \$\begingroup\$ Check the PIO section in the manual. The worst that can happen is the input logic toggles and takes some power- but the path there will be pretty short. \$\endgroup\$ May 23, 2016 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.