Digital Input Higher than Vcc..???

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

Hi there,

In my current design the AVR is connected to 3.3V but there are 2 inputs coming from an RF module, which is at 5V level.

I have read this Ap.Note. (AVR182: Zero Cross Detector)
http://www.atmel.com/dyn/resourc...

And I was wondering if I could connect these 5V signals via resistors to digital inputs (of the AVR), based on the specific Ap.Note and the AVR's internal clamping diodes ????

Thank you.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

See the interfacing sticky in the Electronics forum.

Series resistors can prevent input burnout, but there is a speed penalty. So, whether or not that is viable depends on required response speed.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

Thank Jim,

The input signals are realy very slow. Much more slower than 50Hz (than the Ap.Note). So, do you suggest me to do this connection?

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

Ok. I show this Ap.Note:
http://www.zbasic.net/appNotes/A...

That is posted in this thread:
https://www.avrfreaks.net/index.p...

Looking at page 6/11 (Figure 8) I am asking if it is safe to use the AVR internal clamping diodes (not external). Even there is no info in the AVR datasheets about the current of the Internal clamping diodes, there is a thread in AVRFreaks forum that someone says that the current is 1mA.

So Is it safe to connect a 5V signal to an 3V AVR input via a resistor only?

Thank you.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

icarus1 wrote:

So Is it safe to connect a 5V signal to an 3V AVR input via a resistor only?

Thank you.

You could do it, but I would not like it as a long-term solution.

What would be the problem to add another resistor to divide the 5V signal into 3.3V signal? For instance 33kohm and 17kohm resistors divide 5V to 3.3V with very little DC current, and would work well as signal speed was not your problem.

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

The signal voltage is always 5V, but the Vcc voltage is 3 to 5V because of emergency battery supply. That's why I don't think that a simple Resistor divider is the right solution for this design.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

Well that makes everything different. Any other requirements we don't know about?

Then use a proper logic buffer (or inverter) like 74lcx14. Many other chip types work as well.

Eats 3.3V supply. Tolerates 5V input signals. Regards input voltages over 2 volts as logic 1. Solves all your problems.

Or drive a transistor (BJT or FET) with the signal and connect the output to AVR.

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

Michael,
as I saw AVR182 the first time, I asked Atmel about the specs of the internal clamb diodes, answer:

Quote:
continous forward current: 1mA
forward voltage: typ. 0.5V

/Martin.

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

Quote:
So Is it safe to connect a 5V signal to an 3V AVR input via a resistor only?

Every AVR's datasheet states in Absolute Maximum Ratings chapter the allowable IO voltage is Vcc+0,5V and GND-0,5V IIRC.

You can see Atmel's "AVR182: Zero Cross Detector" clearly violates their own AVR specification, because this is a small silicone diode, which has about 0,8V @ 1mA..

Mind on some avrs /reset IO does not have the upper clamping diode.

Answering your question if it is safe: No, it is.

No RSTDISBL, no fun!

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

icarus1 wrote:
The signal voltage is always 5V, but the Vcc voltage is 3 to 5V because of emergency battery supply.
You can use a simple diode/resistor interface to allow an signal to pull an input to ground but allow a pullup to effect the input-high state. You'll need to use a diode with a forward voltage that is low enough to meet the input's maximum voltage to be recognized as a logic zero but this is pretty easy with the AVR's logic thresholds. The resistor value is not very critical, especially with slow signals and there can be issues with very fast input signals. In the situation you described it should work fine for input levels that do not exceed the diode's maximum reverse voltage specification.

Attachment(s): 

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

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

Optocouplers are another option.

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

Thank you all.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer