Useless Pin 5 in all Digispark ATtiny85 boards? [SOLVED]

Hi everyone,

Pin 5 on Digispark Attiny85 boards are supposed to be an input/output since it is marked as D5/A0 but my question is:

Is this pin wired to the reset pin (1) of the ATtiny85 microcontroller? Why is it labeled as D5/A0 if it can not be used for nothing more than resetting the Arduino? How could I use it as a regular digital input without resetting the board?

This is a stupid question but after checking the schematic I am kinda confused...

Thank you in advance.

(deleted)

spycatcher2k:
Can you link the schematic you are refering to, It's available to use on all my Digisparks.

Hi,

Here's the schematic:

In addition to that, look at this warning regarding Pin 5:

The thing is that I have 2 Digispark ATtiny85boards and yeah, if I connect P5 to GND my board does reset... How would I be able to, let's say, connect a tactile switch to P5 in order to switch something ON/OFF or do something else by software?

Thanks in advance.

1 Like

(deleted)

spycatcher2k:
Ah - I see where your confusion is. The Digispark has it fuses set to disable the reset and use it as a GPIO.

But disabling the reset will make it impossible to upload a new sketch after that, right? (without the high voltage programmer, I mean).

"High Voltage" just means a 12V pulse is needed.

Nick Gammon has a nice page on it here

(deleted)

spycatcher2k:
The Digispark has a USB bootloader on it - Use that to upload. This information is all on the Digispark site!

Yes, I am currently uploading it that way, no problem. I meant that if I disable the reset pin, as far as I know, I will need that high voltage programmer to be able to upload a new sketch since the regular method won't work anymore...

disabling the reset will make it impossible to upload a new sketch after that, right?

No, the digispark has a bootloader that will upload sketches without needing a hardware reset.
Presumably that relatively easy since it doesn't simultaneously support a COM port over USB.
(A COM port would have to be transparent; a "native USB device" can just define an additional command "time to upload a new sketch.)

1 Like

westfw:
No, the digispark has a bootloader that will upload sketches without needing a hardware reset.
Presumably that relatively easy since it doesn't simultaneously support a COM port over USB.
(A COM port would have to be transparent; a "native USB device" can just define an additional command "time to upload a new sketch.)

I did not know that, thank you!

PD: In case it helps anyone in the future, here's how I did it in the end:

I just needed that pin to read the state of a tactile switch and I did not want to disable the reset.

I configured pin 5 as an analog input pinMode(A0, INPUT) and with a simple voltage divider and if(analogRead(A0) < 930) I was able to tell when the button is pressed.

I attached the schematic.

When the button is not pressed it should read 1023 and around 860 when it's pressed, so around 930 is a threshold that worked for me. It's important not to go much below that to avoid resetting the Arduino.

Thank you for your help!