CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RX shorted to GND

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

RX shorted to GND
PostPosted: Tue Jun 12, 2018 9:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 10:09 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 10:10 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 10:13 am     Reply with quote

Is that the answer to your question?

Mike
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 10:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 10:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 10:41 am     Reply with quote

ok, thanks Mike, what you suggest? A resistor and a zener diode?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 11:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 11:21 am     Reply with quote

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: 19552

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 11:30 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 11:32 am     Reply with quote

perfect! i will try it!

thanks
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 11:43 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 11:52 am     Reply with quote

Thanks temtronic!

I will test a few protection circuits.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Jun 12, 2018 3:03 pm     Reply with quote

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: 19552

View user's profile Send private message

PostPosted: Wed Jun 13, 2018 2:40 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group