Difference between revisions of "AVR Drivers"

1,588 bytes added ,  21:57, 29 April 2011
what the AVRDUDE commands mean
(need GND to be connected)
(what the AVRDUDE commands mean)
Line 134: Line 134:
<PRE style="white-space:normal;">avrdude -p t13 -c usbasp -u -Uflash:r:flash-dump.hex:i -Ueeprom:r:eeprom-dump.hex:i -Ulfuse:r:lfuse-dump.hex:i -Uhfuse:r:hfuse-dump.hex:i</PRE>
<PRE style="white-space:normal;">avrdude -p t13 -c usbasp -u -Uflash:r:flash-dump.hex:i -Ueeprom:r:eeprom-dump.hex:i -Ulfuse:r:lfuse-dump.hex:i -Uhfuse:r:hfuse-dump.hex:i</PRE>


The command above will create 4 files on your hard drive for the flash memory contents, eeprom, high fuses, and low fuses.
The command above will create 4 files on your hard drive for the flash memory contents, eeprom, high fuses, and low fuses.
-U tells the programmer to perform a memory action, followed by the type of memory ("flash", "eeprom", "lfuse" for low fuse (that's not the number 1), or "hfuse" for high fuse). The :r: part of the command tells the programmer to <u>r</u>ead settings into the files. And "i" tells it to format the files in Intel hex. See [http://www.nongnu.org/avrdude/user-manual/avrdude_4.html these AVRDUDE instructions] for a complete list of commands and meanings.


==Upload new settings==
==Upload new settings==
When you upload new settings, you are wiping out the settings that the driver came with (that's why it is good to make a backup as written above). Therefore if there are stars on the back that you have connected to get different mode combinations, that will be ignored (the stars are connected to legs of the Atmel chip that won't be used).
Open a command window in one of the BLF-VLD subdirectories: "Fixed Modes", "Programmable", or "Simple". With everything hooked up, enter this command:
Open a command window in one of the BLF-VLD subdirectories: "Fixed Modes", "Programmable", or "Simple". With everything hooked up, enter this command:


<PRE style="white-space:normal;">avrdude -p t13 -c usbasp -u -Uflash:w:BLF-VLD.hex:a -Ueeprom:w:BLF-VLD.eep:a -Ulfuse:w:0x79:m -Uhfuse:w:0xef:m</PRE>
<PRE style="white-space:normal;">avrdude -p t13 -c usbasp -u -Uflash:w:BLF-VLD.hex:a -Ueeprom:w:BLF-VLD.eep:a -Ulfuse:w:0x79:m -Uhfuse:w:0xef:m</PRE>
The :w: part of the command tells the programmer to <u>w</u>rite settings from the files for flash memory and eeprom and to set the values of the low and high fuses to the hexadecimal values shown. :a is for automatic file type detection, :m indicates "immediate mode" (use the hex values given).


==Compile your own code==
==Compile your own code==


If you use the standard BLF-VLD files, you don't need to compile anything. But if you write your own code or modify the BLF-VLD files, you will need to compile your own files.
If you use the standard BLF-VLD files, you don't need to compile anything. But if you write your own code or modify the BLF-VLD files, you will need to compile your own files. By doing this you can have different numbers of modes, different brightness levels, turn off the memory function so that the light always comes on in the same mode, etc.
 
To customize the interface, use the file driver.c in the BLF-VLD directory. This file has code for all 3 standard configurations in one file. There is a good example of how to configure a light to 4 fixed modes with no memory [http://budgetlightforum.com/node/799?page=5#comment-33536 in this comment] to the main thread.


==Other Issues==
==Other Issues==
confirmed, developer
1,668

edits