I sell on Tindie

Some boards are still available at ebay

(temporary title) AVR Stick PROTOTYPE

(temporary title) AVR Stick PROTOTYPE

Universal AVR XMega dongle with exchangeable bootloader.
Program in your browser without any further equipment or software!


From now on News can be found in a dedicated section.


(I will improve this text with more details in the near future:)

AVR stick (a more suitable name is not found, yet) is an easy-to-use, minimalistic AVR ATxMega microprocessor board/breadbord extension with fullspeed USB interface (available to implement any USB device in your firmware).
It can be programmed on your computer via assembler, C and of course BASCOM - but it needs not to be:

The special feature of the board is that it requires no drivers or programming software (such as AVRDUDE).
The board also provides some GPIO ports. These are routed to the core IC in a specific way, so all technologies on the ATxmega128A3U can be "tasted".
Therefore the board is suited for beginners, who want to play around with microcontrollers. But it might also be interesting for more experienced users who want to implement and test their own USB devices.

A bootloader is installed by default, which enumerates the board as an USB stick. By pressing the PROG-button during a RESET, you can enter its bootloader mode.
There all the memories in the boards ATxmega128A3U (FUSES, {production-, user-}signature, FLASH and EEPROM) are accessable as files.
Changing / overwriting a file then corresponds to the programming of the specific memory. Of course just reading is possible, too!
Since the bootloader also offers an update functionality, you always can benefit from all upcoming features.

So for example the board (without having any driver software installed on the computer) can a be programmed directly in the browser.
The assembled firmware is then simply downloaded to the dongle.

However the board is not limited to being programmed in the browser.
You also can use an AVR compiler to program it in your preferred language with your preferred IDE. To install your firmware on the board, just overwrite FIRMWARE.BIN with the binary file produced by avr-objcopy.
If you like using Atmels FLIP (Appnote AVR1916) protocol better for transfering your firmware onto the board: There is an update firmware for exchanging the bootloader provided here.

Of course there are also ready-to-use examples provided here, which turn the stick into useful tools (like an AVR ISP MKII PDI programmer).

This project is still at the very beginning (even if a lot of stuff already works) - so expect frequent changes here!
Also in case want want to help: You are very welcome!

go to: the top of this page


New! Bootloader version 20140711T1500ZSB available, now! (Bug in previous versions discovered.)

News! I am in the mood of porting the "usb-flash-drive" bootloader to other AVRs

In more detail: I assume it is feasible to port the bootloader (brackets means I am confident but not sure) to
(ATxmega64A1U), ATxmega128A1U
(ATxmega64A3U), ATxmega192A3U, ATxmega256A3U,
(ATxmega128A4U), (ATxmega64A4U), ATxmega128A4U,
(ATxmega64B3), (ATxmega128B3)
(ATxmega32C3), (ATxmega64C3), ATxmega128C3, ATxmega192C3, ATxmega256C3, ATxmega384C3

So if you'd like your favourite ATxmega to be accessable as a flash drive, and if it is on the list:
You may donate me some (1..3) of the target ATxmegas for debugging and testing (more information via stephan[at]matrixstorm.com - or contact me here).
I will try to port the bootloader to it and provide the hexfiles (and possible updates) here or on a dedicated webpage.

News! Pictures using AVRStick on MAC added

I really would like to find a final name for this project/stick.
Please send me all your ideas to stephan[at]matrixstorm.com (or other via other ways to contact me).
Emphasize the topic in the mails subject ("avrstick final name").
After receiving enough suggestions, I will start a poll.
The author of the winning name will then receive a rev2 board for free!

go to: the top of this page





Other layouts using the same bootloader/software - modified TQFP64 Adapter:




go to: the top of this page

Tested systems:








go to: the top of this page

Layout and schematic:





go to: the top of this page


go to: the top of this page

Default firmware image for being external programmed

When you build your own device, you need to install this firmware with an external PDI programmer to the AVR. (Be)for(e) transfering the image, please be aware of following bulletpoints:

Current examples and firmwares (except the alternative bootloader Atmel Flip) are based on / or utilize LUFA 130901 Library.
Please note its MIT license.
The default (massstorage) bootloader is NOT related, nor compatible to LUFA's bootloader demo.

go to: the top of this page

The bootloader

The core of avrstick is its unique bootloader, which of course also can be used in other layouts then avrsticks default one.

In normal mode the bootloader simply starts up the firmware, the user programmed into the AVR last time using the program-mode.

Additionally the bootloader implements some API, which can be used for example to write-access the flash from inside your own firmware.
This also makes it possible to provide migration- and update-firmwares (an application-section-firmware which exchanges the bootloader during its own execution).
With migration firmwares the bootloader can be either exchanged with some complete other bootloader:
For example switch out the default MassStorage bootloader with Atmels FLIP.
Or the bootloader can be exchanged with some other version of itself - this way the user always can maintain recent patchlevel and feature set.

By pressing the PROG button (effectively putting PF7 to GND) during a reset or power-up, the program-mode will be entered:
There the bootloader impersonates an usb flash drive and maps all the different memories and data of the AVR as fat12 filesystem in there.
Because most platforms support usb flash drives without any driver installation, the AVR can be used very comfortably by just operating on files.

List of files (20140711T1500ZSB)

A subset of files even is writeable, so memories like eeprom or the flash's application section can be programmed.
Everytime the bootloader gets reset, it restores the original set (and size) of files - their contents are preserved as they belong to specific memories in the AVR.

