be80be
Well-Known Member
I used an astable 555 in place of the PIC because that circuit sim doesn't have a PIC.
His bridge and divider will work with a pic I don't no about the 555 but the Op said as quoted he couldn't sim a pic micro.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I used an astable 555 in place of the PIC because that circuit sim doesn't have a PIC.
His bridge and divider will work with a pic I don't no about the 555 but the Op said as quoted he couldn't sim a pic micro.
But a simple 47K resistor (as an example value), direct to the PIC pin from the 28V is all that's required.
I have to go with Nigel on this one.
Using this method there is still 28V on the pin but there is only a very small amount of current and the PIC will clamp it to 5V. By ohms law the very small current results is almost no voltage drop across the resistor. The resistor is there to protect the PIC should the pin be set as an output. it limits current.
Nigel Goodwin I'm with you I would use what works best but in light of what has been posted at microchips forum and what i have read
I 'm going to be a little more careful about telling some one to poke 28 volts on a input pin. There a lot of room for mistake's.
With a voltage divider they can't go wrong telling them to use a current limiting resistor they could pick the wrong pin
This one I/O pin has protection diode to VSS only.
Ok just past the green part saying the pin was at 28V I said it was clamped to 5V. I was trying to say that the resistor is not responsible for the voltage drop. It is due to the diode clamp. Did a insert explicative poor job.Using this method there is still 28V on the pin but there is only a very small amount of current and the PIC will clamp it to 5V.
I will flat out give you this one. I was only thinking of the resistor as a current limiting. I can see that the voltage drop, forced by the Zener, is important to the survival of the Zener.By ohms law the very small current results is almost no voltage drop across the resistor.
It has safety benefits and an added benefit that it can be built and tested with 2 resistors (to test output voltage levels) WITHOUT needing the PIC connected. So the "scary testing" bit can be done with no risk to the PIC.
And I also like putting caps on input pins, but maybe that's a more commercial approach than a hobby approach?
I will flat out give you this one. I was only thinking of the resistor as a current limiting. I can see that the voltage drop, forced by the Zener, is important to the survival of the Zener.
The voltage divider is looking better to me, just one more resistor and we do not have to rely on the Zener clamp.
Only of use of course if you're feeding it a very slow changing signal, to help debounce.