USBasp not working through IDE

(Moderators, not sure where to post this since the rebirth of the forums. Please move if needed)

I've been trying without success to get a USBasp ISP programmer to work from the Arduino IDE.

This programmer works just fine under the CLI avrdude program.

System: Linux (Ubuntu 10.10 64 bit)

Arduino 0022 (64 bit)

I've edited the 'programmers.txt' and a 'boards.txt' file located in my sketch folder

Programmers.txt contains this entry for the USPasp:

usbasp.name=USBasp
usbasp.protocol=usbasp

And this for the boards file:

attiny85U.name=ATtiny85 with USBasp
attiny85U.upload.using=usbasp
attiny85U.upload.maximum_size=8192
attiny85U.build.mcu=attiny85
attiny85U.build.f_cpu=1000000L
attiny85U.build.core=attiny45_85

***********************************************************************************************

atmega328U.name=ATmega328 Bootloader w/ USBasp

atmega328U.upload.protocol=usbasp
atmega328U.upload.maximum_size=30720
atmega328U.upload.speed=57600

atmega328U.bootloader.low_fuses=0xFF
atmega328U.bootloader.high_fuses=0xDA
atmega328U.bootloader.extended_fuses=0x05
atmega328U.bootloader.path=atmega
atmega328U.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328U.bootloader.unlock_bits=0x3F
atmega328U.bootloader.lock_bits=0x0F

atmega328U.build.mcu=atmega328p
atmega328U.build.f_cpu=16000000L
atmega328U.build.core=arduino

When I try to upload a sketch to the t85 I get this in the message pane below the sketch:

Binary sketch size: 790 bytes (of a 8192 byte maximum)
java.lang.NullPointerException
    at processing.app.debug.AvrdudeUploader.getProgrammerCommands(AvrdudeUploader.java:106)
    at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:68)
    at processing.app.Sketch.upload(Sketch.java:1603)
    at processing.app.Sketch.exportApplet(Sketch.java:1568)
    at processing.app.Sketch.exportApplet(Sketch.java:1524)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
    at java.lang.Thread.run(Thread.java:636)

When I try to burn a bootloader to a mega328 I get this error:

avrdude: Warning: cannot query manufacturer for device: error sending control message: Operation not permitted
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

I think the error with the bootloader is a permissions issue. Not sure about the errors with the sketch upload.

Ideas?

Bootloader issue solved. Permissions.

Still seeing the same errors when trying to upload a sketch to a tiny85

Try this in programmers.txt …

usbasp.name=USBasp
usbasp.communication=usb
usbasp.protocol=usbasp

If that doesn’t work, try this…

usbasp.name=USBasp
usbasp.communication=serial
usbasp.protocol=usbasp

No dice. Same error. ]:D

This appears to be the correct entry for programmers.txt …

usbasp.name=USBasp
usbasp.communication=usb
usbasp.protocol=usbasp

Change this…

attiny85U.upload.using=usbasp

…to this…

attiny85U.upload.protocol=usbasp

Which Arduino IDE version are you using?

Something else to try... put blank lines between each entry. Maybe there is a line-ending problem...

usbasp.name=USBasp

usbasp.communication=usb

usbasp.protocol=usbasp

attiny85U.name=ATtiny85 with USBasp

attiny85U.upload.using=usbasp

attiny85U.upload.maximum_size=8192

attiny85U.build.mcu=attiny85

attiny85U.build.f_cpu=1000000L

attiny85U.build.core=attiny45_85

As I noted in my original post IDE 0022.

Oooh! Look! New error messages! ;) The top 4 lines are new. The rest is the same as before...

Binary sketch size: 790 bytes (of a 8192 byte maximum)
java.lang.NumberFormatException: null
    at java.lang.Integer.parseInt(Integer.java:443)
    at java.lang.Integer.parseInt(Integer.java:514)
    at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:86)
    at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:56)
    at processing.app.Sketch.upload(Sketch.java:1603)
    at processing.app.Sketch.exportApplet(Sketch.java:1568)
    at processing.app.Sketch.exportApplet(Sketch.java:1524)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
    at java.lang.Thread.run(Thread.java:636)

And I do appreciate your help.

I've got a monster headache and a job interview in the morning so it's time for me to bail for the night.

Progress. Excellent!

at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:86)

...I believe you have to include the "bootloader" entries even though you are not using a bootloader. Something like this should work...

# Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)
# Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value
# Divide clock by 8 internally; [CKDIV8=0]
# Brown-out detection disabled; [BODLEVEL=111]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny85U.bootloader.low_fuses=0x62
attiny85U.bootloader.high_fuses=0xD7
attiny85U.bootloader.extended_fuses=0xFF
attiny85U.bootloader.path=empty
attiny85U.bootloader.file=empty85at1.hex

attiny85U.bootloader.unlock_bits=0xFF
attiny85U.bootloader.lock_bits=0xFF

attiny85U.build.core=attiny45_85

I have a preference for this core ;) ... http://code.google.com/p/arduino-tiny/

I have a preference for this core ;) ... http://code.google.com/p/arduino-tiny/

I'm shocked.... :D (not!) ;)

And the bad news is I get the same error. Even with your core. I even tried this on a Mac with the 0022 IDE.

I can thankfully upload programs to the t85 via the CLI with avrdude. I was just hoping to make my life easier by using the IDE like I would for the Arduino....

Attach your boards.txt and programmers.txt files and I'll test here.

Here ya go…

Just to make clear, I get the same errors after I removed the HLT cores and installed yours. The info from the boards.txt file shown above is the same as the boards file I used with the HLT cores.

Additionally, the stock boards file provided with the IDE is used unaltered.

Thanks.

boards.txt (14.2 KB)

programmers.txt (431 Bytes)

The programmers.txt file does not have an entry for "usbasp". Once I added this to the file, the IDE tried to upload...

usbasp.name=USBasp usbasp.protocol=usbasp

Output...

Binary sketch size: 266 bytes (of a 8192 byte maximum) C:\Arduino\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\Arduino\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny85 -cusbasp -Uflash:w:C:\Users\BRIANC~1.001\AppData\Local\Temp\build2477736931411038472.tmp\sketch_mar05a.cpp.hex:i

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Arduino\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

Using Port : lpt1 Using Programmer : usbasp avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

That's because I am a moron. I clicked on the programmers.txt file from my old arduino installation. The usbasp -is- in the Arduino folder on 0022 which is what I am using. 0018 is still on my system. I just don't use it.

When you said 'tried' you mean it did upload or what?

That my explain some of the problems. Let’s say you’re using the Arduino Tiny core. You’ve updated the Tiny core boards.txt file to use your programmer. When the IDE searches for a matching programmer, it only searches in the programmers.txt file that came with the Tiny core. In other words, the IDE treats the two files as a matching pair. I believe you can add “arduino:” to force the IDE to search the programmers.txt that’s stored with the IDE. Something like this…

attiny85at8.upload.using=arduino:usbasp

Or, you can modify the programmers.txt file that’s in the same directory as the boards.txt file.

When you said ‘tried’ you mean it did upload or what?

I don’t have a USBasp programmer. However, I can get to the point that the IDE attempts to perform the upload. If you can get to the same point, you should be in good shape.

I've been struggling with the same error(s) and after looking at this post, it seems that in my case it was a capitalization/case issue!

Many of the "boards.txt" examples that use USBasp use this exact line (among others):


mega8mASP.upload.using=USBasp

When combined with the normal "progammers.txt" entry for USBasp of:


usbasp.name=USBasp

usbasp.protocol=usbasp

it won't work! ("java.lang.NullPointerException", etc. errors...) :0 :0 :0

Change the boards.txt entry to: mega8mASP.upload.using=usbasp (note the case change), and it works fine!

Incredibly annoying! :disappointed_relieved:

Thank you for the follow-up.

When combined with the normal "progammers.txt" entry for USBasp of

Normal in what sense? The entry most folks recommend or the one already present in "programmers.txt"?