AVR-Projects

by Martin THOMAS

G.d.W. SS2010 FHFFM

You may like to visit my ARM-Projects page too (projects and information for NXP LPC2000, Atmel AT91SAM7, STmicro STR7, STM32, LMI LM3S and other controllers with an ARM-core). Last update in the ARM-section: 25. Apr. 2012.

Available Projects and Information (Content)

"Last updated" may be just additional information not always a new version of a software-package.


AVR Butterfly Application code port to avr-gcc

Introduction

The AVR Butterfly (ATAVRBFLY) made by ATMEL comes with a preloaded application. The application source-code can be downloaded from the ATMEL Web-Site (AVR Butterfly - Application Rev07). It is written for the IAR EWAAVR 4.20a C-Compiler. This is a port of this code to avr-gcc using the avr-libc. Links to avr-gcc, avr-libc and the Windows-Distribution of the toolset (WINAVR) can be found here.

For german readers: Der Quellcode der auf dem AVR-Butterfly installierten Applikation wird von ATMEL für den IAR C-Compiler zum Download bereitgestellt. Anwender denen dieser Compiler nicht zur Verfügung steht, finden auf dieser Seite eine Portierung des Quellcodes auf den frei erhältlichen Compiler avr-gcc unter Verwendung der ebenfalls freien Bibliothek avr-libc. Falls Sie MS-Windows Anwender sind, finden Sie alle notwendigen Werkzeuge in der Sammlung WINAVR. Den gcc-Quellcode der Butterfly Applikation finden Sie zum Download weiter unten. Bitte nutzen Sie die neuste Version (=Download mit jüngstem Datum).


Even if you do not own an AVR Butterfly you may find usefull information in the BF application code for general ATMEL AVR development tasks.

From the gcc-port of the application code some methodes how to convert IAR-code to avr-gcc/avr-libc-code can be learned.

Butterfly gcc-port history

Application gcc-Port - last ChangesDate
Added patch for GCC 4.73. Jul. 2012
Release of version 0.7.617. Dec. 2009
Release of version 0.7.515. Aug. 2009
Release of version 0.7.32. July 2009
Link to Joe Pardue's Butterfly Alternate Pin Uses document28. Aug. 2007
Version 0.7.2, see readme-file for details17. May 2007
Minor update in Version 0.7.1 (only comments)8. Feb. 2007
Version 0.7.131. Jan. 2007
Marked version 0.6.6.1 as latest version22. Aug. 2006
Example-application Joystick/LCD/Variables24. Apr. 2006
Preliminary Release 0.6.6.1 (for avr-libc 1.4.3), modified some examples to avoid compiler-error with avr-libc 1.4.3 (WinAVR 20060125)28. Jan 2006
uart_echo-Example: Fix in OSCCAL-Calibration23. Jan 2006
Release of Version 0.6.6 (includes AVRStudio-workspace for AVRStudio >= Version 4.12)9. Jan 2006
Link to AvrFlasher for OS X and Linux (Java) in the Programmer/Flashing section6. Dec 2005
Added link to a camera remote control project with a BF19. Oct 2005
Remark about DIDR0 and LCD operational voltage in the Information-Section24. Aug 2005
Update of Joystick-Interfacing with GPIO Demo5. July 2005
Two small Demos: Joystick-Interfacing30. Jun. 2005
Fixed LCD-test example (case sensitive make in WinAVR 2/05). Fixed UART-echo example (SFR labels as in iom169.h of WinAVR 2/05)25. May 2005
Added link to the "AVR Butterfly MP3"-project15. Feb. 2005
Example Application by Chalermphol Thammapalerd using Salvo RTOS on the Butterfly25. Nov. 2004
Added links (book sample chapter, carrier board)16. Nov. 2004
New Version 0.6.527. Aug. 2004
Interims Version to fix incompatiblity with avr-libc 1.0.4 (as in WinAVR 20040720)20. Jul. 2004
Fixed avrdude command-line example (Thanks to Tobias Jahn)15. Jun. 2004
Anmerkungen zum Artikel im Linux-Magazin 07/04 (in german)12. Jun. 2004
New version of Richard Wynn's application (HVAC) now with SHT11 readout. Fixed power-save issue in old version.10. Jun. 2004
Information about using the JTAG-Pins for general-I/O and AD-conversion1. Jun. 2004

