Difference between revisions of "AVR Drivers"

177 bytes added ,  22:32, 29 April 2011
no edit summary
(what the AVRDUDE commands mean)
Line 34: Line 34:
Tido created the original files that can be used, called the BLF-VLD (Budget Light Forum Versatile LED Driver). If you go to the first entry of the thread [http://budgetlightforum.com/node/799 How To Build a Flashlight With Perfect Modes], you will find a link to the latest zip archive of the files you need. This zip archive includes a helpful readme file.
Tido created the original files that can be used, called the BLF-VLD (Budget Light Forum Versatile LED Driver). If you go to the first entry of the thread [http://budgetlightforum.com/node/799 How To Build a Flashlight With Perfect Modes], you will find a link to the latest zip archive of the files you need. This zip archive includes a helpful readme file.


Without writing any code, you can choose from three setups that Tido has already written:
Without writing any code, you can choose from three configurations that Tido has already written:


'''Simple''' is a 3-mode setup with Low, Medium, and High. It includes mode memory (if light is on for 2 seconds or more, the mode is memorized when the light is turned off) and a low battery warning.
'''Simple''' is a 3-mode setup with Low, Medium, and High. It includes mode memory (if light is on for 2 seconds or more, the mode is memorized when the light is turned off) and a low battery warning.
Line 41: Line 41:


'''Programmable''' allows you to assign any of the extended modes to your 3 simple modes.
'''Programmable''' allows you to assign any of the extended modes to your 3 simple modes.
This archive also has a very good README file in the "docs" folder which explains about the code and the three different configurations.


==Getting Ready==
==Getting Ready==
Line 81: Line 83:
|9  ||  '''MISO'''  ||  GND  || 10   
|9  ||  '''MISO'''  ||  GND  || 10   
|}
|}


[[File:Ribbon.jpg|thumb|The ribbon port at the end is disassembled and wire 8 is moved over to the 9th position]]So Wire 1 (MOSI) of the ribbon cable from the programmer must attach to Pin 5 of the Atmel. Make sure you mark which side of the clip attaches to the top of the Atmel or everything will be misaligned next time you use it. Line up RST and SCK with their appropriate wires. But notice that MISO on the programmer is Wire number 9 and the ribbon only has 8 wires. You will need to disassemble the end of the ribbon cable at the controller end and move wire 8 over to the 9 position so that MISO lines up correctly.
[[File:Ribbon.jpg|thumb|The ribbon port at the end is disassembled and wire 8 is moved over to the 9th position]]So Wire 1 (MOSI) of the ribbon cable from the programmer must attach to Pin 5 of the Atmel. Make sure you mark which side of the clip attaches to the top of the Atmel or everything will be misaligned next time you use it. Line up RST and SCK with their appropriate wires. But notice that MISO on the programmer is Wire number 9 and the ribbon only has 8 wires. You will need to disassemble the end of the ribbon cable at the controller end and move wire 8 over to the 9 position so that MISO lines up correctly.
Line 95: Line 96:
   avrdude -p t13 -c usbasp -n
   avrdude -p t13 -c usbasp -n


The command above calls up avrdude. "-p t13" means you are talking to an Atmel ATTiny13A chip. "-c usbasp" says you are using the USBASP controller. "-n" means no writing, since we're not actually doing anything yet. With USB, you shouldn't have to enter the port number, but some people have to go find out what port the USB is assigned to and if it is Port 2, they add "-P com2" after usbasp.


The command above calls up avrdude. "-p t13" means you are talking to an Atmel ATTiny13A chip. "-c usbasp" says you are using the USBASP controller. "-n" means no writing, since we're not actually doing anything yet. With USB, you shouldn't have to enter the port number, but some people have to go find out what port the USB is assigned to and if it is Port 2, they add "-P com2" after usbasp. This should generate a message that the AVR device is initialized and ready to accept instructions. If the connection is not working, you will get something like  
The command above should generate a message that the AVR device is initialized and ready to accept instructions. If the connection is not working, you will get something like  




Line 108: Line 110:
   avrdude done.  Thank you.
   avrdude done.  Thank you.


 
So if you get that, check your clip wiring and make sure your clip is getting a good connection. The clips are very finicky and sometimes need some repairs. You can check continuity with a DMM from an individual tooth on the clip back to the pad on the USB board.
So if you get that, check your clip wiring and make sure your clip is getting a good connection. The clips are very finicky and sometimes needs some repairs. You can check continuity with a DMM from the tooth back to the pad on the USB board.  


If everything is working you will get a message like the following:
If everything is working you will get a message like the following:
Line 127: Line 128:


Once you get the message that everything is working, you can move on to the next section.
Once you get the message that everything is working, you can move on to the next section.


==Download settings==
==Download settings==
confirmed, developer
1,668

edits