Uploading .hex files to ATtiny85 using Arduino as ISP

Hey guys.

Basically i'm creating a 1 button keyboard, that continuously outputs a key (ie. yyyyyyyy), like when the y key is held down on a normal keyboard.

I'm making a handbrake for my racing sim and this seems like the perfect way to simply interface one button with a PC.
I'd like to avoid buying a separate AVR programmer, and I was hoping my Arduino Mega could do the job.

I've modified the "ATtiny85 USB Keyboard" project below, to output the "Y" key.
How do I burn .hex files to the ATtiny85 chip?

I also need to "set the fuses" to:

EXTENDED: 0xFF
HIGH: 0xDF
LOW: 0xC1

According to the "ATtiny85 USB keyboard" page.

Related Links:
ATtiny85 USB keyboard - the 1-Key-Keyboard project « Flip's Blog
Mega ISP - Arduino Playground - HomePage
Programming ATtiny with Arduino - Index of /

From what I know, hex files are basically the equal to binary files to a computer. In that, I mean that when uploading to AVR chips, they are normally hex files.

As far as editing them... I have no idea.

If you haven't done so already, uploading the code to ATTiny85 with the Arduino Mega is a bit silly. I'm not saying the idea is, just that it isn't like what the tutorial goes by. Instead of using PINS 13-11, you want to use PINS 50-53, which are the pins on the right side of the board. This took me awhile to find out and made me feel silly when I did in case you haven't already found out the same. Other than the pins being different, programming them using the Arduino Mega as an ISP is the same as mentioned on the tutorial: nice and easy.

If you want to get fancier, the documentation on the ISP code mentions about using PINS 9-7 for debug stuff. They aren't mentioned in the tutorial, but if you have a board you want to dedicate towards programming the ATTiny85 chips, it may come in handy for spotting any possible issues. I haven't run into any problems yet, but having the lights flicker and give positive results helps out a small amount.

Good luck on your ATTiny85 adventures!

-Flame

First post edited, i've made some progress.

Now I just have to figure out how to "set the fuses" and burn onto the ATtiny85.

You can use the following to set those fuses:

-U lfuse:w:0xff:m -U hfuse:w:0xdf:m
-U efuse:w:0xc1:m

... using avrdude.

Or if you're using AVR Studio and you have a programmer, do it through that.

KirAsh4:
You can use the following to set those fuses:

-U lfuse:w:0xff:m -U hfuse:w:0xdf:m

-U efuse:w:0xc1:m




... using avrdude.

Or if you're using AVR Studio and you have a programmer, do it through that.

I don't have a programmer, hence this thread.

Now i'm thinking this guide should work:
http://ecetechprojects.com/2011/08/06/arduino-upload-hex-files-to-attiny85-using-your-arduino-and-avrdude/

So my final command should be: (After loading the ArduinoISP sketch on the arduino)

avrdude -P comport -b 19200 -c avrisp -p attiny85 -v -e -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
-U efuse:w:0xc1:m -U flash:w:hexfilename.hex

Replacing COMport with the proper COM port (like COM3) and hexfilename with the proper name.

SO, I hooked everything up and kept getting error messages. Thinking the chip might be bad, I swapped it for the 2nd one I bought, without doublechecking my pinouts

Turns out I made the noob mistake of counting the pins wrong, and put Vcc into PIN 5.

I swapped the connections, and still the same error.
Pretty sure I fried both ATtiny85 chips
Looks like i'm triple checking my pinouts next time.

Hi Panici

Did you upload the .hex file to the ATtiny85 succesfully?

If so, how did you do that?

Hope you can help me.

Best regards

Panici:
Now I just have to figure out how to "set the fuses" and burn onto the ATtiny85.

You can set the fuses by burning a bootloader onto the ATTiny85 using another Arduino as ISP.
Select a core option with internal clock.