EmbeddedRelated.com
Forums

How to protect signals from MCU

Started by pozz April 26, 2019
I need to connect some signals (around 10) coming from an MCU to another 
MCU/logic IC far away round 1 meter. They are on different PCBs (and 
different metallic cases). The connectors between the units will be 
standard D-SUB.

I don't know if it's safe to route signals from MCU directly to D-SUB 
connector on the same PCB, 1 meter cable, D-SUB connector and finally 
the destination IC.

I know the protection could be as simple as a series resistor (cheap 
solution) to differential driver or photocouplers (high cost and space).

I was thinking to convert the signal from the MCU to open-drain by a 
simple transistor (the signals are mono-directional). However this 
negates the logic, so I need to negate again on the destination PCB (or 
in the firmware).

What do you use as an affordable solution?

On Friday, April 26, 2019 at 3:56:09 AM UTC-4, pozz wrote:
> I need to connect some signals (around 10) coming from an MCU to another > MCU/logic IC far away round 1 meter. They are on different PCBs (and > different metallic cases). The connectors between the units will be > standard D-SUB. > > I don't know if it's safe to route signals from MCU directly to D-SUB > connector on the same PCB, 1 meter cable, D-SUB connector and finally > the destination IC. > > I know the protection could be as simple as a series resistor (cheap > solution) to differential driver or photocouplers (high cost and space). > > I was thinking to convert the signal from the MCU to open-drain by a > simple transistor (the signals are mono-directional). However this > negates the logic, so I need to negate again on the destination PCB (or > in the firmware). > > What do you use as an affordable solution?
There is the issue of protection, but also of the signal reaching the other end without corruption. When working with two boxes, powered separately and possibly on different AC power circuits, you need different levels of protection depending on the amount of noise and ground differential you may see. When connecting two separate chassis it is a good idea to isolate with optical circuits to provide the best protection. Optocouplers are not really high cost. I think they are about a buck or two per channel. You will need to drive around 5 mA per channel which most MCUs can do from a number of IO pins. If your signals are low speed you might be able to use differential signalling through resistors for isolation, but it is still potentially subject to upset if the voltage between the box grounds is higher than the common mode range of the devices. If the units are not plugged into the same outlet and even if they are, surges can create large voltage differences between the two box grounds. Optos are recommended. -- Rick C. - Get a 1,000 miles of free Supercharging - Tesla referral code - https://ts.la/richard11209
Il 26/04/2019 10:18, gnuarm.deletethisbit@gmail.com ha scritto:
> On Friday, April 26, 2019 at 3:56:09 AM UTC-4, pozz wrote: >> I need to connect some signals (around 10) coming from an MCU to another >> MCU/logic IC far away round 1 meter. They are on different PCBs (and >> different metallic cases). The connectors between the units will be >> standard D-SUB. >> >> I don't know if it's safe to route signals from MCU directly to D-SUB >> connector on the same PCB, 1 meter cable, D-SUB connector and finally >> the destination IC. >> >> I know the protection could be as simple as a series resistor (cheap >> solution) to differential driver or photocouplers (high cost and space). >> >> I was thinking to convert the signal from the MCU to open-drain by a >> simple transistor (the signals are mono-directional). However this >> negates the logic, so I need to negate again on the destination PCB (or >> in the firmware). >> >> What do you use as an affordable solution? > > There is the issue of protection, but also of the signal reaching the other end without corruption. When working with two boxes, powered separately and possibly on different AC power circuits,
In my case, the two units have a different AC/DC PSU, but are plugged to the same mains AC line. Moreover they are metallic chassis mounted on the same rack, so with a good ground connections. you need different levels of protection depending on the amount of noise and ground differential you may see. When connecting two separate chassis it is a good idea to isolate with optical circuits to provide the best protection.
> > Optocouplers are not really high cost. I think they are about a buck or two per channel. You will need to drive around 5 mA per channel which most MCUs can do from a number of IO pins.
Could you suggest some opto parts?
> If your signals are low speed
yes, they are
> you might be able to use differential signalling through resistors for isolation, but it is still potentially subject to upset if the voltage between the box grounds is higher than the common mode range of the devices. If the units are not plugged into the same outlet and even if they are, surges can create large voltage differences between the two box grounds. Optos are recommended.
Differential signalling means doubling the number of wires in the cable... I would prefer other solutions
vineri, 26 aprilie 2019, 10:56:09 UTC+3, pozz a scris:
> I need to connect some signals (around 10) coming from an MCU to another > MCU/logic IC far away round 1 meter. They are on different PCBs (and > different metallic cases). The connectors between the units will be > standard D-SUB. > > I don't know if it's safe to route signals from MCU directly to D-SUB > connector on the same PCB, 1 meter cable, D-SUB connector and finally > the destination IC. > > I know the protection could be as simple as a series resistor (cheap > solution) to differential driver or photocouplers (high cost and space). > > I was thinking to convert the signal from the MCU to open-drain by a > simple transistor (the signals are mono-directional). However this > negates the logic, so I need to negate again on the destination PCB (or > in the firmware). > > What do you use as an affordable solution?
If you can safely connect the logical GND of one board with the other's, then it's safe. You should allocate one wire just for that. Ground loop? Maybe, usually not a problem in the case. If you don't know if it's safe to connect the two GND, well, the answer is: you should know. But if you really don't know (however, you seems to know what power supply are there), then use opto-isolation. You need opto only on one side, where you get an isolated GND. You'll then be able to connect the isolated GND with anything, - the GND of the other board in this case. Are you really concerned of the safety of the MCU (afraid of burning?) or just about the safety of the signals? Plain wires at 5V or 3.3V can veeeery easily pick up all kind of noises. The solution is sometimes converting the signal to an RS485 pair. Only that it doubles the wires. I have seen many times this solution used even internal to the same device (more than one board, but in the same cabinet on the same power supply). I had once a situation: One of my board sitting on the back side of the cabinet needed a display on the front door of the cabinet. I used 3 wires, 5V levels (and another two to send the 5VDC supply) and the display had only shift registers (HC595). This was a very noisy cabinet controlling big motors. Very noisy. A shielded 5-wire cable (one meter) was not enough. The display (a 7-seg digits display) was flickering badly all the time. The solution was to conduct the cable around a ring ferrite bead - the solution usually seen on old VGA cables, but even on some USB cables as well. The shield was even not neccessary. Just five discrete wires with a ferrite ring.
On 26/04/2019 09:35, pozz wrote:
> Il 26/04/2019 10:18, gnuarm.deletethisbit@gmail.com ha scritto: >> On Friday, April 26, 2019 at 3:56:09 AM UTC-4, pozz wrote: >>> I need to connect some signals (around 10) coming from an MCU to another >>> MCU/logic IC far away round 1 meter. They are on different PCBs (and >>> different metallic cases). The connectors between the units will be >>> standard D-SUB. >>> >>> I don't know if it's safe to route signals from MCU directly to D-SUB >>> connector on the same PCB, 1 meter cable, D-SUB connector and finally >>> the destination IC. >>> >>> I know the protection could be as simple as a series resistor (cheap >>> solution) to differential driver or photocouplers (high cost and space). >>> >>> I was thinking to convert the signal from the MCU to open-drain by a >>> simple transistor (the signals are mono-directional). However this >>> negates the logic, so I need to negate again on the destination PCB (or >>> in the firmware). >>> >>> What do you use as an affordable solution? >> >> There is the issue of protection, but also of the signal reaching the >> other end without corruption.  When working with two boxes, powered >> separately and possibly on different AC power circuits, > > In my case, the two units have a different AC/DC PSU, but are plugged to > the same mains AC line. Moreover they are metallic chassis mounted on > the same rack, so with a good ground connections. > > > you need different levels of protection depending on the amount of noise > and ground differential you may see.  When connecting two separate > chassis it is a good idea to isolate with optical circuits to provide > the best protection. >> >> Optocouplers are not really high cost.  I think they are about a buck >> or two per channel.  You will need to drive around 5 mA per channel >> which most MCUs can do from a number of IO pins. > > Could you suggest some opto parts? > > >> If your signals are low speed > > yes, they are > > >> you might be able to use differential signalling through resistors for >> isolation, but it is still potentially subject to upset if the voltage >> between the box grounds is higher than the common mode range of the >> devices.  If the units are not plugged into the same outlet and even >> if they are, surges can create large voltage differences between the >> two box grounds.  Optos are recommended. > > Differential signalling means doubling the number of wires in the > cable... I would prefer other solutions >
Why not use RS232 level shifters at both ends, cheap, they come with 15kV static protection and multiple drivers in each package. The big signal levels, input thresholds and hysteresis will give you a certain amount of ground shift tolerance while keeping single ended. Ad's ADM560/561 look possible (4 tx, 5 rx but no esd protection) or Exar SP3243EBEA (3tx, 5rx, 15kv protection) Loads more on offer with just about every feature you could imagine. MK --- This email has been checked for viruses by AVG. https://www.avg.com
On 2019-04-26 pozz wrote in comp.arch.embedded:
> Il 26/04/2019 10:18, gnuarm.deletethisbit@gmail.com ha scritto: >> >> Optocouplers are not really high cost. I think they are about a buck or two per channel. You will need to drive around 5 mA per channel which most MCUs can do from a number of IO pins. > > Could you suggest some opto parts? > > >> If your signals are low speed > > yes, they are
If your signals are really slow (sub kHz) and you don't want a high drive current, have a look at darlington output optocouplers. The 4N32 should be below $0,50 in small quantities (25+). Up to a few kHz you could use cheap transistor output optos, like the HCPL-817, ~ $0.25. But these require more drive current and/or more sensitivity on the receiver side. If you need faster, go for the digital output ones. The 6N136 is usable to a few 100kHz, ~ $1.00. And there are of course much faster ones (Mbaud types), but the cost goes up. -- Stef (remove caps, dashes and .invalid from e-mail address to reply by mail) Those who don't know, talk. Those who don't talk, know.
On 4/26/2019 17:58, Stef wrote:
> On 2019-04-26 pozz wrote in comp.arch.embedded: >> Il 26/04/2019 10:18, gnuarm.deletethisbit@gmail.com ha scritto: >>> >>> Optocouplers are not really high cost. I think they are about a buck or two per channel. You will need to drive around 5 mA per channel which most MCUs can do from a number of IO pins. >> >> Could you suggest some opto parts? >> >> >>> If your signals are low speed >> >> yes, they are > > If your signals are really slow (sub kHz) and you don't want a high drive > current, have a look at darlington output optocouplers. The 4N32 should be > below $0,50 in small quantities (25+).
If he chases milliseconds and not microseconds he needs nothing more than some RC filtering at 1 meter with plain TTL levels. He said the boards had low impedance common ground, clearly his inputs are high impedance MOS inputs - unless he manages to get some TTL parts (who knows, may be he has a time machine...). So if his speed can tolerate say a 1k/1uF RC there is nothing more he would need. Dimiter ====================================================== Dimiter Popoff, TGI http://www.tgi-sci.com ====================================================== http://www.flickr.com/photos/didi_tgi/
On 4/26/19 12:56 AM, pozz wrote:
> I need to connect some signals (around 10) coming from an MCU to another > MCU/logic IC far away round 1 meter. They are on different PCBs (and > different metallic cases). The connectors between the units will be > standard D-SUB. > > I don't know if it's safe to route signals from MCU directly to D-SUB > connector on the same PCB, 1 meter cable, D-SUB connector and finally > the destination IC. > > I know the protection could be as simple as a series resistor (cheap > solution) to differential driver or photocouplers (high cost and space). > > I was thinking to convert the signal from the MCU to open-drain by a > simple transistor (the signals are mono-directional). However this > negates the logic, so I need to negate again on the destination PCB (or > in the firmware). > > What do you use as an affordable solution? >
A meter with nominally the same grounds? That's nothing, especially if you have a signal ground in the D-Sub bundle as well. I'm still a big fan of never taking CPU pins straight to the connector for ESD reasons, but that's largely because if something is going to be my sacrificial part I'd like it to be something easily replaced. You could use the RS-232 translators MK recommended, but honestly I'd say even that's overkill. How about just cheap digital buffers? 74LVC family works great for either 3.3 or 5V logic, and in my experience is a very hard family to kill. Get something with a Schmitt trigger for the receive side. Lots of people sell 74LVC3G17; I tend to use the identical NL37WZ17 from On Semi. 3 buffers to a can for 9 cents. If you really did want to go with something more hardened, like an RS-485 differential-type thing, then since you're going from MCU to MCU I'd figure out how to communicate the same information by going faster over fewer wires. You could do a fully differential SPI link (MOSI, MISO, CLK, and CS) on 4 pairs + 1 ground = 9 wires and you're still in an D9. But again, probably overkill. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix.
On Friday, April 26, 2019 at 1:19:09 PM UTC-4, Rob Gaddi wrote:
> On 4/26/19 12:56 AM, pozz wrote: > > I need to connect some signals (around 10) coming from an MCU to another > > MCU/logic IC far away round 1 meter. They are on different PCBs (and > > different metallic cases). The connectors between the units will be > > standard D-SUB. > > > > I don't know if it's safe to route signals from MCU directly to D-SUB > > connector on the same PCB, 1 meter cable, D-SUB connector and finally > > the destination IC. > > > > I know the protection could be as simple as a series resistor (cheap > > solution) to differential driver or photocouplers (high cost and space). > > > > I was thinking to convert the signal from the MCU to open-drain by a > > simple transistor (the signals are mono-directional). However this > > negates the logic, so I need to negate again on the destination PCB (or > > in the firmware). > > > > What do you use as an affordable solution? > > > > A meter with nominally the same grounds? That's nothing, especially if > you have a signal ground in the D-Sub bundle as well. I'm still a big > fan of never taking CPU pins straight to the connector for ESD reasons, > but that's largely because if something is going to be my sacrificial > part I'd like it to be something easily replaced. > > You could use the RS-232 translators MK recommended, but honestly I'd > say even that's overkill. How about just cheap digital buffers? 74LVC > family works great for either 3.3 or 5V logic, and in my experience is a > very hard family to kill. Get something with a Schmitt trigger for the > receive side. Lots of people sell 74LVC3G17; I tend to use the > identical NL37WZ17 from On Semi. 3 buffers to a can for 9 cents. > > If you really did want to go with something more hardened, like an > RS-485 differential-type thing, then since you're going from MCU to MCU > I'd figure out how to communicate the same information by going faster > over fewer wires. You could do a fully differential SPI link (MOSI, > MISO, CLK, and CS) on 4 pairs + 1 ground = 9 wires and you're still in > an D9. But again, probably overkill.
I never bring anything outside the box without ESD protection. My favorite is Schottky diodes to the power and ground rails. Replacing any part on the board from ESD is a PITA. Compared to adding ESD diodes to each input *and* adding a buffer chip, seems like using an optoisolator on each input is not a big deal. -- Rick C. + Get a 1,000 miles of free Supercharging + Tesla referral code - https://ts.la/richard11209
On 4/26/19 11:41 AM, gnuarm.deletethisbit@gmail.com wrote:
> On Friday, April 26, 2019 at 1:19:09 PM UTC-4, Rob Gaddi wrote: >> On 4/26/19 12:56 AM, pozz wrote: >>> I need to connect some signals (around 10) coming from an MCU to another >>> MCU/logic IC far away round 1 meter. They are on different PCBs (and >>> different metallic cases). The connectors between the units will be >>> standard D-SUB. >>> >>> I don't know if it's safe to route signals from MCU directly to D-SUB >>> connector on the same PCB, 1 meter cable, D-SUB connector and finally >>> the destination IC. >>> >>> I know the protection could be as simple as a series resistor (cheap >>> solution) to differential driver or photocouplers (high cost and space). >>> >>> I was thinking to convert the signal from the MCU to open-drain by a >>> simple transistor (the signals are mono-directional). However this >>> negates the logic, so I need to negate again on the destination PCB (or >>> in the firmware). >>> >>> What do you use as an affordable solution? >>> >> >> A meter with nominally the same grounds? That's nothing, especially if >> you have a signal ground in the D-Sub bundle as well. I'm still a big >> fan of never taking CPU pins straight to the connector for ESD reasons, >> but that's largely because if something is going to be my sacrificial >> part I'd like it to be something easily replaced. >> >> You could use the RS-232 translators MK recommended, but honestly I'd >> say even that's overkill. How about just cheap digital buffers? 74LVC >> family works great for either 3.3 or 5V logic, and in my experience is a >> very hard family to kill. Get something with a Schmitt trigger for the >> receive side. Lots of people sell 74LVC3G17; I tend to use the >> identical NL37WZ17 from On Semi. 3 buffers to a can for 9 cents. >> >> If you really did want to go with something more hardened, like an >> RS-485 differential-type thing, then since you're going from MCU to MCU >> I'd figure out how to communicate the same information by going faster >> over fewer wires. You could do a fully differential SPI link (MOSI, >> MISO, CLK, and CS) on 4 pairs + 1 ground = 9 wires and you're still in >> an D9. But again, probably overkill. > > I never bring anything outside the box without ESD protection. My favorite is Schottky diodes to the power and ground rails. Replacing any part on the board from ESD is a PITA. Compared to adding ESD diodes to each input *and* adding a buffer chip, seems like using an optoisolator on each input is not a big deal. >
If you really like, but the LVC logic (and most discrete logic) has ESD diodes to those same rails already. http://www.ti.com/lit/ds/symlink/sn74lvc3g17.pdf gives 2kV human-body and 1kV charged device for any pin. It's been a good long while since I've seen any CMOS parts without inherent ESD protection, just for the manufacturing process, outside of screamingly high-speed stuff where every picofarad fraction counts. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix.