Difference between revisions of "AVR Drivers"

1,302 bytes added ,  15:16, 25 June 2013
Layout change plus added up to date details
m (Layout edit.)
(Layout change plus added up to date details)
Line 30: Line 30:
'''DIY SOIC clip:''' There is also an option to make the clip yourself from spare parts if you have the time, tools and precision. Translated version with a custom PCB layout provided. [http://budgetlightforum.com/node/18776 How to build a SOIC programming clip.]
'''DIY SOIC clip:''' There is also an option to make the clip yourself from spare parts if you have the time, tools and precision. Translated version with a custom PCB layout provided. [http://budgetlightforum.com/node/18776 How to build a SOIC programming clip.]


===Software===
=== Software ===


You need some kind of software to interface with the USB programmer to read or load programs into the Atmel chip.
You need some kind of software to interface with the USB programmer to read or load programs into the Atmel chip.
Line 36: Line 36:
Different operating systems will have different software available, for more info or at least some info about [http://www.ladyada.net/learn/avr/setup-mac.html Mac look here], for [http://www.ladyada.net/learn/avr/setup-unix.html Unix here]. [http://www.ladyada.net/learn/avr/setup-win.html Windows is quite straightforward.]
Different operating systems will have different software available, for more info or at least some info about [http://www.ladyada.net/learn/avr/setup-mac.html Mac look here], for [http://www.ladyada.net/learn/avr/setup-unix.html Unix here]. [http://www.ladyada.net/learn/avr/setup-win.html Windows is quite straightforward.]


You will at least need '''[http://www.nongnu.org/avrdude/ AVRDUDE]''' (AVR Downloader UploaDEr) to upload and download files to the Atmel chip. It is a command line interface (DOS). If you use Tido's programs then you don't need to compile anything: those programs are ready to be loaded. If you install WinAVR, AVRDUDE will be included. You can also install AVRDUDE separately.
==== Downloader/Uploader ====


Or if you do not like AVRDUDE and want something with GUI, you can try [http://extremeelectronics.co.in/avr-tutorials/gui-software-for-usbasp-based-usb-avr-programmers/ '''eXtreme Burner - AVR'''], download latest version at the bottom of the page under release. It can read/write (download/upload) and it also has the required driver for USBasp in the installation. If you only want to write a new firmware (already compiled Tido's, DrJones's, ...) this should be all you need.
You will at least need a downloader and uploader to modify the Atmel chip.
 
'''[http://www.nongnu.org/avrdude/ AVRDUDE]''' - It is a command line interface (DOS). If you use Tido's programs then you don't need to compile anything: those programs are ready to be loaded. If you install MHV AVR Tools/WinAVR, AVRDUDE will be included. Does not support ATtiny13A, have to use a workaround and pretend it's ATtiny13.
 
[http://extremeelectronics.co.in/avr-tutorials/gui-software-for-usbasp-based-usb-avr-programmers/ '''eXtreme Burner - AVR'''] - Or if you do not like AVRDUDE and want something with GUI, you can try eXtreme Burner - AVR, download latest version at the bottom of the page under release. It can read/write (download/upload) and it also has the required driver for USBasp in the installation. If you only want to write a new firmware (already compiled Tido's, DrJones's, ...) this should be all you need. Does support ATtiny13A.
 
==== USBasp Driver ====


You may also need to install a driver for your '''USBasp'''. I've used the cheap eBay USBasp pictured above ([http://www.fischl.de/usbasp/ a Fischl clone]) and latest driver from [http://sourceforge.net/projects/libusb-win32/ '''libusb-win32''' project]. Should work on all Windows 98 and newer. The software package has a wizard application, connect your USB device, run the wizard, select your connected USBasp and the wizard will generate a driver for that devices for you. Then install the generated driver by running it's installer.
You may also need to install a driver for your '''USBasp'''. I've used the cheap eBay USBasp pictured above ([http://www.fischl.de/usbasp/ a Fischl clone]) and latest driver from [http://sourceforge.net/projects/libusb-win32/ '''libusb-win32''' project]. Should work on all Windows 98 and newer. The software package has a wizard application, connect your USB device, run the wizard, select your connected USBasp and the wizard will generate a driver for that devices for you. Then install the generated driver by running it's installer.


If you want to customize Tido's programs you will need a C compiler configured to work with AVR equipment. (Some people write AVR programs in assembly language which gives more compact programs, but you are on your own if you go that route.) You have two options: AVR-GCC (bundled in WinAVR, MHV AVR Tools) or AVR Studio.
==== Compiler ====
 
If you want to customize Tido's programs you will need a C compiler configured to work with AVR equipment. (Some people write AVR programs in assembly language which gives more compact programs, but you are on your own if you go that route.) You have one option: AVR-GCC. Either install it with everything you need from MHV AVR Tools (optionally older WinAVR) or install Atmel Studio that contains everything you will need as well apart from AVRDUDE, AVR Studio 6.1 or older can't upload via USBasp and you will need AVRDUDE or other downloader/uploader.
 
==== Integrated Development Environments ====


'''[http://www.atmel.com/tools/atmelstudio.aspx Atmel Studio]''' - Atmel Studio (newer AVR studio, it's been renamed) is available free from Atmel to allow you to write and compile programs and load them. It has a neat interface for some programming boards, but not USBasp (it seems it still can't upload using USBasp without external tool like AVRDUDE), so if you are using USBasp, you will still need AVRDUDE to actually upload the files. The latest version is called Atmel Studio 6 which runs on Windows and uses MS Visual Studio Shell and .NET 4.0 (both installed automatically).
'''[http://www.atmel.com/tools/atmelstudio.aspx Atmel Studio]''' - Atmel Studio (newer AVR studio, it's been renamed) is available free from Atmel to allow you to write and compile programs and load them. It has a neat interface for some programming boards, but not USBasp (it seems it still can't upload using USBasp without external tool like AVRDUDE), so if you are using USBasp, you will still need AVRDUDE to actually upload the files. The latest version is called Atmel Studio 6 which runs on Windows and uses MS Visual Studio Shell and .NET 4.0 (both installed automatically).


'''[http://winavr.sourceforge.net/ WinAVR]''' - WinAVR is a free collection of all the software you need as well as a graphical user interface (GUI) to edit, compile, and load programs. [http://www.eclipse.org/downloads/index.php Eclipse IDE for C/C++ Developers] is another free GUI that goes on top of WinAVR (or MHV AVR) and is what Tido uses. It requires a plug-in that allows it to work with AVR. Follow instructions [http://interactive-matter.eu/how-to/developing-software-for-the-atmel-avr-with-avr-eclipse-avr-gcc-avrdude/ here] for installing WinAVR and Eclipse with AVR Eclipse plugin. Eclipse is optional. Then configure Eclipse for AVR. There is also a [http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin Wiki] about Eclipse AVR.
'''[http://www.eclipse.org/downloads/index.php Eclipse IDE for C/C++ Developers]''' - is a free IDE that goes on top of AVRDUDE and AVR-GCC and is what Tido uses. It requires a plug-in that allows it to work with AVR. Follow instructions [http://interactive-matter.eu/how-to/developing-software-for-the-atmel-avr-with-avr-eclipse-avr-gcc-avrdude/ here] for installing WinAVR and Eclipse with AVR Eclipse plugin. Then configure Eclipse for AVR, [http://www.instructables.com/id/How-to-get-started-with-Eclipse-and-AVR/?ALLSTEPS you can see more in this different instructable]. There is also a [http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin Wiki] about Eclipse AVR. '''AVR Eclipse seems to have glitches with latest Eclipse 4.2 Juno, use older Eclipse 3.6 or 3.7 instead'''. AVR Eclipse is again a little out of date. With 4.2 if you enter properties of your project and it wants to open with AVRDUDE settings showing it will not read them and throw you an error window, cancel and open it again, this time it will open with other settings showing and the AVR settings will load properly. I would advise you to get the latest version that AVR Eclipse plugin supports, not necessarily the latest Eclipse unfortunately.
 
==== AVRDUDE, GCC, LIBC, ... ====


'''[http://www.makehackvoid.com/project/mhvavrtools MHV AVR Tools]''' - A WinAVR replacement since WinAVR development is stopped. It has newer AVRDUDE, AVR-GCC and AVR-LIBC along with other packages. It can be used in combination with AVR Eclipse or anywhere else the same way as WinAVR as an external tool like in Atmel Studio to provide AVRDUDE or compiler (AVR-GCC) to the studio.
'''[http://www.makehackvoid.com/project/mhvavrtools MHV AVR Tools]''' - A WinAVR replacement since WinAVR development is stopped. It has newer AVRDUDE, AVR-GCC and AVR-LIBC along with other packages. It can be used in combination with AVR Eclipse or anywhere else the same way as WinAVR as an external tool like in Atmel Studio to provide AVRDUDE or compiler (AVR-GCC) to the studio.


[[File:MHV_AVR_Tools_and_Atmel_Studio_6.1_configuration_in_AVR_Eclipse.png|frame|center|MHV AVR Tools and Atmel Studio 6.1 configuration in AVR Eclipse.]]
[[File:MHV_AVR_Tools_and_Atmel_Studio_6.1_configuration_in_AVR_Eclipse.png|frame|center|MHV AVR Tools and Atmel Studio 6.1 configuration in AVR Eclipse.]]
'''[http://winavr.sourceforge.net/ WinAVR ''(not developed anymore)'']''' - WinAVR is a free collection of all the software you need as well as a graphical user interface (GUI) to edit, compile, and load programs.


As with all bundled software and drivers, they may be out of date.
As with all bundled software and drivers, they may be out of date.
Right now, MHV AVR Tools seem to be up to date but eXtreme burner AVR has bundled older USBasp driver.
Right now, MHV AVR Tools seem to be up to date but eXtreme burner AVR has bundled older USBasp driver. WinAVR is completely out of date as is AVR Eclipse plugin.


If you want tiny code, use optimization for size for your compiler configuration. GCC uses "-Os" and you can find more useful optimizations and tricks via search on AVR Freaks or elsewhere. Sometimes older GCC versions generate smaller code than the newer ones. Atmel uses AVR-GCC in it's toolchain as well, usually an older stable version.
If you want tiny code, use optimization for size for your compiler configuration. GCC uses "-Os" and you can find more useful optimizations and tricks via search on [http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=90752 AVR Freaks] or elsewhere. Sometimes older GCC versions generate smaller code than the newer ones. Atmel uses AVR-GCC in it's toolchain as well, usually an older stable version.


===BLF-VLD===
===BLF-VLD===
confirmed
36

edits