2

I currently try to program an Attiny45 with an Arduino UNO as ISP.

The Arduino is able to program the Attiny45.

However, when I try the blink example, it resets the Attiny, when setting digitalOutput to low (on any pin)

To further confirm, that it resets only, when setting a pin to low, I wrote this sketch and let it run on the Attiny.

void setup() {
  pinMode(3, OUTPUT);
}

void loop() {
  delay(1000);
  digitalWrite(3, HIGH);
  delay(1000);
  digitalWrite(3, LOW);
  delay(10000);
  digitalWrite(3, HIGH);
  delay(1000);
  digitalWrite(3, LOW);
}

The LED I connected to pin 3 waits 1 second, and then turns on, but when 1 second passed and it should stay off for 10 seconds, it resets and only waits 1 second.

I tried reburning the bootloader onto the Attiny, which had no effect.

10
  • 2
    Could you show the wiring diagram? Commented Oct 28, 2016 at 17:11
  • I follwed these instructions Commented Oct 28, 2016 at 18:04
  • 2
    Including the 220Ω resistor with the LED as in the last step?
    – Majenko
    Commented Oct 28, 2016 at 18:19
  • 2
    That would be a very special LED then, if it can handle 5V without a resistor.
    – Gerben
    Commented Oct 28, 2016 at 18:26
  • 2
    "Can handle" and "Is designed to work with" are two very different things. Chances are it can't handle it, but it's not getting it. Instead it is causing massive power droop from over current making the BOD trigger in the ATTiny.
    – Majenko
    Commented Oct 28, 2016 at 18:28

1 Answer 1

3

Including the 220Ω resistor with the LED as in the last step?

...

My LED can handle 5V, so I used it without, but that cant be the issue

The one thing that "can't be the issue" is indeed the issue! Without a resistor the LED will attempt to conduct a lot of current which will damage both it and the output pin of the processor.

See The care and feeding of LEDs. From that page:

LEDs are not like normally electronic devices in that you can’t just apply a voltage to them and they work, they have to be fed the correct voltage and current to keep them happy.

And then:

There are several web sites and schematics on the web that suggest you can attach an LED directly to an Arduino output pin with no current limiting resistor. They are wrong, and following them will damage your Arduino.


So, by not using a resistor, when the output pin goes LOW it attempts to "sink" current, in order to turn on the LED. Since you have no resistor, it sinks as much as the output drivers can handle, dropping the supply voltage inside the Attiny, which then goes below the brownout level, and resets itself.

Please, when following a circuit, don't just omit bits of it, and then post a question about why it doesn't work. At least follow the circuit exactly, and then when you have learned more about electronics, you can start experimenting.

4
  • Where am I supposed to ask if not on a forum ment for it? Commented Oct 30, 2016 at 19:54
  • I searched more than enough times, so I think me asking would be totally valid. Commented Oct 30, 2016 at 19:55
  • I didn't say to not ask here, I said to follow the instructions first. You said "I followed these instructions" but you didn't. You left out part of them (the resistor). Nor did you say that in your question. You might have said "I followed the instructions but omitted the resistor which I didn't think was important".
    – Nick Gammon
    Commented Oct 30, 2016 at 20:48
  • Ok, that made more sense, then sorry if I seemed a little aggressive, and thank you :) Commented Nov 8, 2016 at 20:28

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.