5V tollerant AVR?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm doing a little project, and the AVR in it is running at 3.3V (well, will be that is) and a part of the device wants 5V.

Now, according to the general IO pin schematic, the protection of each pin consists of two diodes connected to Vcc and GND.

I'm thinking to use one resistor, instead of making a voltage divider for the inputs on the AVR. With this I'd abuse the protection diodes. The extra voltage would dissipate on the resistor, and the diode would provide the "reference" to which the voltage is supposed to be trimmed.

So instead of using two resistors to connect the 5V output to the 3.3 input of the AVR, I'd use one resistor.

Is this OK/wise?

Thanks,

David

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The data sheets specify that the maximum voltage on any pin is generally Vcc + 0.5V, and for good reason. The diodes are not meant as a design tool! They are for PROTECTION.

If this is for a production product, don't do it, it can result in reduced reliability over the long term.

If it is for a one off at home, then use a high value resistor to make sure the current into the input is small. Maybe 10-50uA per pin max.

Dean

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want to be 5V tolerant, then the AVR must be powered with 5V, there is no other way.

If I understand the data sheet right, the AVR was not damaged at VCC+0.5V on its IOs.

But this must not mean, that the AVR works fully correct at VCC+0.5V.

So for commercial use I would avoid it (e.g. resistor + shottky diode).

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh well, thanks. Was worth a try though.

What would happen by the way, if I used a 10k resistor and the diodes would then take a current of 0.2mA? Would any damage occure?

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Likely no damage would occur, but I can't find a maximum current spec in the datasheet.

I think it's no problem to use them as long the current is limited to a low value. As protection devices they need to have a bit of guts anyway.

One ADC chip I've used allows no more than 10mA flowing through the protection diodes. More current actually interferes with its operation as I found out :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looked for some more info:

Application note 184 also uses a resistor to clamp mains AC voltage to VCC+0.5 and GND-0.5V. Current limit is 1mA.

So, a 10K resistor that limits the current to 200uA is fine ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good find, jayjay! I think you likely mean application note number 182, though: http://www.atmel.com/dyn/resourc...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Typo :) :oops:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you do use the resistors and protection diodes for voltage clamping, make sure you know where the current is going. For example, a 3.3V AVR uses few milliamps, but if you stuff one extra milliamp through the protection diodes to VCC, the 3.3V regulator might not like it or at least the VCC might then jump to for example 3.4 volts or something.

Another example: an AVR is powered from 3.0V battery. You feed 5V into an IO pin, limited to 1mA by resistor. Basically you are then charging the battery.

- Jani

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is only true if the regulator/battery needs to supply less then that 1mA to maintain the 3V3. If the regulators needs to supply 100mA, then with additional 1mA from the input, it's only 99mA.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks guys! A lot of help was here. I guess I'll just go with the safer route and use two resistors instead of one. Who knows what might happen.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daqq wrote:
Who knows what might happen.
Well, I think that's the key point. Unless the behavior can be deduced from the datasheet (and guaranteed in your design), then the behavior can only be guessed, but not known with certainty. (Granted, the AVR182 note gives some hints as to behavior.)