rs-232 gavalnic isolation

Ok! I believe it is part of Spice simulator which I unfortunately don't know. The diode G1 and the cap C1 are no real parts but the equivalent circuit around Q1, isn't it?

Joer

Reply to
Joer Breton
Loading thread data ...

I've posted a Linear Tech Switcher Cad file on alt.binaries.schematics.electronic.

It's an opto-based data coupler that works to several hundred kbps. The circuit, as is, takes a lot of drive, but with a little modification (adding another transistor) it could be made to be much more sensitive. SWCAD doesn't have a 4N36 so I used a 4N28.

As others have posted, one of the problems is that if the collector of the opto-couple swings around then you get hurt by the Miller effect. This circuit keeps the collector voltage swing to a minimum. It's interesting to see the effect of increasing the opto's collector resistor. The Miller effect can cleary be seen -- even when the collector resistor is changed from 1ohm to 100ohms.

Care must be taken to insure that the base of the PNP is not overdriven, but it shouldn't be too much of a concern if the maximum current into the led is limited.

Another thing to watch is that the circuit truly follows the input data. It's easy to get fooled with simple 1-0-1-0 data pattern. Unfortunately, this is the pattern that is supplied with this schematic, as I couldn't find a source with random-type data. Look at the startup pattern to see if the circuit is working properly. Or, better yet, build a true data generator.

Bob

Reply to
Bob

Yes, you are right. G1, C1 and Q1 are all part of the simulation. Here's the schematic again for reference:

formatting link

Some optocouplers have a diode feeding a transistor, but in this case, the detector is actually a phototransistor with light shining on the base. The area of the junction is quite large, so the capacitance to the collector is high.

Operating the transistor as an emitter follower eliminates Miller effect, so all we have to deal with is the charge in the base. The negative feedback from Q3 ensures this is just enough for circuit operation.

I made a slight typo in describing the transistor turnon, which you probably figured out. It should read:

"Transistor Q3 turns on a bit later than Q2 and clamps any excessive diode current to ground."

You can increase R5 and R6 to improve the sensitivity if needed. The values and ratios are not very critical. I'd stay below 2k total for fastest response. You can also increase R4 if you are driving a light load. This would allow a larger emitter resistance and reduce the drive level even further. Actually, this circuit is one of the least critical I have ever seen. It is really hard to optimize. You can make large changes to the values, and nothing much happens to the output. Just about any transistor you find in your junkbox should work. Use the fastest for Q2.

One way to check the operation is to start with a low current into the LED and monitor the collector voltage on Q2. Find the current needed to bring the voltage to about 0.7V, then triple or quadruple it. That should give you pretty fast response with minimum drive current.

Let me know if you have any problems, and what results you get. Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

OK, Joer, it's a bit fiddly but I got it down to 500ns prop delay with 1mA drive. That puts it in the 6N136 class at 1/16 the drive current.

Now's a good time for you to start learning SPICE. You can get LtSpice here. Never mind registering, just do the download. It's about 6 or 8 meg so it may take a while on dialup.

formatting link

Here's the SPICE file. You can cut between the "***" and paste into any ASCII editor. Save with the extension "ASC". After you install LtSpice, make a new directory in the SWCADIII/Examples folder and put it there. Use the standard file open command to load it. Click on the little running man in the toolbar to run the analysis. It will ask you what waveforms to display - hold the Ctrl key down and click on I(R4), V(q1c), V(q2c) then click OK. That's all there is to it. It will do the analysis and show the waveforms at those places in the schematic. You can learn SPICE a bit at a time, and there are plenty of people in the newsgroups who are willing to help. So it is very much worth the effort to download the program and try it on this circuit.

The LtSpice optocoupler is a 4N28. This has 10% CTR where the 4N36 is 100%. This means the current through R4 has to be set to 10 times the current that is needed by the 4N36.

Notice that a bias resistor of 220k has been added to the base of Q1. This biases the detector base at 1.5V to eliminate an extra delay on the first pulse while the base charges up from zero volts. You may not need this depending on your data rate. 115K baud shouldn't need it.

Notice the reference designations in the LtSpice file are different from the earlier Microcap schematic. Sorry about that.

