Electronic – Will 3.3v to 5v level converter work with USB data lines

avrlevel-shiftingusb

I'm trying to design a low-speed USB device based on ATmega16a. That chip doesn't have any USB interface, but it is possible to use bit-banging and there are even ready-made libraries to do so, like V-USB. So the programming part is quite clear.

What is unclear, it is how to physically interface AVR to USB. The problem is, USB gives +5V, but uses 3.3V levels on data lines D+ and D- (which aren't always differential). The V-USB suggests two solutions: running a whole AVR at 3.3v (with two clamp diodes on 3V line) or making a lousy level converter by attaching two 3.6V zener diodes, to clamp voltage from AVR.

Low speed USB runs at 1.5MHz, so ATmega16A should run at 12 MHz. According to datasheet, it is not rated to work reliably at that frequency when powering from 3.3V, so I required to run it directly from 5V and the first option (with clamp diodes) is not available for me.

I've implemented this on a breadboard with zeners, so test circuit works. But I think this is not very robust solution, because data from USB to AVR could be on AVR 1-level margin. I think about using a bi-directional level converter, like txb0104.

This is my question: will level converter work for USB data lines? I want to figure out the way how to analyze timing parameters in the datasheet to ensure it will not screw USB signal timing too much.

Best Answer

How about using an isolator? I've used Analog Devices ADuM3160 for interfacing a 3.3V MCU board to a PC host. Works well if you don't need High Speed. Read through the "Power supply option" section, I think it is possible to drive this from a 5V MCU also.

enter image description here