Software



Butterfly resources (local and remote)

Programmer/Flashing

Code and packages derived from the AVR Butterfly gcc-port

Butterfly information and documents


AVR Butterfly based Data-Logger

AVR Butterfly: low-power-controller, on-board 4Mbit Dataflash, simple "human-interface", A/D converter on-chip, some free I/O-pins: predetermined to be used for data-logging. The Data-Logger has its own page.

A modified version of the datalogger is in use as a motor-current logger for a robot. See some pictures on this page.


AVR Butterfly Bootloader code port to avr-gcc

The AVR Butterfly (ATAVRBFLY) made by ATMEL comes with a preloaded bootloader to upload applications via RS232 from AVRStudio's AVRPROG. The bootloader source-code can be downloaded from the ATMEL Web-Site ( AVR Butterfly - Bootloader Rev02). It is written for the IAR C-Compiler. This is a port of the bootloader code to avr-gcc using the avr-libc.

Please use the latest version of the toolchain (avr-gcc 3.3.1 or newer, avr-libc 1.4.x or newer, WinAVR Jan. 2007 or newer) to compile and link the code. Older versions will cause problems. Make sure to re-enable the SPM lock for the bootloader section after flashing the bootloader. Please read the text in file readme.txt included in the archive for more information. Feedback and bug-reports are welcome.

Old versions:

The bootloader can be used with other AVR devices, just change the "start bootloader" condition and UART initialisation to your needs. They are adapted to the AVR Butterfly in the given source ("joystick" and calibrated internal clock from 32kHz clock-quarz). I've tested modified versions of the bootloader with an ATmega16 and ATmega8. Since block read/write is used the bootloader might be faster than others on uCs which support this method.

Butterfly Bootloader Resources


AVR DB101 example-application gcc-port and DB101 resources

The Atmel AVR DB101 (ordering code ATAVRDB101) is a small module with an AVR ATmega1281 microcontoller, a 128*64 graphics display and some additional hardware (i.e. joystick, piezo-"speaker", level-shifters for logic and RS232, Dataflash memory). More information on the hardware can be found in application-note AVR481. The schematic is available from the associated files-package (AVR481.zip) to the application note.



The device comes with a preinstalled demo-application ("production demo A"). A description of the application and the used driver-library can be found in the software user's guide (application note AVR482). The source code is available in the software-package (AVR482.zip) to this application note. The code provided by Atmel is for the IAR AVR toolset (IAR EWARM/iccavr-compiler).

I (Martin Thomas) have modified/ported the library and demo source-code to be compatible with the AVR "GNU-toolchain" (avr-gcc using the avr-libc). Windows users will find all needed tools in the WinAVR package. Atmel's AVR-Studio can be used as IDE. Since a compiler abstraction layer" (CAL) has been added the source available here is more than just a gcc-version but offers support for both toolsets, either GNU avr-tools or IAR's EWAVR toolset can be used without further modifications. The CAL might be useful for other projects where IAR and GNU tools for (8-bit) AVR are used.

Download the source-package of the DB101 example-application's gcc-port [here].
(timestamp 20080301, All source-files, "stand-alone" makefile, AVR-Studio- and EWAVR workspace-files are included. Please see included readme_mthomas.txt for further information. )

AVR DB101 links:

Changlog




AVRPROG compatible bootloader for ATMEL ATmega Controllers

