Page 1 of 1

Isolation?

Posted: Sun Nov 20, 2011 2:08 pm
by eslavko
Hello...

In the past I fryed USB port with incorrect cabling of USB oscilloscope. Now I'm thinking (datalogger project) how to isolate USB bus.
The supply should be not problematic. some isolated DC/DC converters should do the job. But what about D+ and D-?
I thinking to use some optocouplers. And after that I have at least two solution.
1. For receive just put optocouplers in receive path and for transmitt use separate 2 pins (so 4 pins nedded for USB)
2. Use two pairs of optocoupler and DIRection signal. So 3 pins are needed.

... and optocoupler's have tendency to invert signals.. How much trouble is to do 'reinvert' in software? Should be easy for transmit but what for receive?

Any idea?

Re: Isolation?

Posted: Tue Nov 22, 2011 1:57 pm
by Micha
I doubt that it is as easy as you expect. What about the direction: how do you want to find out in which direction communication takes place? And what about the pullups/pulldowns/voltage levels and so on?

Therefore I'd suggest you to have a look on the following sites/products:
http://www.analog.com/en/interface/digi ... s/fca.html
http://www.analog.com/en/interface/digi ... oduct.html
http://www.analog.com/en/interface/digi ... oduct.html
http://www.analog.com/en/interface/digi ... oduct.html

Re: Isolation?

Posted: Tue Nov 22, 2011 5:42 pm
by eslavko
I had that isolator (commercialy made)
It's works with a lot of stuf but doesn't like some devices. Some usb key's doesn't work, Some mices doesn't work and all V-USB stuff doesn't work. I was tryed some other series and pullups but without success.

And I have VUSB thing in mind to isolate. And there I know when I got to transmit. So direction shouldn't be problematic.. Just spare pin. Seems that I should try (when I have some spare time :D )

Re: Isolation?

Posted: Tue Nov 22, 2011 6:31 pm
by Bob
What about not isolating AVR and instead isolate the inputs to your logger / oscilloscope etc ?

Re: Isolation?

Posted: Tue Nov 22, 2011 7:04 pm
by eslavko
Bob wrote:What about not isolating AVR and instead isolate the inputs to your logger / oscilloscope etc ?


That's not easy if the voltage have spectrum over few MHz. And my current project sample at 2GHz!

Re: Isolation?

Posted: Wed Nov 23, 2011 9:48 am
by Micha
And what about isolating the AVR from CPLD/FPGA/whatsoever?

Re: Isolation?

Posted: Wed Nov 23, 2011 11:47 am
by eslavko
I think the isolating 2 wires should be easyer than 24.... just need to try.

Re: Isolation?

Posted: Wed Nov 23, 2011 1:09 pm
by Micha
That's true. You can invert the optocoupler outputs by adding an additional transistor and a resistor. Maybe you can create a draft of your suggestions and we can have a look on it and comment it.

Re: Isolation?

Posted: Wed Nov 23, 2011 1:59 pm
by eslavko
Something like this...

Power supply and Rx/Tx control isn't isolated here http://slavko.kocjancic.eu/vusb.pdf

Re: Isolation?

Posted: Wed Nov 23, 2011 5:33 pm
by Micha
Hmm, maybe this could work. Don't forget pullups on the AVR side (depending on the optos you choose). But I think enumeration will be a problem as a 1k5 pullup has to be either on D- for low speed OR on D+ for full speed devices. No idea what happens when there's a pullup on each signal.

Re: Isolation?

Posted: Wed Nov 23, 2011 6:49 pm
by eslavko
The pullup for device recongnision to D- is not drawn.
The pullups shown was enabled only when AVR is in transmitt mode. When receiving there are actualy pulldown but diodes make that like Tristated. I'm afraid that USB lines are to weak to drive optocouplers (AVR in receive mode)

Re: Isolation?

Posted: Thu Nov 24, 2011 9:23 am
by Micha
You could add another (non-inverting) buffer that drives the LEDs of IC4. Or you connect R5 and R6 also to AVR_DIR and place a MOSFET which you drive with USB_D+/-.

Re: Isolation?

Posted: Thu Nov 24, 2011 2:46 pm
by eslavko
Micha wrote:You could add another (non-inverting) buffer that drives the LEDs of IC4. Or you connect R5 and R6 also to AVR_DIR and place a MOSFET which you drive with USB_D+/-.


R5 and R6 are already driven by AVR. Probably the USB bus can't sink or source enought current to drive LED directly so some buffer will be needed.

Re: Isolation?

Posted: Fri Nov 25, 2011 8:18 am
by Micha
eslavko wrote:
Micha wrote:You could add another (non-inverting) buffer that drives the LEDs of IC4. Or you connect R5 and R6 also to AVR_DIR and place a MOSFET which you drive with USB_D+/-.

R5 and R6 are already driven by AVR. Probably the USB bus can't sink or source enought current to drive LED directly so some buffer will be needed.

I know that they are already driven by the AVR. But you have an inverter (IC1) in there. If you connect the resistors directly to AVR_DIR you could use the inversion which is coming through driving the LEDs by a MOSFET. Something like: AVR_DIR -> R5.1/R5.2 -> LED.A/LED.C -> N-chan.D/N-chan.S -> USB-GND where N-chan.G is connected to USB_D+/- (.1/.2/.A/.C/.D/.S/.G are the corresponding pins of the components).

What are R1/R2/D1/D2 for? You also have to consider that many/most optocouplers have an open collector output and therefore need another pullup.

Re: Isolation?

Posted: Fri Nov 25, 2011 10:45 am
by eslavko
Micha wrote:
eslavko wrote:
Micha wrote:
What are R1/R2/D1/D2 for? You also have to consider that many/most optocouplers have an open collector output and therefore need another pullup.

That's are pullup as photocoupler are open collector. And diode asc as tristate switch when anode is low.

I will try that when I have little more spare time.