View previous topic :: View next topic |
Author |
Message |
championx
Joined: 28 Feb 2006 Posts: 151
|
RX shorted to GND |
Posted: Tue Jun 12, 2018 9:48 am |
|
|
Hi! always with strange questions! haha.
I'm having a problem with a PIC18F46K80. It's a board that i use to get information over TTL line from a sensor.
One day the pic stopped receiving data, so:
1) checked the sensor, the sensor its ok,
2) then checked the cable, the cable is ok,
3) then checked the board... I measured voltage on the RX pin of the pic, voltage = 0v... so i turn off the board and measured continuity between RX pin and GND... SHORT... ok... thats weird... the board looks fine.... took the pic out of the board... measured continuity on the board... NO SHORT...
So then i measured the pic pins out of the board... and the RX pin is shorted to the GND pin....
What could cause this? a voltage surge? low voltage? a short to ground on the RX pin while working?
I'm lost... |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Jun 12, 2018 10:09 am |
|
|
Are you saying that a long cable from somewhere outside the board is directly connected to the chip's RX pin?
Mike |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Tue Jun 12, 2018 10:10 am |
|
|
yes, its connected through a diode to a long shielded cable.
RX pic pin--------(diode)>------- shielded cable TX SENSOR. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Jun 12, 2018 10:13 am |
|
|
Is that the answer to your question?
Mike |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Tue Jun 12, 2018 10:18 am |
|
|
i didn't answer my own question...
Besides that there is not an IDEAL case (ALMOST NO PROTECTION) the question is what can cause this short on the pin.
If for a short period a high voltage appears on the cable, the diode should isolate this voltage to the pic because the pic pin is connected to the ANODE and the cable is connected to the CATHODE ?
thanks |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Jun 12, 2018 10:39 am |
|
|
The cable will act like a transmission line and ring like a bell.
It will attempt to take the RX pin outside the supply rails in both directions.
It sounds like you've got nothing stopping it going well below ground and destroying the RX input.
Mike |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Tue Jun 12, 2018 10:41 am |
|
|
ok, thanks Mike, what you suggest? A resistor and a zener diode? |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Jun 12, 2018 11:02 am |
|
|
Start by finding out what the size of the problem is.
Connect a square wave generator to the far end of the cable and look at what you get at the RX end with a 'scope.
You need to curtail the ringing voltage to less than half a volt outside the rails.
A pair of Schottky diodes, a series resistor and a small cap will probably do it.
Mike |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Tue Jun 12, 2018 11:21 am |
|
|
Thanks mike, how should i put the two schottky diodes and where? I understand the cap and the resistor, but i can't imagine how the schottky's will work.
thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19544
|
|
Posted: Tue Jun 12, 2018 11:30 am |
|
|
Start by changing the diode for a resistor. The PIC input is high impedance so something like a 47K provides enormously more protection. Remember the PIC input protection has current limits. A big resistor helps to keep he current delivered into the pin down to safer levels. If you then add a transorb across the signal where it comes into the board (TVS. It'll be prevented from going to silly levels. |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Tue Jun 12, 2018 11:32 am |
|
|
perfect! i will try it!
thanks |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Tue Jun 12, 2018 11:43 am |
|
|
Unprotected lines of any length can easily carry EMI into a PIC or other device. A lightning storm, miles away, can induce sufficient power to 'zap' devices. Neighbour's welder aren't nice either !
However with proper, well designed protection you can have your product connected to 10-14 miles (yes, MILES) of copper and it'll perform flawlessly.
It is a mixture of science and voodoo though. On my remote energy control panels I have MOVs, NE-2s, caps, chokes, resistors and wide PCB traces and in 30 years never lost a board due to EMI. Most had 10 miles of copper between them and the host computer, so I KNOW it can work.
Jay |
|
|
championx
Joined: 28 Feb 2006 Posts: 151
|
|
Posted: Tue Jun 12, 2018 11:52 am |
|
|
Thanks temtronic!
I will test a few protection circuits. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Jun 12, 2018 3:03 pm |
|
|
The Schottky diodes are wired:-
1) Cathode to + rail, anode to PIC input.
2) Anode to GND, cathode to PIC input.
The idea is that current trying to get into the PIC passes through one of the Schottky diodes rather than the input protection diodes built into the PIC.
I don't like to rely on the PIC's diodes. The forward voltage of a Schottky diode is about half that of the built-in protection diodes!
You still need to limit the current with a series resistor.
Without knowing anything about your system, we can't be sure what other measures you may need.
By all means try other protection devices MOV, TVS, caps, chokes etc.
Mike |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19544
|
|
Posted: Wed Jun 13, 2018 2:40 pm |
|
|
The problem with zeners as input protection is that they don't have a nice 'below this voltage off, above this voltage on' characteristic. Instead their operation curves down well below their rated voltage. So A 5V zener may well start to conduct significantly below 5v, and if there is significant current, the voltage across the diode may go well above it's rated voltage.
This is why really the better circuit has two Schottky diodes to the supply rails. Which then clamp the signals from going very far above/below these rails. However critical thing then is having enough capacitance across he rails to prevent the supply voltage from being pulled up as current is dumped into the rails.
MOV's have the advantage of being able to withstand extremely high currents for a short time. Also it's turn on characteristic is generally sharper than a zener. They also turn on much quicker than a zener. Zeners have quite slow turn on, unless they are already in conduction, so if a sharp spike arrives, the zener won't respond....
Layered protection is the way to be reliable. Have something to limit the range of the actual data line, then something to ensure that if this goes up to the maximum this protection supports, the current on the input will not exceed the rating of the input diodes of the PIC (resistor). Then have plenty of supply capacitance rated for high frequencies to ensure the supply does not go up if the PIC input diodes are used. Also consider some amount of capacitance across the input to slow the signal speeds involved.
Also we haven't mentioned the type of wire. Twisted pair can help significantly. |
|
|
|