Help! I've spent the last couple of hours banging my head against the wall. I was trying to update my firmware with my new usbasp programmer, and have only managed to erase my chip.
- If you are on Windows, you will need to install the drivers for the programmer. A lot of sites will say you need to disable driver signing and do a whole bunch of steps, but the drivers found here will install on Windows 10 (they are signed) when installed using the installer (but not when you try to install the drivers yourself).
- USBASP is well-known USB programmer for Atmel AVR microcontrollers initially supported by Thomas Fischl. USBasp flash uploader is made of an Atmega8 or Atmega88 and few other components including resistors, capacitors, LEDs, and connectors. The adapter works on a firmware driver, which gives a room for customization, and new chips updates. The USBasp programmer has been so famous for a long.
- USBasp on a clone. This is a fork of the original USBasp firmware (the file from 2011-05-28) tweaked to work with clone 'USB ISP Version 2.0' devices (marked 'MX-USBISP-V4.00' on the PCB). The original documentation and license is in Readme.txt.
(select usbasp-windriver.2011-05-28 usbasp-windriver.2011-05-28 libusb1.2.4.0). Don't forget to check the 'include subfolders' box. E) Click next and ignore the security warning 'Windows can't verify the publisher of this driver software' and select 'Install this driver software anyway'. The best driver installation tool for Windows is.
I bought the programmer off ebay (it says USBASP V2.0 - LC Technology), and wired an adapter cable with the following mappings (from Sanguino to programmer):
1 - 9 (MISO)
2 - 2 (VCC)
3 - 7 (SCK)
4 - 1 (MOSI)
5 - 5 (CS)
6 - 10 (GND)
When using, it, the 1284p is detected and has the correct signature, and I can successfully read and change the fuses, so the connection seems okay. However, when trying to upload a bootloader or marlin build, it always fails to verify as follows. Any ideas? The programmer itself only has a jumper for 3.3/5V (currently set to 5V).
Usbasp V2 0 Driver Windows 10 Pro
>avrdude -C ..etcavrdude.conf -c usbasp -p m1284p -U flash:w:SolidoodleMarlin.cpp.hex -v -D
avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is '..etcavrdude.conf'
Using Port : lpt1
Using Programmer : usbasp
AVR Part : ATMEGA1284P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 10 128 0 no 4096 8 0 9000 90
00 0xff 0xff
flash 65 10 256 0 yes 131072 256 512 4500 45
00 0xff 0xff
lock 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0
0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DB
avrdude: safemode: efuse reads as F8
avrdude: reading input file 'SolidoodleMarlin.cpp.hex'
avrdude: input file SolidoodleMarlin.cpp.hex auto detected as Intel Hex
avrdude: writing flash (110734 bytes):
Writing | ################################################## | 100% 59.31s
avrdude: 110734 bytes of flash written
avrdude: verifying flash memory against SolidoodleMarlin.cpp.hex:
avrdude: load data flash data from input file SolidoodleMarlin.cpp.hex:
avrdude: input file SolidoodleMarlin.cpp.hex auto detected as Intel Hex
avrdude: input file SolidoodleMarlin.cpp.hex contains 110734 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 57.39s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DB
avrdude: safemode: efuse reads as F8
avrdude: safemode: Fuses OK
avrdude done. Thank you.
So, you've created a project on an Arduino and want to deploy it in to the world. The problem is that an Arduino is a big and relatively expensive device that has far more things than necessary for your project.
What you really need is just the microcontroller to run your code and control the pins. All you need to do is buy an ATtiny45, ATtiny85 or similar Atmel chip, and then upload your program to it.
The Arduino makes putting your code and powering your Atmel chip very easy. Getting your code on to the stand-alone Atmel chip is a little more tricky; there are ways to program the chip with an Arduino, but they aren't as easy as using a USBasp AVR programmer. The one I used is this one found on Ali Express.
If you are on Windows, you will need to install the drivers for the programmer. A lot of sites will say you need to disable driver signing and do a whole bunch of steps, but the drivers found here will install on Windows 10 (they are signed) when installed using the installer (but not when you try to install the drivers yourself). Once the drivers are installed, plug in the programmer and confirm your the drivers are working in device manager:
Usbasp V2 Driver Windows 10
Next, you need to install the ATtiny board in to the Arduino IDE. To do this, follow these steps:
- Go to File > Preferences.
- Click on the button to edit the 'Additional Board Manager URLs'.
- Add 'https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json' on a new line.
- Click 'OK' to close the URL editor, and 'OK' again to close preferences.
- Then go to Tools > Board Managers
- Search for 'ATtiny'.
- Install the attiny boards that appear (you should only have 1 result).
Next we need to set the board to be the ATtiny and the programmer to 'USBasp', use the following screenshot for reference:
We are now all set from the software end, we need to then wire up the hardware. The following pins will need to be connected:
1 - 9 (MISO)
2 - 2 (VCC)
3 - 7 (SCK)
4 - 1 (MOSI)
5 - 5 (CS)
6 - 10 (GND)
When using, it, the 1284p is detected and has the correct signature, and I can successfully read and change the fuses, so the connection seems okay. However, when trying to upload a bootloader or marlin build, it always fails to verify as follows. Any ideas? The programmer itself only has a jumper for 3.3/5V (currently set to 5V).
Usbasp V2 0 Driver Windows 10 Pro
>avrdude -C ..etcavrdude.conf -c usbasp -p m1284p -U flash:w:SolidoodleMarlin.cpp.hex -v -D
avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is '..etcavrdude.conf'
Using Port : lpt1
Using Programmer : usbasp
AVR Part : ATMEGA1284P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 10 128 0 no 4096 8 0 9000 90
00 0xff 0xff
flash 65 10 256 0 yes 131072 256 512 4500 45
00 0xff 0xff
lock 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 90
00 0x00 0x00
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0
0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DB
avrdude: safemode: efuse reads as F8
avrdude: reading input file 'SolidoodleMarlin.cpp.hex'
avrdude: input file SolidoodleMarlin.cpp.hex auto detected as Intel Hex
avrdude: writing flash (110734 bytes):
Writing | ################################################## | 100% 59.31s
avrdude: 110734 bytes of flash written
avrdude: verifying flash memory against SolidoodleMarlin.cpp.hex:
avrdude: load data flash data from input file SolidoodleMarlin.cpp.hex:
avrdude: input file SolidoodleMarlin.cpp.hex auto detected as Intel Hex
avrdude: input file SolidoodleMarlin.cpp.hex contains 110734 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 57.39s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DB
avrdude: safemode: efuse reads as F8
avrdude: safemode: Fuses OK
avrdude done. Thank you.
So, you've created a project on an Arduino and want to deploy it in to the world. The problem is that an Arduino is a big and relatively expensive device that has far more things than necessary for your project.
What you really need is just the microcontroller to run your code and control the pins. All you need to do is buy an ATtiny45, ATtiny85 or similar Atmel chip, and then upload your program to it.
The Arduino makes putting your code and powering your Atmel chip very easy. Getting your code on to the stand-alone Atmel chip is a little more tricky; there are ways to program the chip with an Arduino, but they aren't as easy as using a USBasp AVR programmer. The one I used is this one found on Ali Express.
If you are on Windows, you will need to install the drivers for the programmer. A lot of sites will say you need to disable driver signing and do a whole bunch of steps, but the drivers found here will install on Windows 10 (they are signed) when installed using the installer (but not when you try to install the drivers yourself). Once the drivers are installed, plug in the programmer and confirm your the drivers are working in device manager:
Usbasp V2 Driver Windows 10
Next, you need to install the ATtiny board in to the Arduino IDE. To do this, follow these steps:
- Go to File > Preferences.
- Click on the button to edit the 'Additional Board Manager URLs'.
- Add 'https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json' on a new line.
- Click 'OK' to close the URL editor, and 'OK' again to close preferences.
- Then go to Tools > Board Managers
- Search for 'ATtiny'.
- Install the attiny boards that appear (you should only have 1 result).
Next we need to set the board to be the ATtiny and the programmer to 'USBasp', use the following screenshot for reference:
We are now all set from the software end, we need to then wire up the hardware. The following pins will need to be connected:
- The MOSI from the programmer to the MOSI of the ATtiny (Pin 5)
- The MISO from the programmer to the MISO of the ATtiny (Pin 6)
- The SCK (Clock) from the programmer to the SCK of the ATtiny (Pin 7)
- The RESET from the programmer to the RESET of the ATtiny (Pin 1)
- The Vcc from the progammer to the Vcc of the ATtiny (Pin 8)
- Ground from the programmer to the ground of the ATtiny (Pin 4)
Setting these pins up can be done in a couple of ways, I decided to make a dedicated board for this with a socket, so I can program chips quickly in the future. If you do this, I recommend running some tests on a breadboard first and making sure you have all your pins properly connected before soldering it together. Here is my programmer.
Now, all that needs to be done is plug the USBasp in to the USB port of a computer and hit play, here is what the console will look like when it is all working:
Install Usbasp Driver Windows 10
Now, you can use the newly programmed ATtiny chip in a project, without have to log around the entire Arduino with it.