Maker Pro
Maker Pro

24V into PIC12F629 pin is ok?

eem2am

Aug 3, 2009
429
Joined
Aug 3, 2009
Messages
429
Hello,

We have a circuit in which 24V will be connected to a PIC pin, but there will be a 100K resistor in series with the pin. Will this be OK?
Here is the basics of the circuit...showing the pin with the 100K attached to it.

http://i47.tinypic.com/n3t5pk.jpg


(Doing it like this saves us a lot of circuitry)

By the way, we already do this but with 12V, and we've had no problems....will it be ok with 24V?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
No, if you look at the datasheet you will see that the max voltage on any pin is Vdd+0.3V.

All you need an another resistor to ground to make a divider that will put no more than Vdd on the pin.

Bob
 

eem2am

Aug 3, 2009
429
Joined
Aug 3, 2009
Messages
429
i cant do that because then i would never be able to detect a high on that pin with the 100k in front of it.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Is it the one labelled "To LED driver"?

Place a 180k resistor in series. That will (with the 51k resistor already there) make a voltage divider that will convert 24V to something very close to 5V.

The high series resistance means that even if some small current does flow through the protection diodes, it is likely to do no damage.

This solution means a logic high will need probably 15V or more or it may not register.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,725
Joined
Nov 17, 2011
Messages
13,725
You should add at least the series resistor, as you already do, plus
- either a zener diode from the PIC's pin th ground
- or a Schottky diode from the PIC's pin to Vcc.

When you don't limit the voltage on the pin (e.g. by one of the above methods) you rely on the IC's protection diode to limit the voltage to Vcc+Vdiode (internal). While this will work in many cases, it is not what these diodes are meant for. You're abusing them and there is no guarantee that the same circuit will work e.g. if the manufacturing process of the PIC is changed.
attachment.php
 

Attachments

  • PIC_protection.gif
    PIC_protection.gif
    1.9 KB · Views: 223

eem2am

Aug 3, 2009
429
Joined
Aug 3, 2009
Messages
429
24V would be connected to P3 and indeed P4.

We are already doing this , but with 12V...and there are no problems.

But is it ok with 24V......

Whats the max curent that an pic esd protection diode can take..........microchip have app notes recomending using the esd diodes like this in mains zero crossing detectors, so its legitamate use, but they dont say what is the max current that the esd diode can take.

I have very little room for any extra components, even the extra diode or zener mentioned above.

This is a small product which sits in a small place

Also, i do not wat to increase the 100k as i may get more noise
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
i cant do that because then i would never be able to detect a high on that pin with the 100k in front of it.
Yes it will. Assuming a Vdd of 5V, you would size the divider to put 5V on the pin when the signal was at 24V. Why would you think it would not read as high?

Bob
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Also, i do not wat to increase the 100k as i may get more noise

That would be an issue if the resistor was some distance from the pin. if it's close to it, not so much.
 
Top