*** Version 4 SHEET 1 880 680 WIRE 16 -208 -96 -208 WIRE 224 -208 16 -208 WIRE 16 -192 16 -208 WIRE 224 -192 224 -208 WIRE 16 -96 16 -112 WIRE -464 -80 -560 -80 WIRE -320 -80 -384 -80 WIRE -96 -80 -96 -208 WIRE -96 -80 -128 -80 WIRE 224 -80 224 -112 WIRE 336 -80 224 -80 WIRE -560 -64 -560 -80 WIRE 224 -64 224 -80 WIRE 336 -48 336 -80 WIRE 80 -16 -128 -16 WIRE 128 -16 80 -16 WIRE 160 -16 128 -16 WIRE 80 0 80 -16 WIRE -320 16 -560 16 WIRE -96 16 -128 16 WIRE -560 32 -560 16 WIRE 336 48 336 16 WIRE 224 64 224 32 WIRE -336 80 -368 80 WIRE -96 80 -96 16 WIRE -96 80 -256 80 WIRE 80 112 80 80 WIRE 80 112 -192 112 WIRE -368 128 -368 80 WIRE -96 144 -96 80 WIRE -96 144 -112 144 WIRE -48 144 -96 144 WIRE 0 144 -48 144 WIRE 80 160 80 112 WIRE -192 192 -192 112 WIRE -176 192 -192 192 WIRE -368 224 -368 208 WIRE -112 272 -112 240 WIRE 0 272 0 208 WIRE 80 272 80 240 FLAG -560 32 0 FLAG 224 64 0 FLAG -112 272 0 FLAG 80 272 0 FLAG 336 -80 Q1C FLAG 128 -16 Q1B FLAG -560 -80 Vin FLAG 336 48 0 FLAG -48 144 Q2C FLAG 0 272 0 FLAG 16 -96 0 FLAG -368 224 0 SYMBOL Optos\\\\4N28 -224 -16 R0 SYMATTR InstName U1 SYMBOL res 208 -208 R0 SYMATTR InstName R2 SYMATTR Value 1k SYMBOL voltage 16 -208 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 WINDOW 0 42 27 Left 0 WINDOW 3 39 58 Left 0 SYMATTR InstName V1 SYMATTR Value 11.5 SYMBOL voltage -560 -80 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 WINDOW 3 -75 390 Left 0 SYMATTR Value PULSE(0 10.75 0 50e-9 50e-9 2.5e-6 5e-6 200) SYMATTR InstName V2 SYMBOL res -480 -64 R270 WINDOW 0 32 56 VTop 0 WINDOW 3 0 56 VBottom 0 SYMATTR InstName R4 SYMATTR Value 1k SYMBOL NPN 160 -64 R0 SYMATTR InstName Q1 SYMATTR Value 2N2369 SYMBOL NPN -176 144 R0 SYMATTR InstName Q2 SYMATTR Value 2N2222 SYMBOL res 64 -16 R0 SYMATTR InstName R1 SYMATTR Value 200 SYMBOL res 64 144 R0 SYMATTR InstName R3 SYMATTR Value 680 SYMBOL cap 320 -48 R0 SYMATTR InstName C1 SYMATTR Value 30pf SYMBOL cap -16 144 R0 WINDOW 3 31 53 Left 0 SYMATTR InstName C2 SYMATTR Value 5pf SYMBOL VOLTAGE -368 112 R0 WINDOW 0 39 36 Left 0 WINDOW 3 31 79 Left 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V3 SYMATTR Value 1.5V SYMBOL res -240 64 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R5 SYMATTR Value 220k TEXT -634 258 Left 0 !.tran 1e-5 *** Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

Jim Thompson wrote:

...Jim Thompson Jim,

I'm including a LtSpice version using a 4N28 with a CTR of 10% and 19mA driving the LED. The 4N36 is very similar except it has a CTR of 100%, so it should produce the same result with a drive level of 2 mA.

The best response for the 4N28/36 is 2uS using an unspecified base resistance and a 100 ohm load. (See fig. 20)

formatting link

This would require at least 7mA LED current to a 4N36 to get enough output to drive an external transistor. This exceeds Joer's budget of 5 mA.

Using the clamp feedback improves things considerably. The attached LtSpice simulation indicates a response in the region of 200nS, with a LED current of 2mA to a 4N36.

This speed is comparable to the 6N136, but that device requires 16 mA to drive the LED. So the clamp feedback improves the response time by about a factor of ten, and reduces the required drive current to the LED by a factor of 3 or 8, depending on which device you compare it to.

One thing that is not shown in the datasheets or the app notes is the tremendous variation in response time with small changes in drive level. You can see this easily in SPICE.

So the only way to guarantee operation is to set the initial level high enough to account for the degredation in LED output over time, plus the normal variations in temperature and components. But this means heavily overdriving the optocoupler, which drastically slows the turnoff response time.

This is where the clamp transistor really improves things. Not only does it improve the response time and reduce the needed LED drive current, it makes the overall response much less sensitive to variations in drive level and component tolerances. And the LED will probably last much longer operating at a lower current. This is definitely worth investigating if you have any plans to use optocouplers. Here's the LtSpice file:

