Arduino ISP on Leonardo

hello,

i litteraly spend 3 day of work, trying to get my Leonardo to work whit Arduino ISP in IDE 1.6.5 to be able to program Attiny 13a, 45 or 85. I found a lot of guides, tried all of them and they maybe worked on earliers versions of IDE, but now whit 1.6.5 and my Leonardo board, afer trying 5 of most popular guides and ways to connect it, i came to conclusion that this will not work.

So now im wondering beetwen 2 decisions: should i jsut buy another Attiny programmator(if i choose this, which ones are compatible whit IDE software?),

OR(and i prefer this next option),

i buy an Arduino UNO and use it to program attiny or atmega(cheaper then attiny/atmega programator). I assume since this are kind of a "main" arduino boards, the integrated Arduino ISP programator will work whit them 100%?

SO please, shine some light on the mather ;D

Can you share what errors you're getting?

Errors involving the programmer not working look very different from wiring errors, so if you post the errors, we could verify the nature of the problem, and let you know if they indicate something that wouldn't be fixed by chasing the programmer (ex, bad config files)

The isp device I recommend is the usbasp, very cheap on eBay, and there's a gui you can use with it that is really handy (it also works with the use)

Since the SS pin on the Leonardo is used to control RXLED and is not available as a pin broken out to the header, you need to make an edit to a line in Arduino as ISP sketch:

change:

define RESET     SS

to:

define RESET     10

Also, since the MISO, MOSI, and SCK pins are also not available on the header, you need to use the ICSP header on the Leo to access them. Here is the pin arrangement on ICSP header of Leo:

D14 MISO 1 . . 2 VCC
D15  SCK 3 . . 4 MOSI D16
     RST 5 . . 6 GND

These are the most frequent stumbling blocks. I don't care very much for tutorials online which do not show use of the ICSP header, and instead they show using pins 11,12, and 13. Those tutorials don't apply to Leo and you must adapt.

The upside to this is often people don't know when using the Leo they have extra pins and you can use them for things other than ISP. Pins 14, 15, and 16 are there on the ICSP header.

Just as with using Uno, open the Example sketch ArduinoISP (and make the edit to the reset-sending pin), and from the menu select Tools, Programmer, "Arduino as ISP"

Also, you do not need to disable auto reset on the Leo with a capacitor as you see in various tutorials, because Leo does not reset upon serial connection.

I opened Arduino ISP, changed the reset pin to 10, uploaded it, used ICSP header, installed atTiny13a/45/85 board support from:

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

selected AtTiny 85 1MHz, used brand new attiny, and tried to upload BLINK to it.
This is the error message i get:

Arduino:1.6.5 (Windows 8.1), Plošča:"ATtiny, ATtiny85, 1 MHz (internal)"

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03

I found that Leonardo doesnt work whit stk500 as it is in default Arduino as ISP, so i got this modified one that uses Arduino protocol to communicate. To do this i added:

arduinoispleo.name=Arduino as ISP (Leonardo)
arduinoispleo.communication=serial
arduinoispleo.protocol=arduino
arduinoispleo.speed=19200
arduinoispleo.program.tool=avrdude

to the end in programmers.txt file in Program Files (x86)\Arduino\hardware\arduino\avr, and selected under programmer Arduino as ISP(Leonardo).

Previusly mention error is gone, but now i get this one:

avrdude: ser_open(): can't open device "\.\com1": The system cannot find the file specified.

Please help bcs i really need to get my program on attiny85 using my Leonardo.

I have no trouble using Leo as an ISP programmer, and did not have to make any edits to programmers.txt. I just open the Example sketch ArduinoISP, make the edit to the reset-sending pin, upload it to the Leo, and from the menu select Tools, Programmer, "Arduino as ISP". Arduino as ISP uses stk500v1 protocol over serial regardless of whether it is Leo, Uno, Mega or whatever type of Arduino.

If you have another Arduino at all, I suggest burning a fresh bootloader on it using the Leo with Tools>Programmer set to "Arduino as ISP" to verify your Leo as ISP programmer, before moving on to ATtinys. There may be a problem with the wiring to the ATtiny, or a problem with the boards.txt entry which comes with that core.

DrAzzy has cores in his signature block above, you might try that out.

thk dmjlambert for clearing this out, So Leo should work whithout any odifications to files. So now i finaly know that the problem is eaither my Leonardo or my laptop(windows 10).

I have another one, i will try whit that one and will laos reainstall IDE to remove any changes i did.

1 more thing, you use the latest IDE 1.6.5.?
And you use only the ICSP headers+pin 10 for reset?

klemko:
1 more thing, you use the latest IDE 1.6.5.?

Yes

klemko:
And you use only the ICSP headers+pin 10 for reset?

Yes, the ICSP header is where you find MISO, SCK, and MOSI, and pin 10 supplies reset if you set the "define RESET 10" line in the Arduino as ISP sketch.

thanks fro all the help and dmj, can you send me the link of the cores you use?

i tried the ones from drazzy, but those remove default boards(leo, uno, due...) and only provide attiny and atmega boards.

I use Leo as a programmer for things other than ATtiny. I don't think there is any such thing as a core set which replaces the default boards. I just installed the ones in DrAzzy's signature and they supplement all the other boards. You must have not installed them in your documents folder. Go into your Arduino IDE preferences pane. There is a setting called Sketchbook location. On my computer is is /Users/david/Documents/Arduino. This is the documents folder. Close the preferences pane. Using the command line, Finder, Nautilus, File Explorer, or whatever file manager you use on your computer, create a subdirectory called hardware and unzip the cores files there. When I unzipped the cores they ended up creating the directory /Users/david/Documents/Arduino/hardware/ATTinyCore-master on my computer.

oh thanks, i putted that avr folder into my program files folder, instead of dcuments xDD Thanks for helpa gain :smiley: