4
\$\begingroup\$

I’m operating an ATMega32 at 3v3 through USB and a LDO.

Is it possible to connect the AREF pin directly to the USB voltage of 5V so that I can read voltages between 0 and 5V when reading from the analog pins?

\$\endgroup\$
  • 4
    \$\begingroup\$ What does the datasheet say? \$\endgroup\$ – Elliot Alderson Jan 8 at 15:22
  • \$\begingroup\$ The microcontroller definitey can operate at 5V same applies to AREF it can operate under 5V, it is unclear to me if it can have a higher voltage than the one being fed through the VCC pins. \$\endgroup\$ – Ned Jan 8 at 15:28
  • 3
    \$\begingroup\$ Indeed this information will be in the datasheet, but since it might be difficult to find I'll help a bit: The datasheet will state that the voltages at the uC's inputs/outputs cannot exceed the voltage on the VDD pins. The reason for this is the ESD protection diodes. As soon as the voltage at AREF becomes higher than VDD + 0.5 V the AREF's ESD diode will start conducting. If you want a 5 V input range either power the uC with 5 V or use a voltage divider to lower the input voltage to the ADC. \$\endgroup\$ – Bimpelrekkie Jan 8 at 15:28
  • \$\begingroup\$ Thank you! I’ll use a voltage divider as it’s the best solution in my case. \$\endgroup\$ – Ned Jan 8 at 15:31
  • 3
    \$\begingroup\$ To learn more about what issues the ESD diodes can cause, watch this EEVBlog video: youtube.com/watch?v=2yFh7Vv0Paw Making this and comment above an answer because, well it is. \$\endgroup\$ – Bimpelrekkie Jan 8 at 15:32
7
\$\begingroup\$

Indeed this information will be in the datasheet, but since it might be difficult to find I'll help a bit:

The datasheet will state that the voltages at the uC's inputs/outputs cannot exceed the voltage on the VDD pins.

The reason for this is the ESD protection diodes. As soon as the voltage at AREF becomes higher than VDD + 0.5 V the AREF's ESD diode will start conducting.

So if you connect 5 V to AREF, the VDD supply of the uC will be pulled up to about 4.4 V ! But you supplied 3.3 V via an LDO. Yes, then the LDO will do nothing.

If you want a 5 V input range either power the uC with 5 V

or

use a voltage divider to lower the input voltage to the ADC.

To learn more about what issues the ESD diodes can cause, watch this EEVBlog video

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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