Electronic – arduino – AtTiny84 with USB

arduinoattinyserialusb

I am having some problems with the ATTiny84 and USB. I am creating an "arduino clone" but I want a simple (and especially compact on the board) way to implement a USB serial interface. This will only be used for a slightly modified version of firmata.

enter image description here

I am having problems with the signal lines on the USB connection (which apparently have to be 3v3?). I have already created a schematic. (see picture) and I wanted to see if this is correct. The USB part is in a rectangle. I haven't really found any good documentation on this. The documentation I have found looks like the following:

enter image description here

This seems incorrect to me if the USB data lines require 3v3. or is this correct and can I hook it up this way to the attiny84 as well?

PS. I am an absolute electronics n00b so dont pick too hard on my mistakes…

Best Answer

The two diodes in the lower circuit drop 2 × 0.7V = 1.4V Given the USB bus delivers 5V, the power supply rail of the ATtiny will be at 5V - 1.4V = 3.6V. This effectively limits the controller outputs to 3.6V.

USB data lines are spec'd at 2V8 ~ 3V6 (HIGH). The USB power rail is spec'd up to 4V75 ~ 5V25. Which means that the above is just marginally OK at best and in practice the USB power supply voltage is just below 5V. Also I didn't account for the diode voltage that may be just slightly lower than the intended 0V7. Although it is marginally OK, in practice it works just fine. I have a similar circuit on my bench and has been working for ages.

The diodes on my bench USB keyboard drop 0.7094V and 0.7155V, but I didn't do any effort to reduce current or whatever. Your mileage may vary.

The problem with the top circuit is that the resistors will load the data lines. And depending on the power supply voltage and the signal level on the data lines it may just work, but personally I'm not too sure about it. I have no experience with that architecture, in contrast to the other one.