howto: Use Atmel AVR Studio 5 to make a .hex file

Don't use 6.1, it just doesn't compile these, the 5.1 as mentioned above works like a champ...go figure

Pardon me while I smack myself in the forehead and have a V8

Why do yā€™all sometimes speak English and sometimes Swahili? Or Greek? Russian? I donā€™t know what it is but thereā€™s big chunks of it I just plain canā€™t make head or tails out of!

Thanks Comfy for pointing me/us in the write direction. I have bitten off my first chunk and ordered the programmer and clip. Now I see itā€™s all in Chinenglish and barely decipherable. Oh well, off to get me a box of Capn Crunch for the mystic decoder ringā€¦

Swahili? Or Greek? Russian?

It's actually code...programming nerd language :D

All that text gobbledy gook, plug into a compiler [the copy/paste thing], the computer then takes the text (from the links above) and builds a .hex file which is the program in "computer language" the chip can then run

The ATtiny13A is actually a 20mhz computer with a 1Kb "solid state harddrive" inside it EEPROM...a very limited computer but it allows with the above coding to turn on and off different pins at different frequencies and stuff for the different levels

Makes sense. Havenā€™t looked at any of that since keypunch class. But Iā€™m game. May not be the best to start this late at night, so tomorrow Iā€™ll come back in here and start opening stuff up and digging around. Maybe Iā€™ll learn something!

Iā€™m really not as bad as all that, even though itā€™s not anything Iā€™ve done before the layout has some sense to itā€¦once I figure out what buttons to press and in what order the problem will be remembering it. :wink:

Not trying to insult your intelligence...I just find if I simplify an explanation down to where "I" can understand it...usually anyone else can too

and Google is your friend..I taught myself linux by using Google (I know it enough, more or less a "power user" the guys that write that stuff are the geniuses!)

I can always get Comfy to knock it down to size and email me the hex file. :slight_smile: Then I could hook up my big jumper cables to it and wait for lightningā€¦.ā€œItā€™s ALIVE!ā€

For a simple one like minimo all you have to change is the PWM levels. '0' is off, '255' is 100%.

So take the line in the original that says:

uint8_t modes[]={0, 8,90,255}; //PWM values, 5..255 - LEAVE THE "0" THERE

and change it to:

uint8_t modes[]={0,3,9,28,85,255}; //PWM values, 5..255 - LEAVE THE "0" THERE

(or, if you'd like to try it with the levels descending instead of ascending, do:

uint8_t modes[]={0,255,85,28,9,3}; //PWM values, 5..255 - LEAVE THE "0" THERE

and each short press will decrease one level instead of increase.)

(PWM values under 5 only work with the FETs, 7135s will sometimes work at 4 but not always reliably; stick to 5 as the lower bound for a 7135 driver)

luxdrv 0.30b works just the same, though the code is much more complex. You can edit the number of levels and their PWM values just the same. It gets more complicated if you want to do stuff like delete the ramping or strobe modes, you just have to comment out (add a '//' at the beginning of the line) the obvious stuff, then see if it builds without errors. It will tell you if anything is left behind that was tied to the part you commented out.

The software you'll need, at least to see the same things I see on my screen (that helps when following a step-by-step), is:

WinAVR: http://sourceforge.net/projects/winavr/ (install guide)

libusb-win32 for the driver for the USBASP programmer: http://sourceforge.net/projects/libusb-win32/

and AVR Studio 5.1.208. (try this: https://docs.google.com/file/d/0Bz85IxvlZQErdlpFYUhpbjYtZGM/edit - if you can get it to download, it should be the non-broken version of the installer, it's the right filesize)

This is a huge help. Parts are on order. Hope to begin in about 2 weeks from now.

Comfy, the step by step screenshots are a fantastic idea! Handholding, as it were. Thanks, this just might get me through itā€¦

I plan to install AS5 today and wade in, look around, see if I can figure it out. With some luck, Iā€™ll also attack the clip today and get the wires in the correct places for the ATiny13.

USB Programmer hasnā€™t shown up yet, but Iā€™ve ordered components for the new FET board and eagerly await the direction to order the boards themselves.

Thanks again for leading me off into parts unknownā€¦

The pics donā€™t seem to be working. Would anybody mind uploading the screenshots to an image hosting service?

When I followed the screenshots everything in mine went right along with the tutorial, up until the time to expand the Output file. Thereā€™s not a hex file there, only the .c file. So what am I doing wrong?

You need to copy the .hex file into the same directory you run the.bat file

and you need to make sure the .bat file has the exact name of the.hex file it is going to load to the ATtiny in it or it will fail

Ok, but if I am changing something in the original file, say 30 second Turbo Timer from 60 second, and I want to creat a new .hex file, I went through the steps just like Comfy shows and when I build it it comes through error free but there is no .hex file in the output file in the upper right hand corner to save anywhere.

If your build was successful, there should be a hex file in your project directory. (my documents\Atmel Studio\project name\project name\debug\
Can you please look if there are any files in that directory?

There are files in there, GCC files, C files, and more, but no .hex.

Try this:
when you have code ready -> Ctrl+F7 and then if no errors -> F7

I have no idea what expanding the output file is, but the hex file will be together with about 8 other files in your project's DEBUG folder.

^^^ That step.

When you double-click the 'Output Files' header, what's in the list? They're hidden when that item is collapsed.

And which exact version of AVR Studio are you using?

I copied the C file that I have and applied it to a new project, project number 5. I ran it, it completed, and again there is nothing except the .c file in the output area. The output area cannot be expanded, having only that one file under it.

However, this time, in the Documents folder under ACCG5 in the debug folder there ARE multiple files, including the .hex file. :slight_smile:

Now I need to figure out how to flash that to the mcuā€¦ baby steps for small minded people (or drain bamaged people, your choice)

Finally found the SCK wire from my clip was not making contact in the block, now that itā€™s working Iā€™m thinking about soldering all the little blades to the wires. That was far more aggravating than should have been possibleā€¦

Double-click the line that says 'Output Files', or click the little white arrow next to it. By default it is collapsed and you cannot see the list of files as it looks in my screen cap.