External EEPROM Use For Burn Arduino

It's Possible That Load HEX Code Of Program In EEPROM . When Want Load Program In Arduino. Main Arduino Connect With Other Arduino ,EEPROM And Push Button .when Press Button Main Arduino Take HEX Code From EEPROM And Load Program In Other Arduino By Main Arduino

You want to use one arduino to load a program into another arduino.
You want the program, which is to be loaded onto the target arduino, to be fetched from an an EEPROM by the arduino which is acting as a programmer.

Yes. That should be possible.
Google for "stand alone arduino programmer". Some solutions use an SD card but an EEPROP is also a valid storage medium.
An arduino can be configured as a programmer.

Nick Gammon has a good guide here but uses a SD card.
https://www.gammon.com.au/forum/?id=11638

Have a look at the Moteuino Web site . They do a modified opto boot for their products that allows programming from a memory chip
.

where from get configuration of target chip signature and fuse setting

Look at the example stand alone programmer already given: https://www.gammon.com.au/forum/?id=11638
The code is here: arduino_sketches/Atmega_Hex_Uploader_Fixed_Filename.ino at master · nickgammon/arduino_sketches · GitHub

The device signatures can be seen from line #347. I don't see an explicit list of applicable fuse settings though.

@CrossRoads has a board design for a stand-alone programmer but uses an SD card instead of an EEPROM to store the hex file(s).

I updated Nick's file to provide some options for what to do with the boot fuses, mostly the 2nd half of this, but I copied the whole function where the fuse is written. Maybe the original program can be similarly tweaked.
The variable BOOTABLE is created by reading a button press after startup.

// returns true if error, false if OK
bool updateFuses (const bool writeIt)
{
  Serial.println F(("updateFuses"));
  unsigned long addr;
  unsigned int  len;

  byte fusenumber = currentSignature.fuseWithBootloaderSize;

  // if no fuse, can't change it
  if (fusenumber == NO_FUSE)
  {
    //    ShowMessage (MSG_NO_BOOTLOADER_FUSE);   // maybe this doesn't matter?
    return false;  // ok return
  }

  addr = currentSignature.flashSize;
  len = currentSignature.baseBootSize;

  if (lowestAddress == 0)
  {
    Serial.print F(("lowestAddress = 0,  fuse = "));
    fuses [fusenumber] |= 1; // don't use bootloader
    Serial.println (fuses [fusenumber], HEX);
  }
  else
  {
    byte newval = 0xFF;

    if (lowestAddress == (addr - len))
      newval = 3;
    else if (lowestAddress == (addr - len * 2))
      newval = 2;
    else if (lowestAddress == (addr - len * 4))
      newval = 1;
    else if (lowestAddress == (addr - len * 8))
      newval = 0;
    else
    {
      ShowMessage (MSG_BAD_START_ADDRESS);
      return true;
    }
    Serial.print F(("newval "));
    Serial.println (newval, HEX);
    if (newval != 0xFF)
    {
      {
        newval <<= 1;  //
        fuses [fusenumber] &= ~0x07;
        fuses [fusenumber] |= newval;
        Serial.print F(("newval "));
        Serial.println (newval, HEX);
      }  // if valid

    }  // if not address 0
  }

  if (writeIt)
  {
    Serial.println F(("writeIt"));
    writeFuse (fuses [fusenumber], fuseCommands [fusenumber]);
    // variation to set fuses based on BOOTABLE
    // = 1 is bootloader not run (set LSB to 1), = 0 is bootloader run (clear LSB to 0)
    //TLZ - 09/13/16 - force new values into fuses for ATMEGA2560
    // Modified 1/29 for boot/no boot
    if (strcmp (currentSignature.desc, "ATmega2560") == 0)
    {
      if (BOOTABLE == 1) {
        Serial.println F(("2560 no bootloader in writeIt"));
        writeFuse (0xFF, writeLowFuseByte); //
        writeFuse (0xD9, writeHighFuseByte); // low bit set
        writeFuse (0xFD, writeExtendedFuseByte); //
      }
      else { // BOOTABLE = 0
        Serial.println F(("2560 bootloader in writeIt"));
        writeFuse (0xFF, writeLowFuseByte); //
        writeFuse (0xD8, writeHighFuseByte); // low bit clear
        writeFuse (0xFD, writeExtendedFuseByte); //
      }
    }

    if (strcmp (currentSignature.desc, "ATmega328P") == 0)
    {
      if (BOOTABLE == 1) {
        Serial.println F(("328P no bootloaderin writeIt"));
        writeFuse (0xFF, writeLowFuseByte);
        writeFuse (0xDF, writeHighFuseByte); // low bit set
        writeFuse (0xFD, writeExtendedFuseByte);
      }
      else { // BOOTLOADER = 0
        Serial.println F(("328P  bootloader in writeIt"));
        writeFuse (0xFF, writeLowFuseByte);
        writeFuse (0xDE, writeHighFuseByte); // low bit clear
        writeFuse (0xFD, writeExtendedFuseByte);
      }
    }

    if (strcmp (currentSignature.desc, "ATmega1284P") == 0)
    {
      if (BOOTABLE == 1) {
        Serial.println F(("1284P bootloader in writeIt"));
        writeFuse (0xF7, writeLowFuseByte);
        writeFuse (0xDF, writeHighFuseByte); // low bit set
        writeFuse (0xFD, writeExtendedFuseByte);
      }
      else {
        Serial.println F(("1284P no bootloader in writeIt"));
        writeFuse (0xF7, writeLowFuseByte);
        writeFuse (0xDE, writeHighFuseByte); // low bit clear
        writeFuse (0xFD, writeExtendedFuseByte);
      }
    }
  }

  return false;
}  // end of updateFuses

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.