Maker Pro
Maker Pro

Max V on a PIC IO Pin

Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor? Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

Thanks,

John
 
P

PeteS

Jan 1, 1970
0
Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor? Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

Thanks,

John

Feed it through a 47k or so resistor and add a schottky diode from the
IO pin to Vcc (Anode to the pin, cathode to Vcc). Use a schottky to keep
the differential voltage below the maximum ratings. They are as cheap as
'standard' types nowadays.

Cheers

PeteS
 
E

Eeyore

Jan 1, 1970
0
Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor?

That's a current not a voltage !

Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

Level translation is best for this. Use the 6-20 V ( via a resistor ) to
turn on an npn transistor ( with a pull-up to 3.3V on its collector ) and
connect the port pin to the transistor's collector.

Graham
 
Ahhhh.... That's it.

Pete, I was worried in your solution, about pulling the Vcc high in a
low current application.

I'll give it a try and play with it in PSpice to make sure I'm doing
everything right.

Thanks,

John
 
J

John Popelish

Jan 1, 1970
0
Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor? Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

The over voltage specs (and current from outside the supply
rails) for the PIC only account for the threshold of damage,
not for perfect operation. If it was my design, I would
provide a series resistor and voltage clamp (2.5 volt shunt
regulator chips work pretty well).

If the key press voltage could be present when the micro is
unpowered, I would also add a series resistor downstream of
the clamp to limit the current into the unpowered input.

If the lack of key press provides an open circuit, I would
also provide a shunt resistor to zero volts at the input
that would not divide a 6 volt signal to less than the 3.3
volt supply voltage.
 
OK. I'll have to put this together in my head. In the mean time I'll
add some info to confuse the issue. This is for a power switch for the
system. Pressing the switch will turn the regulator on and then the PIC
will hold the regultaor on. To power down, I need to detect when that
switch is pressed again. So I guess your point may be an issue.

I'm also open to any other bright ideas dealing with an 'on/off'
circuit for an MCU.

Thanks for all the great ideas,

John
 
P

PeteS

Jan 1, 1970
0
John said:
The over voltage specs (and current from outside the supply rails) for
the PIC only account for the threshold of damage, not for perfect
operation. If it was my design, I would provide a series resistor and
voltage clamp (2.5 volt shunt regulator chips work pretty well).

If the key press voltage could be present when the micro is unpowered, I
would also add a series resistor downstream of the clamp to limit the
current into the unpowered input.

If the lack of key press provides an open circuit, I would also provide
a shunt resistor to zero volts at the input that would not divide a 6
volt signal to less than the 3.3 volt supply voltage.

I was assuming the OP wanted a very simple solution using a series
resistor if possible. I've 'overvoltaged' PICs through schottkys in
production units (more than 100k shipped) where the overvoltage event (+
~ 0.2V because of the diode) happens regularly (numerous times per day)
and I've never had one fail (shipping started 2 years ago on that product).

My preferred solution is the same as Graham's.

Cheers

PeteS
 
J

John Larkin

Jan 1, 1970
0
Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor? Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

Thanks,

John

If the PIC has esd diodes, and it's 99+% likely it does, sure, that
will work fine. 40 uA won't hurt anything.

John
 
R

Roger Hamlett

Jan 1, 1970
0
John Larkin said:
If the PIC has esd diodes, and it's 99+% likely it does, sure, that
will work fine. 40 uA won't hurt anything.
In fact, Microchip, have an application note, using a large resistor this
way to detect mains!. I'd not want to do this, but the diodes will handle
this fine. Remember though that these diodes are clamping to the supply
rail, so have the same problem in this regard as a Schottky. There are
also some other 'caveats'. For instance, if this is one of the chips that
allows you to do I/O on the MCLR/Vpp pin, this pin _does not_ have a
normal protection diode, and raising the voltage on this one will trigger
a programming cycle!. Also, though most PICs are fairly immune from
latchup, some models will occassionally experience this if a pin is pulled
well above the supply when the chip wakes up. The lower drop of the
Schottky diode prevents this behaviour.

Best Wishes
 
F

feebo

Jan 1, 1970
0
Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor? Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

Thanks,

John

I am always twitchy about doing this... far better to use an
opto-coupler or at least just a transistor to pull the IO pin
 
S

Spehro Pefhany

Jan 1, 1970
0
Hello All,

Can I put 20V on a PIC IO pin if I put it through a 470K resistor? Will
the protection diodes on the PIC be able to handle that? Or should I
add my own Zener? It's a 3.3V system that I need to detect the presence
of a 6-20V keypress, so a simple divider won't work.

Thanks,

John

You can generally get away with this (except on /MCLR or the
occasional open-drain pin that some PICs have), but you might have
small effects like an increase in Idd or current spilling out onto
other (perhaps analog) inputs, especially on the same port. You won't
damage the part.


Best regards,
Spehro Pefhany
 
A 32 ua is a typical current that feed the protect diode in the PIC
without risk ( see APP. Note in microchip website : a title like
"detecting powerline with PIC") so the 470K is an acceptable value.

[email protected] a écrit :
 
Top