0
\$\begingroup\$

I am using Arduino to program my ATTiny85 like this.

I am trying to make a simple blink example, here's the code:

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

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

Connected to my programmer (which has a LED connected to pin 0) the LED flashes. When I plug it in to my circuit it does not work (the LED stays on.)

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Please tell me if the tags don't make sense (I am very new). \$\endgroup\$ – nedla2004 Aug 7 '17 at 2:34
  • 1
    \$\begingroup\$ A: Try changing the delay(1000) to delay(1). B: switch place with the HIGH and LOW in the code. If you can see that it blinks or is more dim after doing A then there's something wrong with the clock divider. If it still stays on after doing A then there's something else weird going on. If it still stays on after doing B then there's something wrong happening before it enters the loop part of the code. \$\endgroup\$ – Harry Svensson Aug 7 '17 at 3:46
  • 1
    \$\begingroup\$ Hi. Just edited the circuit for easy viewing. Have you tried adding 470nF cap to Gnd at the Reset pin? \$\endgroup\$ – Jason Han Aug 7 '17 at 5:11
  • 2
    \$\begingroup\$ When connected to my programmer it works, when I plug it into my circuit it doesn't work. From this line I'd be more inclined to say there is a mistake/error in your circuit as opposed to the ATTiny85 itself. \$\endgroup\$ – Doodle Aug 7 '17 at 7:49
  • 2
    \$\begingroup\$ @JasonHan he will read 5V. Otherwise the LED wouldn't light up. @ Nedla2004, if it stays on at full power for A and B then there's something else MUCH wrong. Take a picture of your setup. And what exactly are you using to upload to the ATTiny? (Is it an Arduino in programmer mode? Or an actual programmer?) Are you sure you're uploading to the ATTiny? \$\endgroup\$ – Harry Svensson Aug 7 '17 at 16:50
1
\$\begingroup\$

Connected to my programmer (which has a LED connected to pin 0) the LED flashes. When I plug it in to my circuit it does not work (the LED stays on.)

That alone tells you a lot about your problem. It suggest that your chip is successfully programmed and the issue is with your circuit.

\$\endgroup\$
  • \$\begingroup\$ @dannf I thought the same, but this circuit is quite simple, so I am 99% sure that my wiring is the same as the diagram above, which is why I added it above, but seeing as nobody has said anything about the circuit (except adding the 470nF cap), I think it should work. \$\endgroup\$ – nedla2004 Aug 7 '17 at 14:10
  • \$\begingroup\$ What you you use for a 5V source? Have you checked if the power is clean? \$\endgroup\$ – Dampmaskin Aug 7 '17 at 14:25
  • \$\begingroup\$ @dannyf I am actually using the programmer itself, as I know that works well. \$\endgroup\$ – nedla2004 Aug 7 '17 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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