I put together an ISP programmer from an ATtiny85 + passive components. Really nice gadget to have, you don't have to use a regular Arduino as a programmer. I wonder if the same can be done for ATtinyX4, if it fits 4096 byte.
OK, I finished the board !
and linked it to my Arduino Uno R3
using these pins as in this reference:
I'm powering my cct with an external 5V from a small PSU.
I have a common negative wire between Arduino Uno and my cct.
Next step is to actually program it !
Im using these settings:
and I made a test code, but it is not working!
/*
Test code for ATtiny44A
*/
int led1 = 13;
int led2 = 11;
void setup()
{
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
}
void loop()
{
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
delay(1000);
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
delay(1000);
}
I loaded "ArduinoISP.ino" file from examples.
I get an error for both [upload] the program and for [burn bootloader] options.
Ahaa ! I find the Programming page !
Ahaaaaa: " Do not select a board definition marked Optiboot unless you are planning to "Burn Bootloader" to prepare it for serial programming. " and I did choose it the first time.
-Now I look more closely and I find the very first option:
Here Im not sure I understand it correctly:
"If this is the first time you are using a brand new chip,"
-----Yes I am !!!!!!!
" or if you need to change the clock source or BOD settings, you must do "Burn Bootloader" to set the fuses. If you previously used optiboot, and wish to program with ISP instead, or if you want to install optiboot on the chip, you must do "burn bootloader" first as well.*
If burning the bootloader, do Tools -> Burn Bootloader. You should see output on the console reporting that it was successfully written"
-----No, Im not, I get that error !!!!!!!
So I did as suggested and it is not working !
If uploading a sketch, click upload. You should see output on the console reporting that the sketch was successfully uploaded.
-----No, Im not, I get another error !!!!!!!**
Did you install a capacitor for the Uno? Do you have a 0.1 / 1 uF ceramic cap between Vcc and GND on the ATtiny?
I wouldn't bother with a bootloader since this chip is short of mem.
I've added now a 100nF on the power rails, on the bredboard.
I know !
but HE sais:
"If this is the first time you are using a brand new chip, .... you must do "Burn Bootloader" to set the fuses.
It is the first time Im programming the chip and we need to set the fuses !
How to set them ?
Even if you choose No bootloader, in order to get the other settings in place like clock source (most important thing to get right, set to internal) you must use the same procedure.
edit: Many settings in the Tools menu are fuses.
Really? I didnt know that !
Very cool then !
It should work by simply uploading my test progam, right?
But it does not work !
Here are my 'new' settings
While uploading, is also freezing for 1min or so. This is a sign that is trying to connect like the error says. Usually, I can see led13 on Arduino UNO blinking when programming something because it is linked to TX pin. But NOT NOW !
Added 100nF directly on the power pins.
I also rechecked the other connections, they are cemented and good.
Give a guided tour what steps you've done, start with step 2.
- Uploaded the Arduino as ISP sketch.
- ....
BTW!!!! It worked FINE for MiniCore when I programmed ATmega328 !!!!
I had no errors at this point.
I only had some avrdude warnings but it worked fine with that CORE.
I need to fill in the steps my self?
- Switched to ATtiny44 board.
- Compiled Arduino as ISP sketch this time for ATtiny, which failed, since it doesn't have enough memory.
- ...
In fact you did more steps, and I wanted to see where it fails. Sure, this ship came to harbour... but there are other pitfalls.
Nowhere is mentioned of not enough memory !!!
- The only error is about bootloader for ATtiny44 when trying to upload Arduino as ISP
- and the connection "not in sync" when uploading my test sketch.
Ive also tried these other 2 programmers:
but I undo back quickly.
It seems those are some hardware programmers I dont have. Most probably.
Is what I could catch from the error it trowed.
Very small change. Before I was powering with external 5V.
Now Im powering exclusively from Arduino board, the 5V and 0V rails.
Well you can keep trying the Arduino as ISP sketch as long as you want... it will never work.
What do you intend to do with these ATtinys?
The only programmer you got at hands there are the Uno when it's running the AaISP sketch. The ATtiny85 I uses as a programmer have a firmware loaded, making it into an USBtinyISP. But there are no sketches (maybe somewhere you can download them?) that turns an ATtiny into a programmer.
In order to use your ATtinys you need to first choose one in the Tools menu, pick the appropriate settings and then Burn bootloader, even if you don't intend to use one (and I recommend you to not). After this you can start New sketch or load sketches, and to upload you cannot just pick Upload, but Upload using Programmer.