The list of files provided by the latest version 20140711T1500ZSB is as follows:

Readonly files
Currently contains a short greeting and the latest URL to the project.
Basically it is a short message delivered within the bootloader
This file is for hard- and software identification purposes.
It contains 4 rows of data, always padded to 16bytes per row.

The first row contains Atmels chip signature of the used AVR microprocessor.
When using ATxmega128A3U it should be "0x1e 0x97 0x42 0x06 0xff"

The second row contains the fuse- and lockbit values.
Since fuse3 and fuse6 are not implemented in ATxmega, they should read as value "0x00".
Address 0x17 equals the lockbits. The higher 8bytes of this row are padding.

The third row contains the magic value in little endian, which the bootloader uses to access the apipage.
When using avrstick it should be "0x80 0xff 0xff 0xfd"

The fourth and last row contains a 16byte ASCII string about the bootloaders version, time and who compiled it.

This file corresponds to the AVRs Production Signature Row.

The production signature row is a separate memory section for factory programmed data.
It contains calibration data for functions such as oscillators and analog modules.
Some of the calibration values will be automatically loaded to the corresponding module or peripheral unit during reset.
Other values must be loaded from the signature row and written to the corresponding peripheral registers from software.

The production signature row also contains an ID that identifies each microcontroller device type and a serial number for each manufactured device.
The serial number consists of the production lot number, wafer number, and wafer coordinates for the device.

This file represents the write protected part of the AVR's flash memory.
It contains the executable code of the bootloader currently running.
Read- and writeable files
This file contains the code executed when leaving the program mode.
It corresponds to the application section of the AVRs flash memory.
Currently its maximum size can be up to 120KiB.

The Application section is the section of the flash that is used for storing the executable application code.

This file corresponds to the AVRs internal EEPROM, and can contain up to 2KiB of non volatile data.
This file corresponds to the AVRs USER signature, and can contain one page (512byte) of non volatile data.
Additional 512 byte of volatile data (SRAM) can be added.

The user signature row is a separate memory section that is fully accessible (read and write) from application software and external programmers. It is one flash page in size, and is meant for static user parameter storage, such as calibration data, custom serial number, identification numbers, random number seeds, etc.


Bootloaders used on avrstick implement a specific page, allowing normal firmwares to utilize some of the bootloaders functionality.

This way you can enable your firmware to do things (like writing to the flash), which normally is impossible due to hardware restriction.

This text will be extended in future, for now I will present you the API + example only - more detailed explanations will follow.
At least you do not need to wait any longer for the essential files. To use them, just include apipage.h and link against the library apipage.a.

apipage.h, apipage.a, example.c, Makefile

go to: the top of this page


Current examples and firmwares (except the alternative bootloader Atmel Flip) are based on / or utilize LUFA 130901 Library.
Please note its MIT license.
The default (massstorage) bootloader is NOT related, nor compatible to LUFA's bootloader demo.

go to: the top of this page

Hexfile to binary converter

Even it is possible to program directly in your browser, avrstick is not limited to this application.
You also can use your normal AVR tools to implement firmwares for it: Atmel Studio, WinAVR, Bascom ...etc...

Althought most of these programming tools offer support for binary output, you may want to use hexfiles, too.
A simple-to-use converter for this purpose is offered in this section.

go to: the top of this page

Programming in the browser

One very special feature of avrstick: It comes by default with a bootloader, which enumerates the board as an USB stick.
This way it doesn't require any extra drivers, plugins or programming software.

Here are a few examples you can programm directly in your browser.
Feel free to change the source code however you like it.
The firmware will be compiled and offered as a download to you - simply save it to the dongle.

Current examples and firmwares (except the alternative bootloader Atmel Flip) are based on / or utilize LUFA 130901 Library.
Please note its MIT license.
The default (massstorage) bootloader is NOT related, nor compatible to LUFA's bootloader demo.

go to: the top of this page

LUFA License Text (taken from LUFA 130901)

                  LUFA Library
        Copyright (C) Dean Camera, 2013.

     dean [at] fourwalledcubicle [dot] com

Permission to use, copy, modify, and distribute this software
and its documentation for any purpose is hereby granted without
fee, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

The author disclaims all warranties with regard to this
software, including all implied warranties of merchantability
and fitness.  In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.

go to: the top of this page

The avrstick project needs you!

This project is kind of a complex thing.
There is hardware design and construction on the one hand - firmware bugfixing and feature improvement of the bootloader on the other.
But not enough: There are also example firmwares to be programmed, descriptions and explanations to be written and websites/servers to be maintained.
There is media and PR (actually some youtube-videos would be great) and the web IDEs could use further improvement, too...

I am just a single guy at the moment and really could need more helping hands!
(Also I am not really into this webdesigning stuff, as you might have noticed.)

If you became interested, or if you have other ideas:
Become active on the project - Make the first step: Contact me!.


In case you have any problems/trouble and/or need some help,
in case you have remarks or you want to participate avrstick-project,
in case you need some parts to build your own avrstick,
you can contact Stephan Bärwolf via:

If you want to use PGP, my key-id is 0xFB9B12DB.
The corresponding fingerprint must be: 2252 B41E 12DF 41AD 476F 7F36 084A 0911 FB9B 12DB

go to: the top of this page

last change: 2015-03-07T16:00Z