This bootloader-code is based on the Butterfly-Bootloader an has been extended and ported to avr-gcc/avr-libc. Programming Software is AVRPROG (in the tools menue of AVRStudio or as standalone application) or any AVR109/AVR910 compatible programming software (like i.e. avrdude, the AVR910 and AVR109 protocols are a little different but most commands are the same). The "Version 0.8"-series of the bootloader has been tested with ATmega8, ATmega16, ATmega169, ATmega32, ATmega128 and AT90CAN128. Support for other AVRs can be added using the definitions for the supported devices as templates. configuration is done in the makefile and in main.c

And yes, this bootloader can be used for "bootice"-boards to program the JTAG firmware to an ATmega16 without verify error.

A non-free version of the bootloader with encryption (XTEA, 128 Bits Key) is also available. This bootloader can be used with Atmel's AVRProg (comes with AVRStudio but can be used as stand-alone application) and avrdude. The firmware fits into a 1024 Words boot-section. Included in the packed as the full source-code of the bootloader-firmware (avr-gcc) and the PC-application (portable C-Code) to encrypt the firmware. Please send an e-mail if you are interested. A binary-only demo-version is also available (for ATmega16).


Clock with a character-LCD and large letters

A clock driven by an Atmel AVR which displays the time in larger letters using user-defined characters on a industry-standard character/textmode-LCD (Hitachi HD44780 or compatible). More on this page.


AVR - SED1520 and ST7565 GLCD-Library

A device driver written in C (avr-gcc) to interface Atmel AVR-mirocontrollers with SED1520- and ST7565- based graphics display-modules. More on this page


A slightly extended version of Peter Fleury's Text-Mode-LCD library

Peter Fleury has done a very nice and easy-to-use avr-gcc library to drive Hitachi HD44780 and compatible Text-Mode LCD-displays with AVR microcontrollers. I've done some small extensions to make "auto-warp" compatible with the Displaytech 164A LCD-Module (available e.g. at www.reichelt.de) and added a scroll-up function. With scroll-up and the added feature auto-scroll you can print e.g. debug-messages on the display without taking care of the cursor position. Get the source-code here (timestamp 20050602, avr-libc 1.2.3 compatibility-fix). A (crude) demo-program together with a makefile for avr-gcc (WINAVR) to drive a Displaytech 164A with an AVR ATmega16 is included. A document how to connect a HD44780 or compatible display to the Atmel STK 500 is included in the archive.

Andreas Heinzen has contributed an extended version of the library. He corrected some timings-issues to make the library compatible with an at90s2313 and Displaytech162 display-module, added an 8-bit interface and support for 2-line scrolling. Get Andreas's library here (timestamp 20050818).


Maxim/Dallas DS18x20 Temperature-Sensors readout with AVR

Demo application to read DS1820, DS18S20 and DS18B20 temperature-sensors with an Atmel AVR controller. More information and source-code on this page.


Timer-based AVR Software-UART

Some AVRs do not have a hardware-UART others have one or two. In case a UART is needed on "non-UART" AVRs or the available hardware-UARTS are not enough to fullfill the project-needs a software-UART can be used. The software-UART available here is based on the "gerneric software uart" by Colin Gittins which can be downloaded from the iar.com website in the application-notes section. I have ported/adapted this code to AVRs using avr-gcc/avr-libc and fixed some smaller mistakes. This code does not need an external interrupt-pin for the RX-line - any input-pin will do. But the RX pin gets sampled three times the baudrate so more process-time is needed compared to an "external-int" approach as presented in various Atmel Application-Notes.

Get the latest version of this "softuart-library" including a demo-application here (timestamp 20101010).

Version History:


VT100 Terminal Driver

This is a port of the Atmel VT100 terminal-driver to avr-gcc/avr-libc. Nothing special but maybe useful. I've extended the example-application a little bit too. Get the library's source including a demo-application here (timestamp 20050821).


Eversmith - AVRSMS

