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

Added a paragraph at the top with links to the free-to-use firmwares.

Great help, thanks

Tido's code is missing

#define F_CPU 4800000 in the BLF_VFD zip file

It fails to compile the driver.c code in the main dir, the sub directories (Fixed Modes, Programmable, Simple) have pre-compiled .hex files in them based upon the default driver.c code, has 3 mode levels...I compiled one with the mode setting to 5 with nothing else changed (but it's untested)

This is under Atmel Studio 6.1

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.