0
\$\begingroup\$

I flashed a simple led blink program to an attiny2313 with a usbasp type programmer. Avrdude confirmed that the chip was programed, but the led is not blinking.

I tried switching the led, varying the resistor and double checking the wiring. I've also tried a few other led blink programs for this chip and the circuits that went with them. I can't get the program to work. Avrdude says it was written and confirmed, but the led does not blink.

I occasionally get a 'first bit does not match 0xff not 0xdf' when changing fuses. They are all on default currently. I sometimes got a similar error at the end of the programming but with the values 0x00 and 0x0c instead, but even this error has not come up recently.

The program blinks pin PD6. Here is a picture of my circuit. The unplugged pin is the 3.3 volt connection I replaced it with the brown 5 volt wire.

the brown wire is the 5 volts I'm using instead of the 3.3 volts

\$\endgroup\$
  • 1
    \$\begingroup\$ Decoupling decoupling decoupling. \$\endgroup\$ – Ignacio Vazquez-Abrams Apr 28 '15 at 1:58
  • \$\begingroup\$ Is your pull-up resistor on the Reset pin properly wired to VCC? I looks like it is going into row 6 of the breadboard, but I don't see anything connecting that to the +5V line. \$\endgroup\$ – Tom Carpenter Apr 28 '15 at 2:25
  • \$\begingroup\$ You need to add a ceramic 0.1uF capacitor, with very short leads, directly between the VCC power supply and GND pins, right at the chip. This bypass capacitor is a normal requirement for virtually every IC, on every power supply. Bypassing is needed to make the VCC supply behave like it should, especially on a solderless breadboard. Otherwise, every time any of the signals inside the chip gets switched, the long wires and inductance of the breadboard cause VCC and GND to dip and sag and perhaps overshoot. \$\endgroup\$ – MarkU Apr 28 '15 at 7:13
  • \$\begingroup\$ This is a better explanation of the need for decoupling capacitors: electronics.stackexchange.com/a/17128/35022 \$\endgroup\$ – MarkU Apr 28 '15 at 7:15
1
\$\begingroup\$

It turned out the problem was how I compiled the C code to hex. This website has simple and very clear instructions for how to do so on a mac. How to AVR with OSX

\$\endgroup\$

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.