ISP

Hi I have been trying to program new Atmel chips with the bootloader, it doesn't seem to matter what method I use, or which version Arduino IDE,0023 0r 01, nothing but errors. V01 can't find the usb, v0023 avrdude: Expected signature for ATMEGA328P is 1E 95 0F Double check chip, or use -F to override this check. Haven't a clue what the -F means. I have tried the two Duemilanove method, and an ISP tiny, still the same results. Do these things really work. thanks Ernie

Does your chip say ATMEGA328-PU or ATMEGA328P-PU ?

WizenedEE:
Does your chip say
ATMEGA328-PU
or
ATMEGA328P-PU
?

It is ATMEGA328-PU, Thanks Ernie

Your problem is that the two chips are slightly (very slightly) different and the arduino uses the p version.

What I did to make it (mostly) work on linux: (there are some issues with delay but I can't figure out why)

I made a .bashrc in my home directory (figure out the name and location for windows if you have it) with:

#------------------------------------------------------------
# ATmega328
#------------------------------------------------------------

part
    id            = "m328";
    desc      = "ATMEGA328";
    has_debugwire = yes;
    flash_instr       = 0xB6, 0x01, 0x11;
    eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
              0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
              0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode    = 0x86;
    # avr910_devcode  = 0x;
    signature     = 0x1e 0x95 0x14;
    pagel     = 0xd7;
    bs2           = 0xc2;
    chip_erase_delay  = 9000;
    pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
         "x x x x x x x x x x x x x x x x";

    chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
         "x x x x x x x x x x x x x x x x";

    timeout   = 200;
    stabdelay = 100;
    cmdexedelay   = 25;
    synchloops    = 32;
    bytedelay = 0;
    pollindex = 3;
    pollvalue = 0x53;
    predelay  = 1;
    postdelay = 1;
    pollmethod    = 1;

    pp_controlstack =
    0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
    0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
    0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
    0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
    hventerstabdelay  = 100;
    progmodedelay = 0;
    latchcycles       = 5;
    togglevtg     = 1;
    poweroffdelay = 15;
    resetdelayms  = 1;
    resetdelayus  = 0;
    hvleavestabdelay  = 15;
    resetdelay        = 15;
    chiperasepulsewidth   = 0;
    chiperasepolltimeout = 10;
    programfusepulsewidth = 0;
    programfusepolltimeout = 5;
    programlockpulsewidth = 0;
    programlockpolltimeout = 5;

    memory "eeprom"
    paged       = no;
    page_size   = 4;
    size        = 1024;
    min_write_delay = 3600;
    max_write_delay = 3600;
    readback_p1 = 0xff;
    readback_p2 = 0xff;
    read = " 1 0 1 0 0 0 0 0",
           " 0 0 0 x x x a9 a8",
           " a7 a6 a5 a4 a3 a2 a1 a0",
           " o o o o o o o o";

    write = " 1 1 0 0 0 0 0 0",
             " 0 0 0 x x x a9 a8",
        " a7 a6 a5 a4 a3 a2 a1 a0",
        " i i i i i i i i";

    loadpage_lo = " 1 1 0 0 0 0 0 1",
              " 0 0 0 0 0 0 0 0",
              " 0 0 0 0 0 0 a1 a0",
              " i i i i i i i i";

    writepage = " 1 1 0 0 0 0 1 0",
            " 0 0 x x x x a9 a8",
            " a7 a6 a5 a4 a3 a2 0 0",
            " x x x x x x x x";

    mode        = 0x41;
    delay       = 20;
    blocksize   = 4;
    readsize    = 256;
    ;

    memory "flash"
    paged       = yes;
    size        = 32768;
    page_size   = 128;
    num_pages   = 256;
    min_write_delay = 4500;
    max_write_delay = 4500;
    readback_p1 = 0xff;
    readback_p2 = 0xff;
    read_lo = " 0 0 1 0 0 0 0 0",
          " 0 0 a13 a12 a11 a10 a9 a8",
          " a7 a6 a5 a4 a3 a2 a1 a0",
          " o o o o o o o o";

    read_hi = " 0 0 1 0 1 0 0 0",
          " 0 0 a13 a12 a11 a10 a9 a8",
          " a7 a6 a5 a4 a3 a2 a1 a0",
          " o o o o o o o o";

    loadpage_lo = " 0 1 0 0 0 0 0 0",
              " 0 0 0 x x x x x",
              " x x a5 a4 a3 a2 a1 a0",
              " i i i i i i i i";

    loadpage_hi = " 0 1 0 0 1 0 0 0",
              " 0 0 0 x x x x x",
              " x x a5 a4 a3 a2 a1 a0",
              " i i i i i i i i";

    writepage = " 0 1 0 0 1 1 0 0",
            " 0 0 a13 a12 a11 a10 a9 a8",
            " a7 a6 x x x x x x",
            " x x x x x x x x";

    mode        = 0x41;
    delay       = 6;
    blocksize   = 128;
    readsize    = 256;

    ;

    memory "lfuse"
    size = 1;
    min_write_delay = 4500;
    max_write_delay = 4500;
    read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
           "x x x x x x x x o o o o o o o o";

    write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
             "x x x x x x x x i i i i i i i i";
    ;

    memory "hfuse"
    size = 1;
    min_write_delay = 4500;
    max_write_delay = 4500;
    read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
           "x x x x x x x x o o o o o o o o";

    write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
             "x x x x x x x x i i i i i i i i";
    ;

    memory "efuse"
    size = 1;
    min_write_delay = 4500;
    max_write_delay = 4500;
    read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
           "x x x x x x x x x x x x x o o o";

    write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
             "x x x x x x x x x x x x x i i i";
    ;

    memory "lock"
    size = 1;
    min_write_delay = 4500;
    max_write_delay = 4500;
    read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
           "x x x x x x x x x x o o o o o o";

    write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
             "x x x x x x x x 1 1 i i i i i i";
    ;

    memory "calibration"
    size = 1;
    read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
           "0 0 0 0 0 0 0 0 o o o o o o o o";
    ;

    memory "signature"
    size = 3;
    read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
           "x x x x x x a1 a0 o o o o o o o o";
    ;
;

Which is the information for the atmega328p, with the p removed and the signature slightly different.

Then I added this to the boards.txt file (in arduino-1.0 -> hardware -> arduino -> boards.txt):

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

nonpicouno.name=Arduino Uno w/ Non-Pico ATmega328
nonpicouno.upload.protocol=arduino
nonpicouno.upload.maximum_size=32256
nonpicouno.upload.speed=115200
nonpicouno.bootloader.low_fuses=0xff
nonpicouno.bootloader.high_fuses=0xde
nonpicouno.bootloader.extended_fuses=0x05
nonpicouno.bootloader.path=optiboot
nonpicouno.bootloader.file=optiboot_atmega328.hex
nonpicouno.bootloader.unlock_bits=0x3F
nonpicouno.bootloader.lock_bits=0x0F
nonpicouno.build.mcu=atmega328
nonpicouno.build.f_cpu=16000000L
nonpicouno.build.core=arduino
nonpicouno.build.variant=standard

I put it right after the duemilanove entry, but it doesn't matter too much.

Then, restart arduino and select Arduino Uno w/ Non-Pico ATmega328 from the board selection menu. Then I could upload the bootloader.

I am using Win7, I looked in the ISP code, but could see no mention of a particular type of board, I am not a programmer as such, so not to sure about it. Ernie

Go to the place where avrdude.exe is (I think it's under arduino-1.0/hardware/tools) and make a file called avrdude.rc with the contents I said in my previous post.

Had no luck with this, I think it is probably time to put it in the too hard basket.
I have been browsing around and it seems just about everyone has the same problem, would have thought that the developers of the USBtiny ISP, would have fixed by now. thanks Ernie

erniehatt: Had no luck with this, I think it is probably time to put it in the too hard basket. I have been browsing around and it seems just about everyone has the same problem, would have thought that the developers of the USBtiny ISP, would have fixed by now. thanks Ernie

It's not their fault in any way, shape or form. The atmega328 has a different signature than the atmega328p, and the arduino people didn't put in support for the atmega328. That's all there is to it.

Fair enough, but it doesn't help the cause much, as things stand I might as well chuck the USBtiny and the 5 chips in the rubbish for what good they are. Ernie

erniehatt: Fair enough, but it doesn't help the cause much, as things stand I might as well chuck the USBtiny and the 5 chips in the rubbish for what good they are. Ernie

Sorry, that sounds like just a little too much self-pity to me. You bought the wrong 'flavor' of AVR 328 chips so now it's somehow something else's fault?

Lefty

Self pity has nothing to do with it. nowhere in any of the failure reports I have read and tried has there been any mention of a particular type of chip, until now that'.s is, surely if it was a known fact it would have been documented. Ernie

erniehatt: I am using Win7, I looked in the ISP code, but could see no mention of a particular type of board, I am not a programmer as such, so not to sure about it.

Were you able to locate the boards.txt file?

What operating system are you using?

Hi, Yes I located the boards .text file OK. My OS is windows 7 home, but I do have Windows7 ultra on my laptop. Thanks, Ernie

• Close the Arduino IDE

• Locate and open boards.txt

• Append the [u]second[/u] code section from @WizenedEE's post...

http://arduino.cc/forum/index.php/topic,95069.msg714173.html#msg714173

• Save boards.txt

• Close boards.txt

• Start the Arduino IDE

You will not yet be able to upload. Is a board named [u]Arduino Uno w/ Non-Pico ATmega328[/u] available under the Tools / Board menu?

Thanks, yes I have that in the board list. Ernie

• Locate and open avrdude.conf

• Append the [u]first[/u] code section from @WizenedEE's post...

http://arduino.cc/forum/index.php/topic,95069.msg714173.html#msg714173

• Save avrdude.conf

• Close avrdude.conf

That takes care of the configuration changes.

What is the end-goal? Install a bootloader on the the ATmega328 processors? Upload programs to them?

Thanks, got that far, the main goal is to just upload the Bootloader using a USBtiny ISP, I upload programs with the arduino board I have setup using a ZIF socket for easy management. Ernie

Then you are ready to roll...

• Install one of the ATmega328 processors on the Arduino

• Connect the USBtinyISP to the Arduino

• Ensure the USBtinyISP jumpers are correctly set

• Connect the USBtinyISP to the computer

• Only if the USBtinyISP [u]does not[/u] provide power to the target, connect the Arduino to the computer

• Start Arduino 1.0

• Under the menu item [u]Tools[/u] / [u]Programmer[/u] ensure [u]USBtinyISP[/u] is selected

• Under the menu item [u]Tools[/u] / [u]Serial Port[/u] ensure the USBtinyISP serial port is selected

• Under the menu item [u]Tools[/u] / [u]Board[/u] ensure the [u]Arduino Uno w/ Non-Pico ATmega328[/u] board is selected

• Execute the menu item [u]Tools[/u] / [u]Burn Bootloader[/u]

Ok, yes I was able to load the bootloader, but when I tried to upload a sketch, it gives me the error. the atmega 328 is for assembler only. Ernie

it gives me the error

Better that than "the finger".

You have to provide more details. At a minimum, you need to post the error message.