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

Reply to
jecottrell65
Loading thread data ...

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

Reply to
PeteS

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.

Reply to
John Popelish

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

Reply to
jecottrell65

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

Reply to
PeteS

That sounds good. Clean, simple, covers most possibilities, and little chance of frying the MCU.

Thanks,

John

Reply to
jecottrell65

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

Reply to
John Larkin

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

Reply to
Roger Hamlett

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

Reply to
feebo

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

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
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.

snipped-for-privacy@gmail.com a =E9crit :

Reply to
belaragueb_c

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.