Version 4 SHEET 1 880 680 WIRE 16 -208 -96 -208 WIRE 288 -208 16 -208 WIRE 16 -192 16 -208 WIRE 288 -192 288 -208 WIRE 16 -96 16 -112 WIRE -416 -80 -480 -80 WIRE -320 -80 -336 -80 WIRE -96 -80 -96 -208 WIRE -96 -80 -128 -80 WIRE 288 -80 288 -112 WIRE 384 -80 288 -80 WIRE -480 -64 -480 -80 WIRE 288 -64 288 -80 WIRE 384 -48 384 -80 WIRE 80 -16 -128 -16 WIRE 224 -16 80 -16 WIRE 80 0 80 -16 WIRE -320 16 -480 16 WIRE -96 16 -128 16 WIRE -480 32 -480 16 WIRE 384 48 384 16 WIRE 288 64 288 32 WIRE -336 80 -368 80 WIRE -96 80 -96 16 WIRE -96 80 -256 80 WIRE 80 112 80 80 WIRE 80 112 -192 112 WIRE -368 128 -368 80 WIRE -96 144 -96 80 WIRE -96 144 -112 144 WIRE -48 144 -96 144 WIRE 0 144 -48 144 WIRE 80 160 80 112 WIRE -192 192 -192 112 WIRE -176 192 -192 192 WIRE -368 224 -368 208 WIRE -112 272 -112 240 WIRE 0 272 0 208 WIRE 80 272 80 240 FLAG -480 32 0 FLAG 288 64 0 FLAG -112 272 0 FLAG 80 272 0 FLAG 384 -80 Q1C FLAG 80 -16 Q1B FLAG -480 -80 Vin FLAG 384 48 0 FLAG -48 144 Q2C FLAG 0 272 0 FLAG 16 -96 0 FLAG -368 224 0 SYMBOL Optos\\\\4N28 -224 -16 R0 SYMATTR InstName U1 SYMBOL res 272 -208 R0 SYMATTR InstName R2 SYMATTR Value 1k SYMBOL voltage 16 -208 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 WINDOW 0 42 27 Left 0 WINDOW 3 39 58 Left 0 SYMATTR InstName V1 SYMATTR Value 11.5 SYMBOL voltage -480 -80 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 WINDOW 3 -75 390 Left 0 SYMATTR Value PULSE(0 10.75 0 50e-9 50e-9 2.5e-6 5e-6 200) SYMATTR InstName V2 SYMBOL res -432 -64 R270 WINDOW 0 32 56 VTop 0 WINDOW 3 0 56 VBottom 0 SYMATTR InstName R4 SYMATTR Value 540 SYMBOL NPN 224 -64 R0 SYMATTR InstName Q1 SYMATTR Value 2N2369 SYMBOL NPN -176 144 R0 SYMATTR InstName Q2 SYMATTR Value 2N2222 SYMBOL res 64 -16 R0 SYMATTR InstName R1 SYMATTR Value 200 SYMBOL res 64 144 R0 SYMATTR InstName R3 SYMATTR Value 750 SYMBOL cap 368 -48 R0 SYMATTR InstName C1 SYMATTR Value 30pf SYMBOL cap -16 144 R0 WINDOW 3 31 53 Left 0 SYMATTR Value 5pf SYMATTR InstName C2 SYMBOL VOLTAGE -368 112 R0 WINDOW 0 39 36 Left 0 WINDOW 3 31 79 Left 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V3 SYMATTR Value 1.5V SYMBOL res -240 64 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R5 SYMATTR Value 220k TEXT -554 274 Left 0 !.tran 1e-5

Here's the PLT file. Watch the wrap on the 5th line:

[Transient Analysis] { Npanes: 1 { traces: 3 {524290,0,"V(q2c)"} {524291,0,"V(q1c)"} {34603012,1,"I(R4)"} X: ('µ',0,0,1e-006,1e-005) Y[0]: (' ',0,0,1,12) Y[1]: ('m',0,-0.001,0.001,0.011) Volts: (' ',0,0,0,0,1,12) Amps: ('m',0,0,0,-0.001,0.001,0.01) Log: 0 0 0 GridStyle: 1 } }

Please let me know if you have any problems with these files.

Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

I'll let you know, Mike. In the mean time, I have to change the MAX232 in the client project with a MAX232A. I can see the rise/fall time out the MAX232 is a bit slow, about

5uS. While the rise/fall time from the computer or my USB-serial dongle is razor-sharp. Ironically, for the moment, I'm using two miniature 600 ohm transformers for phone stuff (with only two 1K limiting resistors) as pulse transformers for a RS-232 isolator and... it works from 9600baud to 115Kbaud. I tried this configuration just to see what happened and I couldn't believe the result. But there is a catch, speed lower than 9600 baud and break signal can't pass through. This is why I need this opto version.

Joer

