How to program ATtiny45 with Arduino Leonardo as ISP

I'm trying to bring a tiny sketch to the ATtiny45 chip using the instructions at http://hlt.media.mit.edu/?p=1695

I used ArduinoISP on my LEONARDO in order to use it as an ISP. After running the sketch it is keeping the LED on pin 9 blinking fine.

I'm trying to load the Blink sketch to the ATtiny using the 'Arduino as ISP' Programmer option from the Tools Menu.

All I get is LED_PMODE blinking once and this list of errors:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

Did anyone ever use a LEONARDO as ArduinoISP succesfully and can provide me with a hint?

Any idea if resistor or capacitor is needed for the LEONARDO as well (tried both so far - no success) in order to keep it in the ISP mode once I try to send a sketch to the ATtiny?

I guessed there are no changes in the pinout (ArduinoISP uses pins 7 - 13) from Arduino Uno or Duemilanove (from original description) to my LEONARDO or do I need some re-wiring?

Thanks for your help,

Peter

Same problem with recently adquired leonardo.. but trying to program attiny85 or atmega 328..

this is the output that i get when i try to do that (following the instructions from "high-low tech" ):

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: Yikes! Invalid device signature.
* Double check connections and try again, or use -F to override*
* this check.*

The leonardo leds works when i try to upload the sketch to attiny85, but nothing more occurs.

Thanks for any help

Short update:

I had no patience to wait for a solution and so I bought an USBTinyISP -> works perfectly fine without changing the ATtiny sketch or such - only needed to configure the new programmer in Arduino.

Unfortunately i still don't know how to use my Leonardo as ISP

By now, the issues found in this thread were fixed in the Arduino repository in gitub.
I have placed a wrap up of how to use ArduinoISP with arduino 1.0.1 on the Leonardo over here: ArduinoISP on the Leonardo | PeterVH.

Hi PeterVH

I really appreciate your effort on helping us with this issue with Leonardo boards. Thank you!
I will try your solution as soon as I get home. The process you described is very clear, but even though there is a photo of the assembly in your blog I'm not very sure about how the MISO/MOSI and SCK pins should be connected to the ICSP header of the Leonardo. I would be very grateful if you could clarify it to me.

Thank you in advance!

I agree the picture is not very instructive, i'll make a better one and add some annotations.

Fortunately, all arduino ICSP headers are the same so have a look over here:
http://arduino.cc/forum/index.php/topic,84190.0.html
You don't use its reset pin.

OOOH
I got it!
THANK YOU VERY MUCH!

thanks for the wonderful write up, peter!

i've seen all that information scattered across multiple threads, but this is the first time its been put together in a coherent manner

i'm eager to see if this will finally fix my woes...i couldn't wait and bought an UNO a few weeks ago but haven't lost hope for my leo

I've followed petervh instructions but when I try to upload the led blink sketch I get the error: stk500_getsync(): not in sync: resp=0x00 I've connected the Vcc, Gnd, MISO, MOSI and SCK pins of the leonardo onto the corresponding pins of the ATTiny85 except the RESET pin which according to petervh must be connected to pin 10, I've followed the source code modifications already, please help.

Arduino 1.0.2 is out now. Can you try with that, it excludes possible errors in the modifs to the core...
You still have to modify ArduinoISP: #define RESET 10 and of coarse use the pins on the ICSP header.
If it does not work, can you post the exact output of avrdude (use option -v).

To be able to test ArduinoISP/Leonardo/Arduino1.0.2/arduino-tiny, I made a small board with an attiny85, and hooked it up to my Leonardo.

Never used arduino-tiny before, I followed Coding Badly's instructions http://arduino.cc/forum/index.php/topic,132007.0.html and it all worked out of the box. Many thanks to the creators, nice job!

I have an Arduino Leonardo, trying to program the ATtiny45 chip. I have connected the programming wires to the ICSP pins as directed. I am using Arduino 1.0.1 software in Windoes XP Home SP 3. I have changed the #defin RESET SS to 10 in the ArduinoISPM sketch and compiled that using the Leonardo board. Then I loaded the blink sketch and changed the led to 0. I compiled to the ATtiny45(8 mhz internal clock) and got the following error:

Binary sketch size: 830 bytes (of a 4,096 byte maximum)
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

I just tried Arduino 1.0.2 software and got this error message when trying to load the Blink program:

In file included from F:\Arduino\hardware\arduino\cores\arduino/Arduino.h:193, from Blink.ino:10:
F:\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:125:2: error: #error TXC0 not definable in HardwareSerial.h

I have just purchased 50 of these chips and hope I don't have to buy a programmer or an Arduino UNO to make them work!!
Any ideas???

John

johntech2011:
Binary sketch size: 830 bytes (of a 4,096 byte maximum)
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

Which programmer do you have selected?

I just tried Arduino 1.0.2 software and got this error message when trying to load the Blink program:

In file included from F:\Arduino\hardware\arduino\cores\arduino/Arduino.h:193, from Blink.ino:10:
F:\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:125:2: error: #error TXC0 not definable in HardwareSerial.h

Give this core a try...
http://code.google.com/p/arduino-tiny/

I have tried that core too. I went back in and changed the PROGRAMMER to Leonardo as ISP in ver 1.0.1 and it gave me this error:

Binary sketch size: 824 bytes (of a 4,096 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00

I am new to Arduino and don't have a clue why this isn't working. If I can get it working then I will make a programming shield for it.
I must be missing something!!!

John

Have you worked through PeterVH's instructions...

Well, since johntech2011 is on windows xp, I tried things out on that os (I used win xp pro sp2). Guess what, it did not work. The work around so use -c arduino (Burning a Atmega 328 Bootloader with an Arduino Leonardo - #33 by RoystonS - Microcontrollers - Arduino Forum) does not help either.

More in general communication over the leo's virtual com port does not work at all: error writing to serial port (tried putty, ide's serial monitor and avrdude) This is strange since uploadng sketches to the leo's bootloader does work correctly. So this must be caused by the leo's core which works very well with linux but really has some problems with windows.

I want to figure this out but it does not look very good. All ideas are welcome.

Thank you for verifying that Peter. That was driving me nuts as everything I found said it would work. Believe me I tried a lot of things. Once I purchased the Uno ver 3 it worked the first time.

John

Thanks for everyone.I did try on ATMEGA 168 and it works.

Perfect! It helped me a lot!

I know this is resurrecting a very old thread, but I just wanted to thank PeterVH for his work.
I couldn't get my ProMicro copy (32u4) to work properly as an ISP.
After adding the file "programmers.txt" as Peter outlined in his Wordpress article, everything started working fine.
I am using Windows 7 64-bit and Arduino 1.0.5 and nothing but Peter's workaround helped.
Thanks again. 8)