what I mean is that the pin is not putting out 5v anymore. Nothing is coming out..
I will post schematic tomorrow
ken
A piece of good advice...
Whenever you're driving anything external to the PIC, it's a good idea to throw an in-line resistor between that pin and the device. Generally, a PIC's output is limited to about 25mA, therefore, at 5v, you'll want about a 200 ohm resistor on there, just for protection, limits the current to right at 25mA @ 5v. Not only will it protect the pin quite a bit, but it'll help stifle some noise/ringing, that sort of thing.
Of course, it always depends on what you are driving, but, I keep a bunch of 100ohm DIP resistor packs handy just for that purpose alone.
And another thing, if you did fry the output high driver, chances are you can still use that pin if you put a pullup on it, treat that 'dead pin' like an open-drain output. At least you'll get the use out of it again.
I did add 5k resistor between the pin and the gate. I also added a 100k resistor to the ground from the gate so that it stays at zero volt when not used. I found out that some relays where turning on for no apparent reason, with the 100k resistor it fixed that problem.
could there be spikes from the ground coming from the coil in the relay when it collapse. (shutting down)
k
YES
Do you have a "flyback"diode across the relay coil?
http://en.wikipedia.org/wiki/Flyback_diode
http://www.4qdtec.com/catch.html
Dave
Always wear safety glasses while programming.
flyback .. no
ok here are the parts I have
pin----5.1k-----gate
drain ----100k-----source
source----ground
12v---coil----220ohm-----drain
I will add a flyback thanks
k
Doin' good so far...'cept for the missing flyback diodealways use one...make sure you get it in the right way!
Are you using an N-channel MOSFET? Using the PIC to add a ground to the coil? The 100k resistor is bleeding off any leakage coming thru the MOSFET. N-channel aren't so bad for this, P-channel's are worse (and you have to pull the gate the other way)...that's probably why the MOSFET would turn on for no apparent reason.
Bookmarks