Max input voltage on a I/O pin at low current?

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

Hi all

I'm sure I've read the answer somewhere before, but the search button isn't being too helpful right now. Can I run a +12V line via a 100K resistor into an AVR (AtTiny261)?

Basically, I've had to jerry rig up a MOSFET controlled power on/off switch controlled by the AVR. I'm using an FDS6675 P-Channel MOSFET, to switch +12V to a load. There is a 100K pullup on the gate, and I'm hoping I can just run the gate into the AVR direct. Normally I run via a second N-Channel MOSFET, but I'm hoping due to the jerry rig problem that I can get away without it.

The tiny261 datasheet says max is VCC + 0.5 which makes sense, but it doesn't mention current. The 100K should limit the current to 0.1mA, so would that be acceptable?

Cheers - Matt

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

There has been some discussion about this. Generally, its NOT in the specs, but I think it has been reported that independent communication with Atmel suggests that 0.1mA should be OK. Wow, all those weasel words!

BUT, if the pin is configured as an output, the low impedance will prevent the pin from rising significantly beyond Vcc. In this case, its NOT the diode that is involved, Instead, its reverse current in the pullup transistor.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

I was thinking that when I need to turn on the fet, I would make the avr pin an output and drive it low. That should work just fine. And then when I turn off the fet, I would make the avr pin an input and turn on the pullup.

I guess I'll just have to try it and see. I hate having to jerry rig something just because someone else changes their mind.

Matt

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

It's not in the datasheet but Atmel specified the diodes:

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

/Martin.

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

if its a p channel mosfet, then your gate is going to have to go to near the 12V rail in order to turn it off. The protection diode in the AVR will clamp the output to 5V (VCC) which will keep the mosfet on.

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

Using a pullup connected to 12V works fine as long as you can ensure that the current sum through the protection diodes is ALWAYS less than the total current consumption of all components connected to VCC.

Example:
- VCC = 5V (from a low quiecent current regulator)
- Input pin connected to 12V via 100k resistor
- Current through pullup and protection diode to VCC = (12V - 5V) / 100 kOhm = 70µA

If the AVR enters power down mode, current consumption of the application drops to a few µA. The current through the protection diode might now lift VCC into a range which could become unhealthy for the AVR (Usually a regulator can only source current and has no sink capabilities).

Regards
Sebastian

EDIT: I overlooked the P-Ch FET issue. Pay good attention to Kartman's advice

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

This is just speculation (I'm not really "seeing" the circuit) ... but if you add in a series resistor between the gate and the avr pin (with the pullup on the FET side of it)... say 10k, that'd put your low voltage at about 1V (low enough to turn the transistor on, right?) and provide somewhere to "dump" the input voltage across when the pin is set as a pull-up input.
Just speculation, standard disclaimer, etc. etc.

Edit: Just pulled out my brain (ouch :P) and it seems my 10k won't make it work (high voltage will be 5.6V)... but there may be other combinations?

Edit2: And I just tried a few combinations, without success. At this point, it seems easier to just add in the second FET...

Edit3: What about a 7V Zener in series? With the anode towards the transistor... that'd "remove" the +5V clamping problem, right? Still seems easier to add the transistor :)

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

TrainzStoffe wrote:

Edit3: What about a 7V Zener in series? With the anode towards the transistor... that'd "remove" the +5V clamping problem, right? Still seems easier to add the transistor :)

Nope, because then, when you have 0V/5V on AVR, your FET gate just has 7V offset added, i.e. 7V/12V. Most likely 7V on gate does not cause FET to conduct enough, you'd need 0V on gate.

Edit: wait, did you say anode towards transistor, cathode towards AVR? that is even more wrong and any ordinary diode would do the same thing. FET gate would only have about +0.7V compared to AVR output pin. Most likely you meant cathode towards transistor, anode towards AVR above?

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

Jepael wrote:

Edit: wait, did you say anode towards transistor, cathode towards AVR? that is even more wrong and any ordinary diode would do the same thing. FET gate would only have about +0.7V compared to AVR output pin. Most likely you meant cathode towards transistor, anode towards AVR above?

Of course I meant it that way :) Just got mixed up, as always with which side is which on a diode. Cathode towards the transistor, naturally.

I never was very good with PMOS transistors - all the lecturers just said "think NMOS and then reverse", but sometimes not everything should be reversed. From what my memory and the net has told me, to saturate a PMOS you need to fulfill two conditions:
a) |Vgs|-|Vth|>0
b) |Vds|>|Vgs|-|Vth|

a) Should easily be satisfied by a 7V low voltage, right? Vg = 7, Vs = 12 => |Vgs| = 5 > Vth
b) Is then the trickier one... but comparing with Vg = 7 or Vg = 0... I really can't think this through at the moment. I'll have to have a look in the ol' books when I get a chance. Lunchtime for now!

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

Well how much |Vgs| you need to turn the FET on? Based on the datasheet it's a logic level FET meaning 5V is enough.

Now it is a P channel FET with 12V Vd, so Vgs=0 when Vg is also 12V to turn FET off, and Vgs=5V when Vg=7V to turn FET on. So based on that, your 7V zener idea could work.

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

Wow lots of replies and I never got an email about them. Sorry for no response guys. As expected it didn't work. I had to add in a N-channel fet to run the P-channel which is what I normally do anyway.

My next problem is that I have 200 loaded PCBs turn up from my supplier and I can't get any ISP response. I checked all the tracks etc and it's ok. I replaced the tiny261 with one from my stock and everything works ok. I did this to 4 so far. I thought maybe they had been programmed to external oscillator (I'm using internal), so I injected a clock and still nothing. Hopefully I haven't got 200 fake chips.

Matt