Reply to
Joer Breton

OK, I'll be here.

I'm not familiar with those chips, but doesn't RS-232 have a slew rate control? The digital logic signal should be fast, but not the cable I/O.

USB is a very different interface. It needs to be fast.

OK, let me know when you are ready. Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

Not true. It has slew rate control also... see my patents.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

USB 2.0 at 480MB/sec is slow?

The risetime spec is > 500ps:

formatting link

That is very different from 5uS on RS-232. About 10,000 times faster:) Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

The USB 1.0 "High Speed" has slew rate control... repeating myself, see my patents.

Actually they all do, including the 1.5Gb SATA I'm presently designing ;-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

...Jim Thompson Edge control is not really needed. Just pass the signal through a few feet of cable and it will strip the high frequencies and slow the risetime. That's why we have so much trouble probing fast signals on a pcb. RG-174U doesn't work very well. RG-58 is better, but the cable still has to be short.

If you are running data at 1.5Gb/s, the edges have to be fast. So the I/O cable can't be very long for the same reason. Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

Mike, You're getting as obstinate as Eeyore. Read the f...ing spec. The CMOS I work in CAN deliver AMPS... it must be controlled.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

Serial ATA? Amps? Surely not into the I/O cable. What you do for ground bounce on the logic side has nothing to do with the topic.

The spec is $25.00:

formatting link
I don't need it that bad. Anyway, you are the one who that claimed USB wasn't fast:

Slew rate control or no, the USB edges are 500ps, and that is fast compared to RS-232. And that's what we were talking about. So don't start comparing me to others.

Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

Joer,

I like to use Schmitt Trigger output optoisolators, like the H11L1M. Data rate 1 MHz typical (NRZ). The H11L series come in 3 different drive levels, the H11L1 needs just 1.6mA to turn on. With the Schmitt Trigger output, you either get a clean, glitch-free signal or you get nothing. They're available at Digikey, Mouser, Jameco, etc. A data sheet can be found -

formatting link

Reply to
Subhead

The switching speed table on page 3 says Ton is 1uS typical, 4uS max. Toff is 2uS typical, 4uS max. The conditions for worst-case are not given so they could be anything.

There is no way to reach 1MHz as claimed in the spec, and it would have problems doing 117kbaud if you happen to be at the high end of the range.

Can't depend on achieving "typical" numbers. Make sure your system works with worst-case numbers, and you might be lucky and actually get it to run:) Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

If you don't control the slew, you pull amps, and THEN you bounce.

Did you forget you claimed no slew rate control?

There you go again ;-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

I don't know if are still monitoring this thread but... my result are quite good actually. I can now go up to almost 57600. I say almost because I reduce the speed to about 50000 to get error free transmission. This is a two fold increase in speed, not bad at all. However

115K seems to be out of range. In the mean time, a friend of mine gave me two HCPL2300 that easily do 115K with less extra hardware, but 10x more expensive if I had to buy them. Needless to say this experiment was instructive.

Best regards! Joer

Reply to
Joer Breton

Hi Joer, I've been offline for a while. Thanks for the information. I'd expect a bit of trimming should improve the speed, but you need SPICE to tell you what is going on. Anyway, now that you got high-speed devices for nothing, you can wait until the next time you need fast optocouplers:)

Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

How is that? Say you are driving a 50 ohm coax with no discontinuities, and you have a 3 volt swing. The maximum current is 3 / 50 = 0.06A = 60mA. I don't know what the actual swing is on SATA, but if it is lower, or the cable impedance is higher, the current will also be lower.

If you do have to cope with poor control over the cable impedance, just give it two separate grounds. One for the cable driver, the other for the logic.

Still, the system has to be pretty clean to run at 1.5GHz. If you have any discontinuities, you will have trouble with reflections that can cause pattern-sensitive bit shift. This can produce data errors that are difficult to track down.

So you have to control the impedance, which also limits any ground bounce.

Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

I most certainly did not.

I said RS-232 has slew rate control, and that explains the 5uS risetime Joer measured. He also looked at his USB cable, and found the edges were much faster.

All I said was that USB was faster. Obviously, it has to be, since it has much higher data rates. 480 Mb/sec against 115kb/sec.

I said nothing about slew rate control on USB.

Here is the text:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In the mean time, I have to change the MAX232 in the client > project with a MAX232A. I can see the rise/fall time out the > MAX232 is a bit slow, about 5uS. While the rise/fall time from the > computer or my USB-serial dongle is razor-sharp.

I'm not familiar with those chips, but doesn't RS-232 have a slew rate control? The digital logic signal should be fast, but not the cable I/O.

USB is a very different interface. It needs to be fast.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So your complaint is simply poor reading and jumping to conclusions. Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

Reply to
Mike Monett

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.