Search My Blog

Saturday, December 31, 2011

Programming an Arduino using an audio file and Audio Bootloader

A proof of concept that uses an Arduino to read a Korg monotribe firmware file in m4a audio format.

Introduction

TribeDuino is a proof of concept that uses an Arduino to read a Korg Monotribe audio-encoded firmware file. It doesn't do anything with the data except calculate a checksum to prove that it read it correctly. The program works by connecting an Arduino to an MP3 player of some kind via an audio patch cable, and then playing the firmware audio file so that the Arduino can hear it.

UPDATE: Want to program Arduinos with sound? See Audioino!

Background

The firmware uses frequency-shift keying, or FSK, to encode its data. In FSK, you pick a point on a sine wave (like the peak), and measure how much time elapses between peaks. Over time, variations in the peak-to-peak period represent data. The Korg firmware uses binary FSK, which means that there are only two possible period lengths. A short period is a binary one, and a long period is a binary zero.

There is a 342-short-bit gap between packets that would seem pointless for a PC that's decoding the sound file offline. But for an Arduino or Monotribe that is reading the audio stream real-time, it's a much-needed 75-millisecond break during which the device can do something interesting with the packet it just decoded, such as writing it to flash memory, without falling behind for the next packet.

The effective bitrate is very close to 2400 baud (calculated using a 33,024-byte final firmware file, 8 bits per byte, and an audio runtime of about 1:50). That figure is not entirely comparable to a real 2400-baud modem for various reasons.

Instructions

Read More and get files at sowbug/TribeDuino - GitHub...
https://github.com/sowbug/TribeDuino

Audio Bootloader

by chris on Sat Sep 03, 2011 5:17 pm

Audio Bootloader for Atmega Microcontrollers

It is possible to load a program into an AVR-microcontroller over the audio interface of a PC or laptop:
http://www.mikrocontroller.net/articles/SOUNDRX

The bootloader presented here has the following features:

- automatic Baudrate detection and calibration
- works without calibration with 8Mhz or 16MHz sysclk ( possibly 1MHz, not tested )
- 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.

have fun,
chris
Attachments
AudioBoot_V1_1.zip
(172.27 KiB) Downloaded 650 times
chris
 
Posts: 220
Joined: Sun May 25, 2008 7:21 am
Go there...
http://www.hobby-roboter.de/forum/viewtopic.php?f=4&t=127

Cool Stuff!:) I wonder if this would work on a TI MSP-EXP430FR5739? That's all I have to work with... 
Don

Programming an Arduino using an audio file
Programming an Arduino using an audio file - Hack a Day
sowbug/TribeDuino - GitHub
Program an Arduino using your sound card - Hack a Day
forum.hobby-roboter.de • View topic - Audio Bootloader
Reverse engineering a Korg Monotribe - Hack a Day
Microcontroller comm with a computer monitor - Hack a Day

2 comments:

F.T said...

They are all helpful guidelines.

what is arduino

Don's Deals Blog said...

Thanks fatmi, I checked out the links on your Blog. I liked the Wifi Robot at, http://www.blog.ktmgtug.org/ That's a good idea using Wifi to control the Robot.

Don