Firmware to send and receive Short Messages (SMS) in a GSM-Network using an AVR-ATmega microcontroller from ATMEL and an AT-command compatible GSM-Phone/Module. The software supports the SMS-PDU-Mode. Written in Assembler using AVRStudio4. Proceed to this page to get more information and code.


The Blinky Toys - "Fun with LEDs"

Some "light-toys" I made mainly as xmas or birthday gifts. So far these are:


CAN-CAN AVR and Controller Area Network

AVR "dances the CAN-CAN". CAN (Controller Area Network) projects with Atmel AVR microcontrollers can be found on this page.


AV/Rf Wireless/RF-Data-Link between AVRs

Preliminary - more Information on this page.


Interfacing Atmel AVR microcontrollers with RFM22 ISM transceivers

More Information on this page.


Port of the Atmel BC100 example code to avr-gcc/avr-libc

The BC100 [ATAVRBC100] is a reference design that demonstrates charging and discharging of two batteries/battery packs with a programmable charge voltage up to 40V. Futher information can be found on the BC100-page at atmel.com. Atmel provides two demo-applications which demonstrate charging for NiMH- and LiION-batteries (Application notes AVR463 and AVR 458). The code available from Atmel has been created for the IAR EWAVR toolset. Kevin Rosenberg created the initial avr-gcc/avr-libc-port of this code and I have made some modifications and extension. I also created a small demo-application for the second AVR on the board which is an ATmega644 connected to the ATtiny861 that is as chargeing-controller.

Kevin Rosenberg's avrcode-site hosts a git-repository and there is also a souce-package available. Here I just host a backup-archive which may not be the latest version and just reflects the state when I have modified the code the last time.

Downloads:


Digitally Addressable Lighting Interface (DALI)

Interfacing the Digitally Addressable Lighting Interface (DALI). More Information on this page.


Experimental avrdude Versions

Some experimental versions of the AVR programming software avrdude This versions are for testing only and not supported by the main avrdude developers. Please do not send bug-reports or questions about this versions to the avrdude-dev- or other mailing-lists. Please send feedback and bug-reports to the e-mail address given at the end of this page.

All packages include the source-code and a Win32-binary so you can test avrdude without compiling from source. Make sure that you have installed give-io if you test the software with printer-port "dongles" (i.e. STK200-adapter) on Windows NT/2000/XP. give-io is included in the source archive, see subdirectory windows.


Evertool: An AVR In-System Programmer (ISP) and JTAG Programmer/Debugger

Evertool is an all-in-one AVR programming and debugging device. It is compatible with the ATMEL AVRISP programmer (and mostly with the STK500 in low-voltage-serial-programming) and the ATMEL JTAGICE debugger/programmer. Evertool uses the original ATMEL firmware code supplied with AVRStudio on an ATmega16 (JTAG) and ATmega8535 (ISP). Read more about the Evertool on this page.


ispRE: Self-made AVR In-System Programmer (ISP)

A programmer compatible with the original AVRISP device (and mostly with the STK500 in low-volatage-serial-programming). The programmer is based on an ATmega8535 controller and the original ATMEL AVRISP/STK500 firmware is used. An ATtiny2313 serves as internal update-controller for the ATmega8535 firmware. Read more about this project on this page.

Selbstbau AVR Mikrocontroller Programmiergerät, kompatibel zum original ATMEL AVRISP. Mehr dazu auf dieser Seite.



PonyProg und STK200-ISP-Programmieradapter

Kurzanleitung im Wiki von mikrocontroller.net (sorry, only available in German language).

avr-gcc Tutorial wiki.mikrocontroller.net PDF-Version

PDF-Version des avr-gcc Tutorials aus dem mikrocontroller.net Wiki. Stand 12. Okt. 2009. (sorry, only available in German language).

The ARM-projects and WinARM moved to the ARM-Projects-Page.




Martin Thomas
mail-adress as bitmap/antispam



Last mod.: