Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] isolating Serial communication between 2 micros

Status
Not open for further replies.

Electro nS

Full Member level 6
Full Member level 6
Joined
Mar 9, 2013
Messages
324
Helped
49
Reputation
98
Reaction score
48
Trophy points
1,308
Activity points
3,818
i am facing some problems between 2 micros communicating in TTL serial. for some reason the serial module is burning on both sides .

is there is a way to use some kind of isolation (optocouplers or IC) to prevent a failure or short on one side from burning the serial module on the second side .

i have searched a bit , i found that an easy way might be to use RS485 converter from Maxim , but it contains only buffers inside to get differnial output and i donot know if it can provide the necessary protection , also considering max232 on both side which could help reducing noise !

any ideas ?

thanks in advance
 

Hi,

You need to say what chips you are using and what distance you have between the two devices.
Normally the only way I can imagine you would 'burn' the chips is if you connected tx to tx or rx to rx.

Another way to cause port damage is if your software is changing the ports direction /function while connected to the other chip.

With direct micro connections over a very short distance connecting tx to rx with a 1k resistor inline should help avoid that problem if the lines are physically crossed by mistake.

RS232 etc are needed for greater distances, but think its pointless looking at them until you sort out the serious fault you must have on short range work.

If the fault continues post your code and a circuit diagram so we can see what you are really doing.

Don't forget if you can feel part of a chip getting too hot to hold then its probably blown, and if you have two chips connected together you may well have blown both.
 
