Trying to programme ATTiny 85 [SOLVED]

I have attempted to programme my ATTiny 85 with Arduino and it is not working.
I have done the following:
Downloaded and installed the ATTiny boards by David A. Mellis
Uploaded the ArduinoISP sketch – compiled and uploaded fine.
I connected up the ATTiny 85 as follows:
Arduino pin ATTiny 85 Pin
5V Pin 8
GND Pin 4
Pin 13 Pin 7
Pin 12 Pin 6
Pin 11 Pin 5
Pin 10 Pin 1
Opened up the Blink sketch changed to Digital Pin 0 from LED_BUILTIN
Changed programmer to Arduino as ISP
Uploaded Blink sketch – compiled and uploaded fine.
Connected LED up to digital pin 0 – Nothing.
Stripped and wired up ATTiny 85 with LED – Nothing.
Even without the ATTiny 85 connected the Blink sketch compiles and uploads fine
Tried to upload sketch without ATTiny 85 connected just to check – no issues
Tried to burn bootloader, error, see below:
avrdude: Error: Could not find USBtiny device (0x2341/0x49)
Failed chip erase: uploading error: exit status 1
I cannot figure out what I am doing wrong, any help would be much appreciated

You must do it via "Upload with programmer" menu command rather than regular Upload button.

Many thanks for your reply, I have just tried that and get the same error as when I tried to burn bootloader:

Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

avrdude: Error: Could not find USBtiny device (0x2341/0x49)
Failed programming: uploading error: exit status 1

The most probable cause of this is wrong or unreliable connection.
Could you show the photo of your setup?

I've had good luck using the USBasp board. It is not clear what programming board you are trying to use.



This is my setup, I though my programming board would work from the USB but it turns out I need to to the same in terms of wiring so thought I'd dispense with the board.

I have tried new jumpers and still get the same error message! Also, the breadboard is new.

You need a 100nF capacitor across the power pins of the ATtiny85 and as close as possible to the chip itself. This is not shown in your picture and may not be your only problem.

2 Likes

Did you use a resistor as well...??? You may have cooked the chip otherwise.

You do know physical pin5 is actually pin 0 in the program ( which you haven't shown)

10uF capacitor on the reset on the Arduino and ground...????

I followed a Youtube video to the letter, I have just rewatched it to confirm and he had no capacitor. I only have a 100 microfarad capacitor and a couple of bead capacitors of which I don't know the size. Does it need to be a polarised capacitor and I take it I just connect between 5V & GND? Is it likely that I have fried the ATTiny by not using a capacitor? What other problem do you envisage?

A capacitor is desirable, but it is unlikely to be the cause of the error. I have flashed many chips with ISP and never installed a capacitor.
I think the problem is elsewhere.

Do you mean using a resistor with the LED? If so yes I did, and it was connected to physical pin 5. I never used a capacitor and I don't have one that small at the moment. How can I tell if my Chip is fried?

OK. You have now seen two different points of view. The issue is decoupling What is the Use of a Decoupling Capacitor? | Sierra Circuits. Sometimes you get away with out it but it is good practise to ensure stability and certainly worth trying if you are having problems.
In this case a 100nF (or thereabouts) ceramic capacitor, which is non-polarised, is very common. It is very unlikely that a missing decoupling capacitor will have damaged your Attiny85.
Anyone can author Youtube videos irrespective of their knowledge of the topic.

Are you are still getting this error ?

Is the ATtiny85 factory fresh from a reliable distributer (Mouser, Digikey etc.) or has it since been used elsewhere ?

Yes still getting the same error. The ATtiny85 was new, bought from eBay, maybe that's the issue. I will order some capacitors and look at a new ATTiny as well. How do you know if the ATTiny85 needs the bootloader burned?

You should use attinycore by Spence Konde instead….

This means that your “arduino as isp” programmer setting has become unset…

Do I need to uninstall the ATTiny boards first?

You are not at that stage yet while you are still getting that error. Hopefully later that will be cleared then you will use the "Burn Bootloader" option as a once off activity to configure the ATtiny85 for compatibility with the Arduio development environment. It sets fuses (configuration parameters) but, in the case of the ATtiny85, will not actually burn a bootloader. Or, at least I think that is the case with David A. Mellis core. This, incidentally, is quite ancient and more up to date is this: GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8 by @drazzy (as @westfw has just said while I was composing this)

Yes, clear that out for a clean start.

A bare ATtiny85 will need the bootloader installed also.

I find the ATtiny85 digispark module version is sometimes easier to use.
Video here..... https://www.youtube.com/watch?v=MmDBvgrYGZs

@SierraGolfMike
You may follow the procedures of Section-19.2.1 of the attached file to program ATtiny85 using Arduino as ISP.
Ch-19 ATtiny85 MCULec (3).pdf (778.9 KB)

1 Like

That is the compile output for a much bigger MCU, most likely for the UNO that you intend to use for programming.

Technically speaking not, but to prevent confusion it is probably better.

  • Make sure there is no power to the ATtiny
  • select the UNO as a board and upload File-> Examples->ArduinoISP->ArduinoISP
  • check all connections as they are mentioned in the sketch comments and add
// Put an LED (with resistor) on the following pins:
// 9: Heartbeat   - shows the programmer is running
// 8: Error       - Lights up if something goes wrong (use red if that makes sense)
// 7: Programming - In communication with the slave
  • Make sure the Heartbeat is showing.
  • Switch the board to ATtiny85. Tools ->Board->ATtinyCore -> ATtiny 25/45/85 and select ATtiny85 (i have the old core still installed, maybe small differences)
  • Select Tools -> Programmer -> Arduino as ISP
  • connect Power to the ATtiny.
  • Make sure Tools->Clockspeed is set to '8MHz internal'
  • Select Tools -> Burn Bootloader.

That should burn the bootloader. If that fails there is a chance that the ATtiny is bricked and you may need to built and use a High Voltage programmer.

If the Bootloader burning is successful. (technically speaking it is just the setting of the fuses for the clock speed)
Then you can burn a sketch, i would use a simple 'Blink' on PB4 / Physical pin 3 to verify this,
using Sketch->Upload Using Programmer.