Page 1 of 1

Audio Bootloader

PostPosted: Sat Sep 03, 2011 5:17 pm
by chris
Audio Bootloader for Atmega Microcontrollers

It is possible to load a programm into an AVR-microcontroller over the audio interface of a PC or laptop:

The bootloader presented here has the following features:

- automatic Baudrate detection and callibration
- works without callibration with 8Mhz or 16MHz sysclk ( possibly 1MHz, not testet )
- very simply hardware circuit: 2 resistors and a 100nF capacitor to connect to the audio line
- only one pin for data transmission needed and an additional pin for a status led
- low memory footprint: 800 bytes
- java program to generate the sound, works on win and linux

As line coding scheme Manchester-coding is used. With this type of coding we achieve only half the transmission speed than with "Flankenkodierung" used in Soundrxtx. Therefore the mean value of the signal is more stable and no calibration potientiometer is needed.

- coding scheme changed to differential manchester code ==> works on all PCs with inverted audio out
- ATMEGA8 and ATMEGA168 support
- java programmer with 1/2 speed added ==> possible to generate MP3s ( setup to 320kBit/s kompression )

have fun,

Re: Audio Bootloader

PostPosted: Tue May 01, 2012 11:08 am
by chris
Here is an interesting project able to generate directly bootloader sound.
It is a web browser based programming language

Re: Audio Bootloader

PostPosted: Sat May 12, 2012 8:55 am
by chris
Audioboot for the ping pong game with an Atmega8 controller

( ... /ping-pong)

The swiching level of my ping pong game was at 1.4V with 5V power supply.
Therefore you have to adept the voltage divider resistors to your ping pong game.
The best is probably to use a potentiometer.

Atmega8 Bootloader 512 Words, Boot Address $0C00

ATMEGA8, 1K byte bootloader: -Wl,--section-start=.text=0x1c00
Fuses for PingPong, Atmega8:
Lockbits: 0xCF ==> prevent bootloader from being overwritten

Edit: I found a major bug. Some sound cards have an inverted output which would not work with the bootloader. I made a second java program which corrects this issue. Please use the program version which fits to your computer. You will find it in the zip-file.
Edit: There was another problem: some programs using interrupts did not run. Now the bootloader ( v1.3 ) has an improved initialisation to run the user program.

Re: Audio Bootloader

PostPosted: Tue Jun 05, 2012 8:11 pm
by chris
There is a new Bootloader with differential manchester coding now working on all sound cards ( inverted and not inverted outputs ). There is also a java programming file which creates wav-files with half the frequency. This wav file can be compressed to mp3 with 320kBit/s.

Thanks to Johannes for the hints and the "research" how to compress the wav-files to mp3 files.

Re: Audio Bootloader

PostPosted: Thu Sep 11, 2014 1:20 pm
by chris
Meanwhile there are devloping some more examples of programming a microcontroller with a sound card.

Here is a mehtod of directly using the ISP-pins as sound interface:

An improved version with more circuit elements you can find here:

Re: Audio Bootloader

PostPosted: Fri Sep 12, 2014 4:00 pm
by chris
Here is a nice AUDIO-Data transmission for an ARM CortexM0 LPC810 and a smartphone:

AN11552.pdf ... 21FN8.html

download ==> application notes