iam using atmega 328 . short distance <1m ,. and yes there might be accidental misconnection tx and rx ( i thought that was not harmful .
i will try the 1k resistor .

and i want to clarify that using the RS232 / or RS485 IC was not for a longer distance; instead i want to use it as a "first line on defence " so the porblem on one side doesnot cause the micro to burn instead i just change the RSXXX chip . does this make sense ?

and i will recheck for port direction change , because if one micro is on before the other , when the second starts maybe the port is defualt as input/output and initialization serial is changing the direction of pins while the first micro is sending data !! i hope what i meant is clear
 

iam using atmega 328 . short distance <1m ,. and yes there might be accidental misconnection tx and rx ( i thought that was not harmful .
i will try the 1k resistor .

and i want to clarify that using the RS232 / or RS485 IC was not for a longer distance; instead i want to use it as a "first line on defence " so the porblem on one side doesnot cause the micro to burn instead i just change the RSXXX chip . does this make sense ?

and i will recheck for port direction change , because if one micro is on before the other , when the second starts maybe the port is defualt as input/output and initialization serial is changing the direction of pins while the first micro is sending data !! i hope what i meant is clear


Hi,

Misconnections can blow you chip instantly or take a while - anyones guess -you have to be careful, though that 1k resistor is used on the Arduino Uno boards to avoid such problems.

Not too familiar with the amegas but if they are like the Pic micros, they would boot up with all the ports as inputs for obvious safety.

RS232 / Max232 chips would isolate to a degree but they of course introduce higher votlages which are even more dangerous !

You must address and fix what is causing your problem now on the chip to chip set up, there must be a serious fault somewhere, pointless adding extra chips to mask a basic problem.

There should be no real problem with 1mtr micro to micro, though better if you use a shielded cable.
 
Over short distances and using TTL levels it's probably easier to use opto-couplers rather than converting to RS232/422/485 and back again. The resistor solution might work but first check that the ground on both micros is at the same potential and they are connected directly together.

Brian.
 
Over short distances and using TTL levels it's probably easier to use opto-couplers rather than converting to RS232/422/485 and back again. The resistor solution might work but first check that the ground on both micros is at the same potential and they are connected directly together.

Brian.

can you clarify more on how the optocouplers connection , a link to a schematic on this setup would be great
 

Hi,

Think it would be worthwhile if you posted a diagram of how you have wired up both of your micros including the wires connecting the two ports together and the power supply/s for both micros.

Just adding a 2 optos is not necessarily going to solve you problem, but seeing a diagram might show where the original problem is.

2 micros talking to each other, onboard or via a short cable, via usart , spi or whatever is a very common action and no extra interface is needed, so why should you ?
 

Hi,

Think it would be worthwhile if you posted a diagram of how you have wired up both of your micros including the wires connecting the two ports together and the power supply/s for both micros.

Just adding a 2 optos is not necessarily going to solve you problem, but seeing a diagram might show where the original problem is.

2 micros talking to each other, onboard or via a short cable, via usart , spi or whatever is a very common action and no extra interface is needed, so why should you ?

i donot know how this could help : https://obrazki.elektroda.pl/7390471200_1375392333.jpg . but this is a general block diagram of the system . the connections in most cases are shorter than 0.5m to 1m maximum . notice that only 2 wires TX and RX are used . GND is common since the same battery is used and the DC - regulators are not isolated .

i would appreaciate any suggestion . curently i am testing with resistors 1k in series on TX RX lines. but the thing is the i might work for some time then fail , the failure is not immediate which makes the problem hard to detect . ( like ESD issues ...)
 

Hi,

The first thing I would do to isolate the problem is run both micros from one common 5v regulator - does that cure the fault ?
 

I am assuming that you are transferring data at fairly low speeds. At low speeds there should be no problems unless your resistance in bus is high, which is unlikely if you are using simple copper wires and fairly short distance. The most problems that I have ran into when trying to communicate via TTL logic is lack of common ground AND common +3/5 voltage. You should be ok if your micros are powered via same power supply.
 

I am assuming that you are transferring data at fairly low speeds. At low speeds there should be no problems unless your resistance in bus is high, which is unlikely if you are using simple copper wires and fairly short distance. The most problems that I have ran into when trying to communicate via TTL logic is lack of common ground AND common +3/5 voltage. You should be ok if your micros are powered via same power supply.

i donot get it , you are saying that resistance on the bus could cause problems ? others have suggested adding resistors on the path for protection .
and yes i am using 9600 baud rate . , not common Vcc , please check the diagram i have posted above and i will repeat it again : https://obrazki.elektroda.pl/7390471200_1375392333.jpg . and tell me i you think i have something messed up that is causing the chips UART module to burn .
Just a note , sometimes i had accidently switch the TX RX , as i understoud from folks that might be causing the problem ! ??
 

i donot get it , you are saying that resistance on the bus could cause problems ? others have suggested adding resistors on the path for protection .
and yes i am using 9600 baud rate . , not common Vcc , please check the diagram i have posted above and i will repeat it again : https://obrazki.elektroda.pl/7390471200_1375392333.jpg . and tell me i you think i have something messed up that is causing the chips UART module to burn .
Just a note , sometimes i had accidently switch the TX RX , as i understoud from folks that might be causing the problem ! ??


Hi,

Using any standard cable of 1 mtr in length will not cause any problems at 9600 baud - I have done such a set up many times.

At that distance providing each micros VSSs are connected to the same common 0v point then the circiut should be complete without the need for a common connection via the serial cable.

Can you be clear about
sometimes i had accidently switch the TX RX
- you do mean that you crossed over the tx and rx cable between the micros while they were running ?

Also you originally posted
the serial module is burning on both sides
- do you mean when you touch the body of the micro it feels hot - too hot to hold your finger on it for more than 10 seconds ?

Having either of the above happening just for a split second can blow the Usart port pins - not so you would physically see damage, but internally.

You have no idea if either of those chips are any good, the easiest is to just replace them, don't replace just one as the other one you think might be ok could be damaged and will cause another new one to blow when connected to it.
Fit those 1k resistors before you apply any power.

Again as said earlier, just use one power supply for both chips until you have things running correctly.

You have not said anything about the software you are using, have you configured the tx and rx ports correctly ? are you sure they are staying that way all the time? nothing is changing them by mistake ?

Its a straight forwards function and it does work well, so do try again , checking each step carefully.
 
Hi,

Using any standard cable of 1 mtr in length will not cause any problems at 9600 baud - I have done such a set up many times.

At that distance providing each micros VSSs are connected to the same common 0v point then the circiut should be complete without the need for a common connection via the serial cable.

Can you be clear about - you do mean that you crossed over the tx and rx cable between the micros while they were running ?

Also you originally posted - do you mean when you touch the body of the micro it feels hot - too hot to hold your finger on it for more than 10 seconds ?

Having either of the above happening just for a split second can blow the Usart port pins - not so you would physically see damage, but internally.

You have no idea if either of those chips are any good, the easiest is to just replace them, don't replace just one as the other one you think might be ok could be damaged and will cause another new one to blow when connected to it.
Fit those 1k resistors before you apply any power.

Again as said earlier, just use one power supply for both chips until you have things running correctly.

You have not said anything about the software you are using, have you configured the tx and rx ports correctly ? are you sure they are staying that way all the time? nothing is changing them by mistake ?

Its a straight forwards function and it does work well, so do try again , checking each step carefully.

thanks alot for the clarification , yes i have switched TX RX (connect TX to TX and RX to RX), while the micros are working , but the damage might not have been immediate. thats why i found it later.

i have touched the micros and they are not hot , actually one of them still functioned normally on other I/Os .

NOW i have fitted the 1k resistors and marked the TX RX so no more misconnection . the software is very simple and am sure nothing is wrong there .

the system is working fine so far . so i will mark this thread as solved ( so other people facing similar problem benefit) and hope everything will stay ok.

thanks guys..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top