Trying to programme ATTiny 85 [SOLVED]

Thanks, I have a couple with 104 on them but nothing else, I won’t chance them just in case they are the wrong size. I’ve seen people using various sizes from 10 microfarads to 100nF, I take it size is not hyper critical?

They will be fine. You won't do any harm if you use the wrong value capacitor, it just might not be effective at decoupling. 104 = 100nF, which is perfect.
What's important for decoupling chip power pins is:

  • don't use electrolytic capacitors, their high frequency response isn't good
  • do use ceramic capacitors, their high frequency response is good
  • place as near to the chip's Vcc/Gnd pins as possible
  • don't use long wires to make the connection

100nF is the typical value used, but if e.g. you only had 220nF they would be fine too.

I use these

Just to clarify, for programming the ATtiny85 the capacitor goes between reset and ground?

I was talking about the 100nF capacitor that should go between Vcc and GND of the ATtiny85. This is to stop noise spikes on the power pins causing the ATtiny85 to misbehave. As someone else said, you may get away without using one, and from the photo in the pdf I attached in post #23 it appears I didn't use one, I should have done, it's a good idea to include it.
I don't think you should have a capacitor between ATtiny85 reset pin and GND for any reason.
The other capacitor which may or may not be needed is a 10uF electrolytic between the Uno reset pin and GND when using the Uno as a programmer for the ATtiny85. If you can reliably program the ATtiny85 without this 10uF then you don't need it.

I managed to get the Blink sketch uploaded without any capacitors but will use a 100nF between 5V and Gnd at the ATtiny85 in future projects. Many thanks for your help Dave, it is much appreciated.

1 Like

Not on the 85, you need a cap between ground and reset on the UNO that youre using for a programmer. Otherwise when the upload starts the UNO thinks it is the one getting programmed and it resets and goes into ita bootloader instead of programming the 85.

Yes, indeed, there are several posts about that already in this thread. However, some people who posted said it worked perfectly without it (for example post #34). I had an experience that agrees with what you just said (see post #35)

With the 'ArduinoISP' sketch loaded onto it, the wiring as in the comments, and the programmer set to 'Arduino as ISP' and 'Upload using Programmer' No it won't. There won't be a DTR signal send, but rather Serial data that gets converted into SPI.

When using the ICSP header, and using the normal upload button, maybe yes.

I’ll start with a 100nF across 5V & Gnd on the ATtiny 85, if I have any issues I will try a 10uF on the UNO between Gnd and Reset. Thank you all for your input!

There is an offical (docs.arduino.cc) document about using Arduino as ISP at this link.


Perhaps that explains why some people say they needed it to make it work and others say the opposite. I didn't realise this was such a controversial subject :slight_smile:

1 Like

Thats not controversy, it is a misunderstanding. People think that because their board didnt need it then no boards do.

I like this video... it includes the capacitor in question...

Maybe.

I don't think that matters all that much. The ArduinoISP sketch is fine with it being restarted initially, it will just go though setup() and take it from there.

void setup() {
  SERIAL.begin(BAUDRATE);

  pinMode(LED_PMODE, OUTPUT);
  pulse(LED_PMODE, 2);
  pinMode(LED_ERR, OUTPUT);
  pulse(LED_ERR, 2);
  pinMode(LED_HB, OUTPUT);
  pulse(LED_HB, 2);
}

I don't think there is a need to prevent that, but whatever works, works i'd say.

Haven't checked on the ATtiny85, but on an ATtiny13, uploading is fine with the Serial monitor open, while burning the fuses requires it to be shut.

After a two second break in the bootloader that the IDE isn't expecting.

I know that loading onto a ATMega1284P from an old school UNO will fail without it. I've forgotten to add it and my upload failed enough times to know that for sure.

1 Like

That is interesting.

That may of course depend on the core being used.

Well if my attempts fail to upload onto a bare 328P i will know what to do, so that is very helpful.

Something to experiment for the evening :wink:

https://www.instructables.com/How-to-Program-an-Attiny85-From-an-Arduino-Uno/

I believe the reset pulse in internally generated so no need for the capacitor like on the AT328P.
In my device ( deployed and running 24/7) I put a 10k to 3.3 volts. I did this to be sure when / if I need to reprogram, the reset is pulled high. May not be needed but doesn't hurt. And if you end up making a board as I did, its easier to remove a resistor than add one in.

One final question, I think! I followed the above PDF to programme the Blink sketch. In going through the process the board I chose was "ATtiny25/45/85(No bootloader). If I now want to load my project sketch onto the ATtiny85, do I still choose that board option even though I have burned the bootloader? If not, which one do I choose?

You didn't really burned the bootloader, you set the fuses, .. Unless you set the board option for something else, and then burned the bootloader.

A 'real' bootloader may in 5theory also allow you to program the board thru it's UART (if it has one)

So yes, still choose that board.

1. If you program a fresh ATiny85 using that PDF, then you have to always choose "ATtiny25/45/85(No bootloader)" and carry out the process of "Burn Bootloader". In this case, "Burn Bootloader" process only sets the fuse bits of the ATtiny85 to internal 8 MHz clock and few more things.

2. The following Digispark ATtiny85 Dev Board (Fig-1, Fig-2 is a Colone) contains the "Bootloader Program" in order to allow you to program the ATtiny85 just like an Arduino UNO Board. The board comes with pre-installed "Bootoader Program" and the necessary fuse bit settings. (Bootloader is a small program that occupies about 2k flash which allows the ATtiny85 to communicate with IDE/Serial Monitor being a USB Device.)

DigisparkAttiny85Board
Figure-1:

Attiny85DevBoard
Figure-2: