Audioino?

Has anyone successfully done the Audioino where you can program your microchip through an audio file? I am trying to install the bootloader on my standalone arduino but I cannot figure out how to do it through the arduino IDE. How do I add that option to the menu? I know I have to edit the boards.txt but I am a bit lost from there.

http://www.hobby-roboter.de/forum/viewtopic.php?f=4&t=127

http://www.hobby-roboter.de/forum/viewtopic.php?f=4&t=128&p=531

Its really cool and would be perfect for a christmas gift I am working on since the recipient doenst have any arduino programmer and so I would be able to send updates just through an audio file.

Any help?

So why not send a serial programmer too?

This with a simple trace cut (trace to the RST pin) and a jumper add (from DTR hole to the now isolated RST pin) will allow easy programming thru the IDE.

To install a bootloader, you need an In System Programmer (ISP) to connect to the SPI pins.

I have an Atmel AVR ISP MKii from Mouser.com, very useful for All the Arduino chips.

Yea I could send a serial adapter but it would be nicer to simplify it. I also just always wanted to build one haha.

So I tried using an Arduino as ISP to do the programming and set up the boards file to include

##############################################################

atmega328.name=Audioino w/ ATmega328 (8 Mhz)

atmega328.upload.protocol=arduino
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600

atmega328.bootloader.low_fuses=0xE2
atmega328.bootloader.high_fuses=0xDF
atmega328.bootloader.extended_fuses=0xFA
atmega328.bootloader.path=atmega
atmega328.bootloader.file=chAudioBoot_ATMEGA168_IN_PD1_LED_PB5.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F

atmega328.build.mcu=atmega328p
atmega328.build.f_cpu=8000000L
atmega328.build.core=arduino
atmega328.build.variant=standard

##############################################################

Im not sure if I pointed to the correct hex file for the bootloader. Its all a bit confusing to use and im getting errors when I try to flash the bootloader.

CrossRoads: To install a bootloader, you need an In System Programmer (ISP) to connect to the SPI pins. http://www.ebay.com/itm/USBASP-USB-AVR-Programmer-for-Atmel-USB-ASP-USBISP-ISP-Arduino-Bootloader-USA-/150739530304?pt=LH_DefaultDomain_0&hash=item2318c6b240

Follow that link. Meant ISP is a piece of hardware. It connects to the 6 pin (3 x 2) header on your arduino, not the USB port normally used with the IDE. Once you got your hands on such hardware, you can try using IDE to program your loader.

I understand how isp works. Can I not use Arduino as ISP for something like this? I have ordered a usbasp but even when I get it, dont I have to edit the boards.txt file for the bootloader to show up on the arduino IDE so i can burn the bootloader? Thats the part I am confused on.

If you are installing the standard Uno bootloader, you do not need to modify boards.txt.

I am trying to use the Audioino bootloader so its not the regular uno one. I'm not sure if I edited the boards file properly to allow for me to burn the new bootloader. I posted the links above if you can please look at the files it comes with. It comes with directions for how to do it in AVR studio I think, but i rather just stick with the arduino IDE since thats all i have at the moment.

sdinnu: I understand how isp works. Can I not use Arduino as ISP for something like this? I have ordered a usbasp but even when I get it, dont I have to edit the boards.txt file for the bootloader to show up on the arduino IDE so i can burn the bootloader? Thats the part I am confused on.

This seems to be a pretty good link about burning bootloaders using Arduino as ISP: http://www.ladyada.net/library/arduino/arduinoisp.html. See the very last bit about using the avrdude command line to be able to specify a different bootloader's hex file.

Let us know how you come with this, it sounds pretty interesting to me! I wonder if you could install a wav file to such a device using an iPhone or Android...

John

I'm not sure if this will help, but I've uploaded bootloaders without using a "commercial" ISP programmer. Two different methods:

http://www.gammon.com.au/forum/?id=11635 (you put the bootloader into the sketch itself)

http://www.gammon.com.au/forum/?id=11638 (you can upload any file from an SD card)

Thanks alot Nick! That looks awesome and I was looking for soemthing like Optiloader for custom bootloaders since I've been having issues with using Arduino as ISP with my UNO (even when using a 10uF cap between reset and ground)

So I tried using MUSHClient on my Windows virtualization and when I tried to follow your tutorial on adding the bootloader from Audioino (which im kinda worried only supports the ATMEGA168) i got and error from the script. I tried the "chAudioBoot_ATMEGA168_IN_PD1_LED_PB5" hex file from the Audioino folder. I think thats the correct bootloader file?

here is a screenshot of the error I got: http://cl.ly/image/273F3X0v2L2n

Can you help me get the arduino script that incorporates the Audioino bootloader for an ATMEGA328 running at 8mhz (that would be just burning the correct fuses right?)

Can you click that box that says "show errors in output window next time", run it again, and then copy and paste the error message that appears? There is something in red underneath I can't read.

After looking at the actual error I was able to fix the error by simply adding a new end code to the Lua script. I got the following output from the script

// File = chAudioBoot_ATMEGA168_IN_PD1_LED_PB5.hex// Loader start: 3C00, length: 1024

// MD5 sum = 86 9B DA 86 0E 68 2B F1 0C 20 E5 47 D8 3C 8D E5 



byte PROGMEM chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex [] = {

0x0C, 0x94, 0x34, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 

0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 

0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 

0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 

0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 

0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 

0x0C, 0x94, 0x51, 0x1E, 0x0C, 0x94, 0x51, 0x1E, 0x11, 0x24, 0x1F, 0xBE, 0xCF, 0xEF, 0xD4, 0xE0, 

0xDE, 0xBF, 0xCD, 0xBF, 0x11, 0xE0, 0xA0, 0xE0, 0xB1, 0xE0, 0xE8, 0xE9, 0xFF, 0xE3, 0x02, 0xC0, 

0x05, 0x90, 0x0D, 0x92, 0xA0, 0x30, 0xB1, 0x07, 0xD9, 0xF7, 0x11, 0xE0, 0xA0, 0xE0, 0xB1, 0xE0, 

0x01, 0xC0, 0x1D, 0x92, 0xA5, 0x38, 0xB1, 0x07, 0xE1, 0xF7, 0x0E, 0x94, 0xC3, 0x1F, 0x0C, 0x94, 

0xCA, 0x1F, 0x0C, 0x94, 0x00, 0x1E, 0xDF, 0x93, 0xCF, 0x93, 0x00, 0xD0, 0x00, 0xD0, 0xCD, 0xB7, 

0xDE, 0xB7, 0x1A, 0x82, 0x19, 0x82, 0x1A, 0x82, 0x19, 0x82, 0x89, 0xB1, 0x82, 0x70, 0x28, 0x2F, 

0x30, 0xE0, 0x89, 0xB1, 0x90, 0xE0, 0x82, 0x70, 0x90, 0x70, 0x28, 0x17, 0x39, 0x07, 0xC9, 0xF3, 

0x69, 0xB1, 0x62, 0x70, 0x10, 0x92, 0xB2, 0x00, 0x40, 0xE0, 0x50, 0xE0, 0x89, 0xB1, 0x26, 0x2F, 

0x30, 0xE0, 0x90, 0xE0, 0x82, 0x70, 0x90, 0x70, 0x28, 0x17, 0x39, 0x07, 0xB9, 0xF3, 0x20, 0x91, 

0xB2, 0x00, 0x10, 0x92, 0xB2, 0x00, 0x69, 0xB1, 0x62, 0x70, 0x48, 0x30, 0x51, 0x05, 0x30, 0xF0, 

0x89, 0x81, 0x9A, 0x81, 0x82, 0x0F, 0x91, 0x1D, 0x9A, 0x83, 0x89, 0x83, 0x4F, 0x5F, 0x5F, 0x4F, 

0x40, 0x31, 0x51, 0x05, 0x19, 0xF7, 0x29, 0x81, 0x3A, 0x81, 0xC9, 0x01, 0x88, 0x0F, 0x99, 0x1F, 

0x82, 0x0F, 0x93, 0x1F, 0x25, 0xE0, 0x96, 0x95, 0x87, 0x95, 0x2A, 0x95, 0xE1, 0xF7, 0x9C, 0x83, 

0x8B, 0x83, 0x80, 0x91, 0xB2, 0x00, 0x2B, 0x81, 0x3C, 0x81, 0x90, 0xE0, 0x82, 0x17, 0x93, 0x07, 

0xC0, 0xF3, 0x16, 0xC0, 0x89, 0xB1, 0x90, 0xE0, 0x82, 0x70, 0x90, 0x70, 0x28, 0x17, 0x39, 0x07, 

0xC9, 0xF3, 0x49, 0xB1, 0x10, 0x92, 0xB2, 0x00, 0x80, 0x91, 0xB2, 0x00, 0x2B, 0x81, 0x3C, 0x81, 

0x90, 0xE0, 0x82, 0x17, 0x93, 0x07, 0xC0, 0xF3, 0x64, 0x2F, 0x62, 0x70, 0x10, 0x92, 0xB2, 0x00, 

0x26, 0x2F, 0x30, 0xE0, 0x89, 0xB1, 0x90, 0xE0, 0x82, 0x70, 0x90, 0x70, 0x28, 0x17, 0x39, 0x07, 

0x09, 0xF3, 0x49, 0xB1, 0x42, 0x70, 0x58, 0xE0, 0xA0, 0xE0, 0x60, 0xE0, 0x70, 0xE0, 0x89, 0xB1, 

0x24, 0x2F, 0x30, 0xE0, 0x90, 0xE0, 0x82, 0x70, 0x90, 0x70, 0x28, 0x17, 0x39, 0x07, 0xB9, 0xF3, 

0x10, 0x92, 0xB2, 0x00, 0x49, 0xB1, 0x80, 0x91, 0xB2, 0x00, 0x2B, 0x81, 0x3C, 0x81, 0x90, 0xE0, 

0x82, 0x17, 0x93, 0x07, 0xC0, 0xF3, 0x29, 0xB1, 0x22, 0x70, 0xEA, 0x2F, 0xF0, 0xE0, 0xE0, 0x50, 

0xFF, 0x4F, 0x80, 0x81, 0x88, 0x0F, 0x80, 0x83, 0x42, 0x70, 0x42, 0x17, 0x11, 0xF0, 0x81, 0x60, 

0x80, 0x83, 0x51, 0x50, 0x11, 0xF4, 0xAF, 0x5F, 0x58, 0xE0, 0x6F, 0x5F, 0x7F, 0x4F, 0x42, 0x2F, 

0x24, 0xE0, 0x68, 0x32, 0x72, 0x07, 0x99, 0xF6, 0x30, 0xE0, 0x90, 0x91, 0x04, 0x01, 0x80, 0xE0, 

0x20, 0x91, 0x03, 0x01, 0x82, 0x0F, 0x91, 0x1D, 0x8A, 0x5A, 0x95, 0x45, 0x09, 0xF4, 0x31, 0xE0, 

0x83, 0x2F, 0x0F, 0x90, 0x0F, 0x90, 0x0F, 0x90, 0x0F, 0x90, 0xCF, 0x91, 0xDF, 0x91, 0x08, 0x95, 

0x1F, 0x93, 0xCF, 0x93, 0xDF, 0x93, 0xDA, 0x01, 0xF8, 0x94, 0x83, 0xE0, 0xFB, 0x01, 0x80, 0x93, 

0x57, 0x00, 0xE8, 0x95, 0x07, 0xB6, 0x00, 0xFC, 0xFD, 0xCF, 0xAB, 0x01, 0x11, 0xE0, 0xEB, 0x01, 

0xC0, 0x58, 0xDF, 0x4F, 0x8C, 0x91, 0x11, 0x96, 0x3C, 0x91, 0x11, 0x97, 0x20, 0xE0, 0xF9, 0x01, 

0xE8, 0x0F, 0xF1, 0x1D, 0xCF, 0x01, 0x12, 0x96, 0x0C, 0x01, 0xFA, 0x01, 0x10, 0x93, 0x57, 0x00, 

0xE8, 0x95, 0x11, 0x24, 0x07, 0xB6, 0x00, 0xFC, 0xFD, 0xCF, 0x4E, 0x5F, 0x5F, 0x4F, 0x4C, 0x17, 

0x5D, 0x07, 0x41, 0xF7, 0x85, 0xE0, 0xFB, 0x01, 0x80, 0x93, 0x57, 0x00, 0xE8, 0x95, 0x07, 0xB6, 

0x00, 0xFC, 0xFD, 0xCF, 0x81, 0xE1, 0x80, 0x93, 0x57, 0x00, 0xE8, 0x95, 0xDF, 0x91, 0xCF, 0x91, 

0x1F, 0x91, 0x08, 0x95, 0x82, 0xE0, 0x80, 0x93, 0xB1, 0x00, 0x08, 0x95, 0x14, 0xB8, 0x17, 0xB8, 

0x1A, 0xB8, 0xF8, 0x94, 0x10, 0x92, 0xB1, 0x00, 0xEE, 0x27, 0xFF, 0x27, 0x09, 0x94, 0x08, 0x95, 

0xFF, 0x92, 0x0F, 0x93, 0x1F, 0x93, 0xCF, 0x93, 0xDF, 0x93, 0x82, 0xE0, 0x80, 0x93, 0xB1, 0x00, 

0xC0, 0xE1, 0xD7, 0xE2, 0x66, 0xE0, 0x53, 0xE0, 0x70, 0xE2, 0x80, 0x91, 0xB2, 0x00, 0x85, 0x36, 

0xA8, 0xF0, 0x10, 0x92, 0xB2, 0x00, 0x21, 0x97, 0x89, 0xF4, 0x85, 0xB1, 0x87, 0x27, 0x85, 0xB9, 

0x61, 0x50, 0x51, 0xF4, 0x2D, 0x98, 0x14, 0xB8, 0x17, 0xB8, 0x1A, 0xB8, 0xF8, 0x94, 0x10, 0x92, 

0xB1, 0x00, 0xEE, 0x27, 0xFF, 0x27, 0x09, 0x94, 0xC0, 0xE1, 0xD7, 0xE2, 0x89, 0xB1, 0x24, 0x2F, 

0x30, 0xE0, 0x90, 0xE0, 0x82, 0x70, 0x90, 0x70, 0x28, 0x17, 0x39, 0x07, 0x19, 0xF0, 0x49, 0xB1, 

0x42, 0x70, 0x51, 0x50, 0x55, 0x23, 0xC9, 0xF6, 0x2D, 0x9A, 0x60, 0xE2, 0xF6, 0x2E, 0x0E, 0x94, 

0x53, 0x1E, 0x88, 0x23, 0x79, 0xF4, 0x90, 0xE2, 0x80, 0x91, 0xB2, 0x00, 0x85, 0x36, 0xE0, 0xF3, 

0x10, 0x92, 0xB2, 0x00, 0x21, 0x97, 0xC1, 0xF7, 0x85, 0xB1, 0x89, 0x27, 0x85, 0xB9, 0xC8, 0xEE, 

0xD3, 0xE0, 0xF2, 0xCF, 0x85, 0xB1, 0x8F, 0x25, 0x85, 0xB9, 0x80, 0x91, 0x00, 0x01, 0x82, 0x30, 

0x61, 0xF0, 0x83, 0x30, 0xE9, 0xF4, 0x14, 0xB8, 0x17, 0xB8, 0x1A, 0xB8, 0xF8, 0x94, 0x10, 0x92, 

0xB1, 0x00, 0xEE, 0x27, 0xFF, 0x27, 0x09, 0x94, 0x13, 0xC0, 0x10, 0x91, 0x02, 0x01, 0x00, 0xE0, 

0x80, 0x91, 0x01, 0x01, 0xB8, 0x01, 0x68, 0x0F, 0x71, 0x1D, 0x76, 0x95, 0x76, 0x2F, 0x66, 0x27, 

0x77, 0x95, 0x67, 0x95, 0x80, 0xE0, 0x90, 0xE0, 0x45, 0xE0, 0x51, 0xE0, 0x0E, 0x94, 0x08, 0x1F, 

0x10, 0x92, 0x00, 0x01, 0xC4, 0xCF, 0x25, 0x9A, 0x59, 0x9A, 0x0E, 0x94, 0x50, 0x1F, 0x80, 0xE0, 

0x90, 0xE0, 0x08, 0x95, 0xF8, 0x94, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 

}; // end of chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex

I then added that as a .h file into your Atmega_Board_Programmer and edited the code a bit to incorporate the Audioino Bootloader and I was able to successfully bootload a ATMEGA328p.

You can see the some of the alterations I made to the script and the output from Nick's programmer software in the screenshot: http://cl.ly/image/2A2A0q333S0z

I have yet to actually test the bootloader however, so that would be the next step!

After trying to test the Audioino I realized it wasnt working properly. I am a bit worried that the fuses were possibly incorrect since in the ReadMe file of the audioino bootloader they use these settings for the atmega168

ATMEGA168, 1K bootloader: -Wl,--section-start=.text=0x3c00
    Fuses Atmega168:
    Extended: 0xFA
    HIGH: 0xDF
    LOW: E2

But I am not sure if I should run the same fuses for Atmega328p since currently I am burning the fuses of the lilypad to get the same 8mhz internal clock setting

else if (subcommand == 'A')  // use internal 8 MHz clock
      {
      Serial.println (F("Using Audioino 8 MHz loader."));
      bootloader = chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex;
      newlFuse = 0xE2;  // internal 8 MHz oscillator
      newhFuse = 0xDA;  //  2048 byte bootloader, SPI enabled
      addr = 0x7800;
      len = sizeof chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex;
      }  // end of using the 8 MHz clock

Should I change the fuses?

I am expecting the audioino to blink for 6 seconds after reset to show me that it is ready to be programmed through audio. Currently I am not seeing that. It might be that is because the current atmega328 I am burning is plugged into an arduino board... maybe i should make that a standalone and try again.

So I created a standalone atmega328 and changed the fuses to

   else if (subcommand == 'A')  // use internal 8 MHz clock
      {
      Serial.println (F("Using Audioino 8 MHz loader."));
      bootloader = chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex;
      newlFuse = 0xE2;  // internal 8 MHz oscillator
      newhFuse = 0xDC;  //  512 byte bootloader, SPI enabled
      newextFuse = 0xFF; 
      addr = 0x3C00;
      len = sizeof chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex;
      }  // end of using the 8 MHz clock

which better follows the fuses that were in the README of the bootloader. I was able to successfully bootload the chip and i see the blinking status LED and when I try to use the java program to play the audio file the status LED begins to blink quickly and that it. Regardless of the hex file I program it always blinks quickly and nothing else changes and whenever I reset the Audioino, it going back into the slow blinking LED. It seems like its stuck in the bootloader and that its actually never becoming programmed properly.

Any suggestions?

// File = chAudioBoot_ATMEGA168_IN_PD1_LED_PB5.hex// Loader start: 3C00, length: 1024

You want the 1024 byte bootloader, not the 2048 or 512 byte one. That is the first thing to get right.

I edited the code to

 else if (subcommand == 'A')  // use internal 8 MHz clock
      {
      Serial.println (F("Using Audioino 8 MHz loader."));
      bootloader = chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex;
      newlFuse = 0xE2;  // internal 8 MHz oscillator
      newhFuse = 0xDA;  //  1024 byte bootloader, SPI enabled
      newextFuse = 0xFF; 
      addr = 0x3C00;
      len = sizeof chAudioBoot_ATMEGA168_IN_PD1_LED_PB5_hex;
      }  // end of using the 8 MHz clock

which should now account for a 1024 byte bootloader. I also realized that the quick flashing light from the Audioino is actually an error signal. In the chAudioBoot.c file you can see the portion of the code that states the error signal

  //*************** start command interpreter *************************************  
  LEDON;
  while(1)
  {
    if(!receiveFrame())
    {
      //*****  error: blink fast, press reset to restart *******************
      while(1)
      {         
        if(TIMER>100)  // timerstop ==> frequency @16MHz= 16MHz/8/100=20kHz
        {
           TIMER=0;
           time--;
           if(time==0)
           {
             TOGGLELED;
             time=1000;
           }
        }
      }
    }
    else // succeed
    {
      TOGGLELED;
      switch(FrameData[COMMAND])
      {
        case TESTCOMMAND: // not used yet
        {
  #ifdef ARDUINO_DEBUG        
         Serial.println("testcommand");
  #endif
        }
        break;
        case RUNCOMMAND:
        {
		//setExternalPort(2);
  #ifndef ARDUINO_DEBUG
          // leave bootloader and run program
		runProgramm();
  #endif
  #ifdef ARDUINO_DEBUG        
         Serial.println("runcommand");
  #endif
        }
        break;
        case PROGCOMMAND:
        { 
  #ifdef ATMEGA168_MICROCONTROLLER
  			// Atmega168 Pagesize=64 Worte=128 Byte
			uint16_t k;
			k=(((uint16_t)FrameData[PAGEINDEXHIGH])<<8)+FrameData[PAGEINDEXLOW];
			boot_program_page (SPM_PAGESIZE*k, FrameData+DATAPAGESTART);	// erase and programm page
  #endif
  #ifdef ATMEGA8_MICROCONTROLLER
  			// Atmega8 Pagesize=32 Worte=64 Byte
			uint16_t k;
			k=(((uint16_t)FrameData[PAGEINDEXHIGH])<<8)+FrameData[PAGEINDEXLOW];
			boot_program_page (SPM_PAGESIZE*k*2, FrameData+DATAPAGESTART);	// erase and programm page
			boot_program_page (SPM_PAGESIZE*(k*2+1), FrameData+SPM_PAGESIZE+DATAPAGESTART);	// erase and programm page
	
	#ifdef	PINGPONG_PLATTFORM
			setSpalte(k); // show frame number on ping pong game
	#endif

  #endif
  #ifdef ARDUINO_DEBUG 
          Serial.println("programming");
  #endif
        }
        break;
      }
      FrameData[COMMAND]=NOCOMMAND; // delete command
    }
  }
}

I still dont understand why it wont program correctly. I plugged the headphone jack into the Audioino with 2 10k resistors and a 10nF capactor (dont have a 100nF to test with currently)

Check out: http://www.engbedded.com/fusecalc

I make extended fuse of 0xF8 being the 1024 byte word boot vector.

Try 0xFA being the 512 word (1024 byte) boot vector.

Im a bit confused now. I am currently using L: E2 H: DA E: FF

If I switch E to FA the only change I see is that that BOD is set to 4.3v. I was trying not to mess with the BOD right now so if I disable it and set the boot word to 512 like you mention I am getting fuses as: L: E2 H: DC E: FF

However that also changes the start address to 3E00 rather than 3C00 which is mentioned in the bootloader's README. When i try to flash the bootloader with the bolded fuses, it only works if I bootload at address 3C00, and even after that I have the same problem of although it boots, any attempt to upload code results in that error flash. Maybe the bootloader doesnt work with the atmega328p? BTW Thank you very much for helping me out!

Can anyone look at the bootloader and tell me what they think? I know on the chAudioBoot.c file it says atmega168 but it looks like it should work on the atmega328p also. Any help would be greatly appreciated since this is a really cool bootloader and I would love to get it to work.

OK, what chip do you have? You have made repeated references to the Atmega168, so I assumed you were using it. Or are you?