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)