1
\$\begingroup\$

In my project I need all available pins on my Digispark. Pin PB4 is connected to a 68 Ω resistor and a 3.6 Zener diode.

enter image description here

This pin is used for USB protocol. This means that at some point in time the ATtiny is "writing" to this pin (meaning it is pulling it high). As a consequence the current drawn will be (5 - 3.6) / 68 = 20.5 mA. This is very close to the maximum allowed although it seems it is supported by the chip.

I want to drive this pin (with digitalWrite) high for an unspecified period of time(could be 5 minutes or 1 h). Would this damage my board?

\$\endgroup\$
4
  • \$\begingroup\$ Your calculations are not realistic, as they do not take into account that the AVR output pin would not have 5V when sourcing 20mA, but more like 4.5V, as it has about 20-30 ohms internal impedance. Also the zener diode would not clamp exactly to 3.6V. The BZT52 diode zener voltage is tested at 5mA, and since the current can be estimated to be larger than 5mA, the voltage is also higher than 3.6V. Can you measure the voltage over the 68 ohm resistor to know the current? It also seems that the USB data pin voltage can easily exceed 3.6V, I would not connect this to my PCs. \$\endgroup\$
    – Justme
    Commented Mar 15, 2020 at 21:09
  • \$\begingroup\$ I can't measure anything because I am not sure if i build it, it won't fry the board. The ideea is that the pin is sourcing approximately 20 mA. Is this current so high that could fry it? I mean it already does that with the USB protocol \$\endgroup\$ Commented Mar 15, 2020 at 21:19
  • \$\begingroup\$ What do you connect to it, and do you still need the USB? \$\endgroup\$
    – Justme
    Commented Mar 15, 2020 at 21:21
  • \$\begingroup\$ No. The usb is only used by the bootloader on startup..or on programming. I am making a comparison between what the USB wiring does(drawing 20mA) and what I intend to do (which is also to draw 20mA) and asking if my calculation is right and if it would be alright to continue with my plan \$\endgroup\$ Commented Mar 15, 2020 at 21:35

1 Answer 1

1
\$\begingroup\$

The IO pin has absolute maximum rating of 40mA. The digital output voltage rating is listed at 10mA current, which basically tells the drive strength. But pins are not guaranteed to source current greater than the listed condition. However, the characterisric curve shows output voltage vs output current up to 20mA.

So basically, the pin should typically be able to source 20mA at about 4.5V, but they don't guarantee that it can source over 10mA.

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