Show Posts
Pages: [1]
1  Using Arduino / Microcontrollers / Re: ArduinoISP Arduino uno & blank atmega8 bootloader burn trouble on: January 19, 2013, 03:35:36 pm
@Nick Gammon,

I tried using your bootloader programmer sketch for an Atmega8A device.  It did not work.  After some investigation I discovered that your sketch sends the Poll RDY/BSY* instruction in the pollUntilReady() function.  This instruction is not supported by the Atmega8A.   As a quick-and-dirty patch, I re-wrote pollUntilReady as follows:

Code:
// poll the target device until it is ready to be programmed
void pollUntilReady ()
{
  if (signatures[foundSig].pageSize < 128) {
    delay(12);
  } else while ((program (pollReady) & 1) == 1) {
    ;
  }
}  // end of pollUntilReady

With this change I was able to successfully program the Atmega8A.  Note that the delay value of 12ms is more than enough to cover the longest wait time specified in the datasheet.
Pages: [1]