# How to program ATTINY2313 with USBASP?

I've got an USBASP v2 programmer with 10-pin ICSP output. Could anyone tell me which pins to connect to program my ATTINY2313 with AVRDUDE (under Ubuntu). For some reason, I keep getting:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

-
 Is there any particular reason why you haven't accepted answers to any of the questions you asked so far and a the same time haven't provided information why any of the provided answers aren't the solution to your problem? – AndrejaKo Mar 25 '12 at 8:40

I had the same problem trying to program an ATtiny2313 with an USBasp out of the box. The problem is that the 2313's default clock (internal oscillator, CKDIV8 enabled) is way to slow for the SCK used by the USBasp by default. From your error message it seems like the current version of avrdude already adresses this problem and tries to reduce the SCK clock rate, but your USBasp's firmware doesn't support that. You now have two options:

• updating the USBasp firmware to a version that allows changing SCK frequency through software
• manually reducing the SCK frequency by setting the "Slow SCK" jumper on the board. Maybe this schematic helps you to find it: http://www.fischl.de/usbasp/bilder/usbasp_circuit.png This is what I did. Note that the actual name may not correspond to the one in the schematic. In my case the jumper was called "J1", not "JP3"
-

It is good practise to start problem finding with the first error message received. Avrdude suggests a firmware update to the USPASP, so there are three things you have to do:

1. Figure out which version firmware is running on the USPASP;
2. Figure out what version firmware is current;
3. Upgrade the firmware and check the new version number

Then retry programming the ATtiny.

-
 Hmm .. it says on another site that it probably isn't connected to the chip. Could you tell me exactly which pins to connect to get it to work? Thanks. – user8210 Mar 25 '12 at 22:08 You can easily get this information from the datasheet, but you're lucky I'm writing an article about an ATtiny2313 and I can just copy & paste the required pins: ATtiny2313: 10: GND; 1: !RESET; 17: MOSI; 18: MISO; 19: SCL/SCK; 20: Vcc. I don't know the pinning for your USPASP though. I still think you have to start solving the first error, as this is quite probably the cause for being unble to properly communicate with the device. – jippie Mar 26 '12 at 6:25