Isolation?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Isolation?

Post by eslavko » Sun Nov 20, 2011 2:08 pm

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?

Micha

Re: Isolation?

Post by Micha » Tue Nov 22, 2011 1:57 pm

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

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Tue Nov 22, 2011 5:42 pm

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 )

Bob
Posts: 17
Joined: Sun Jun 10, 2007 7:10 pm
Location: Melbourne

Re: Isolation?

Post by Bob » Tue Nov 22, 2011 6:31 pm

What about not isolating AVR and instead isolate the inputs to your logger / oscilloscope etc ?

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Tue Nov 22, 2011 7:04 pm

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!

Micha

Re: Isolation?

Post by Micha » Wed Nov 23, 2011 9:48 am

And what about isolating the AVR from CPLD/FPGA/whatsoever?

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Wed Nov 23, 2011 11:47 am

I think the isolating 2 wires should be easyer than 24.... just need to try.

Micha

Re: Isolation?

Post by Micha » Wed Nov 23, 2011 1:09 pm

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.

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Wed Nov 23, 2011 1:59 pm

Something like this...

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

Micha

Re: Isolation?

Post by Micha » Wed Nov 23, 2011 5:33 pm

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.

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Wed Nov 23, 2011 6:49 pm

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)

Micha

Re: Isolation?

Post by Micha » Thu Nov 24, 2011 9:23 am

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+/-.

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Thu Nov 24, 2011 2:46 pm

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.

Micha

Re: Isolation?

Post by Micha » Fri Nov 25, 2011 8:18 am

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.

eslavko
Rank 1
Rank 1
Posts: 36
Joined: Sat Dec 18, 2010 6:37 pm

Re: Isolation?

Post by eslavko » Fri Nov 25, 2011 10:45 am

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.

Post Reply