1
\$\begingroup\$

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

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ There is alternative method that was in a now deleted answer, not sure why the author deleted it. It uses zener diodes at the controller's outputs to clip the voltage. Although this othter standard circuit on the V-USB website uses 3V6 zeners, I would personally use 3V3 zeners just to have a bit more head room to spare. \$\endgroup\$
    – jippie
    Jun 28, 2015 at 18:45
  • \$\begingroup\$ Something like the following? imgur.com/qOt7c1b \$\endgroup\$
    – rhbvkleef
    Jun 28, 2015 at 19:27
  • \$\begingroup\$ @rhbvkleef pretty much, yes. It is good practise to have positive power rail at the top and grond at the bottom: i.stack.imgur.com/IUCg0.gif (took the the image from the deleted answer). \$\endgroup\$
    – jippie
    Jun 28, 2015 at 20:06
  • \$\begingroup\$ Yeah... It was just the way I had the rest of the schematics set up why gnd is on top. Thank you very much! \$\endgroup\$
    – rhbvkleef
    Jun 28, 2015 at 20:33
0
\$\begingroup\$

the previous answer is correct but I wanted to throw my two cents in with a zener based output such as in schematic found here http://m.instructables.com/id/Digispark-DIY-The-smallest-USB-Arduino/?ALLSTEPS.

The 3.6V zeners keep the voltage at the D+ and D- lines from ever getting above 3.6 so then you can have 5V on the rest of your lines. The zeners also provide some degree of ESD protection to the line by conducting when the high voltage shock is apllied to the lines, safely carrying it to ground

It also has the advantage that you aren't counting on the tolerance stack up of two diodes in series but each diode individually.

Also I'm not sure if it was intentional but R1 and R3 in your schematic should be the same value.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.