ArduinoISP Arduino uno & blank atmega8 bootloader burn trouble

2/2

////////////////////////////////////
////////////////////////////////////
int avrisp() { 
  uint8_t data, low, high;
  uint8_t ch = getch();
  switch (ch) {
  case '0': // signon
    error = 0;
    empty_reply();
    break;
  case '1':
    if (getch() == CRC_EOP) {
      Serial.print((char) STK_INSYNC);
      Serial.print("AVR ISP");
      Serial.print((char) STK_OK);
    } else {
      error++;
      Serial.print((char) STK_NOSYNC);
    }
    break;
  case 'A':
    get_version(getch());
    break;
  case 'B':
    fill(20);
    set_parameters();
    empty_reply();
    break;
  case 'E': // extended parameters - ignore for now
    fill(5);
    empty_reply();
    break;

  case 'P':
    if (pmode) {
      pulse(LED_ERR, 3);
    } else {
      start_pmode();
    }
    empty_reply();
    break;
  case 'U': // set address (word)
    here = getch();
    here += 256 * getch();
    empty_reply();
    break;

  case 0x60: //STK_PROG_FLASH
    low = getch();
    high = getch();
    empty_reply();
    break;
  case 0x61: //STK_PROG_DATA
    data = getch();
    empty_reply();
    break;

  case 0x64: //STK_PROG_PAGE
    program_page();
    break;

  case 0x74: //STK_READ_PAGE 't'
    read_page();    
    break;

  case 'V': //0x56
    universal();
    break;
  case 'Q': //0x51
    error=0;
    end_pmode();
    empty_reply();
    break;

  case 0x75: //STK_READ_SIGN 'u'
    read_signature();
    break;

    // expecting a command, not CRC_EOP
    // this is how we can get back in sync
  case CRC_EOP:
    error++;
    Serial.print((char) STK_NOSYNC);
    break;

    // anything else we will return STK_UNKNOWN
  default:
    error++;
    if (CRC_EOP == getch()) 
      Serial.print((char)STK_UNKNOWN);
    else
      Serial.print((char)STK_NOSYNC);
  }
}

heres my boards.txt, this isnt the full list just what im trying to bootload

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

atmega8.name=ATmega8-noxtal @8MHz

atmega8.upload.protocol=arduino
atmega8.upload.maximum_size=7168
atmega8.upload.speed=38400

atmega8.bootloader.low_fuses=0xe4
atmega8.bootloader.high_fuses=0xc2
atmega8.bootloader.path=atmega8_noxtal
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=8000000L
atmega8.build.core=arduino
atmega8.build.variant=standard

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

atmega8.name=Arduino NG or older w/ ATmega8

atmega8.upload.protocol=stk500
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino

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

atmega8bb.name=ATmega8 on a breadboard (8 MHz internal clock)

atmega8bb.upload.protocol=stk500
atmega8bb.upload.maximum_size=7168
atmega8bb.upload.speed=19200

atmega8bb.bootloader.low_fuses=0xD4
atmega8bb.bootloader.high_fuses=0xCA
atmega8bb.bootloader.path=arduino:atmega8
atmega8bb.bootloader.file=ATmegaBOOT.hex
atmega8bb.bootloader.unlock_bits=0x3F
atmega8bb.bootloader.lock_bits=0x2F

atmega8bb.build.mcu=atmega8
atmega8bb.build.f_cpu=8000000L
atmega8bb.build.core=arduino:arduino

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

atmega8noxtal.name=ATmega8-noxtal @8MHz

atmega8noxtal.upload.protocol=stk500
atmega8noxtal.upload.maximum_size=7168
atmega8noxtal.upload.speed=19200

atmega8noxtal.bootloader.low_fuses=0xe4
atmega8noxtal.bootloader.high_fuses=0xc4
atmega8noxtal.bootloader.path=atmega8
atmega8noxtal.bootloader.file=ATmegaBOOT.hex
atmega8noxtal.bootloader.unlock_bits=0x3F
atmega8noxtal.bootloader.lock_bits=0x0F

atmega8noxtal.build.mcu=atmega8
atmega8noxtal.build.f_cpu=8000000L
atmega8noxtal.build.core=arduino 

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

atmega8.name=Arduino NG8 mhz

atmega8.upload.protocol=stk500
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xe4
atmega8.bootloader.high_fuses=0xd1
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=8000000L
atmega8.build.core=arduino

as you can see ive got quite a few boards ive tried already with avrdude: stk500_recv(): programmer is not responding when i use a pull-up resistor and avrdude: stk500_getsync(): not in sync: resp=0x## with different # each time and even sometimes get avrdude: stk500_getsync(): not in sync: expect:0x## or something to that effect, im stressing hard guys i need your help somebody anybody tell me what im doing wrong and what i need to do to fix this problem, or atleast a step in the right direction, please for the love of god DO NOT "LINK" TUTORIALS just lay out what i need to do HERE

Follow this tutorial:
http://pdp11.byethost12.com/AVR/ArduinoAsProgrammer.htm
Replace the atmega328p with your atmega8 and do not add any crystal and capacitors.

By doing so you can burn any code you like in your atmega8, including a bootloader if you really want to write one. In most cases, for stand alone applications, the bootloader is not necessary.

If you don't use a crystal or ceramic resonator on your atmel mcu, then the clock frequency will very probably not be accurate enough for the bootloader to work even if you do manage to burn it. However, you can still use ArduinoISP to upload your sketch directly, without a bootloader. See Prototyping small embedded projects with Arduino | David Crocker's Solutions blog for how I used to do it before I purchased an AVRISPmkII.

dc42:
If you don't use a crystal or ceramic resonator on your atmel mcu, then the clock frequency will very probably not be accurate enough for the bootloader to work even if you do manage to burn it. However, you can still use ArduinoISP to upload your sketch directly, without a bootloader. See Prototyping small embedded projects with Arduino | David Crocker's Solutions blog for how I used to do it before I purchased an AVRISPmkII.

Good point. And now that the IDE has a 'upload using programmer' option one can really easily live without messing with bootloaders at all. And seeing that an arduino board running the arduinoISP sketch becomes a hardware programmer, there is a lot to be said for just not messing with bootloaders.

Just think your mega boards won't suffer if you want to use the WDT or if your compiled code happens to have a !!! string for random data in it, it won't hang the upload. One could make a good argument to 'just say no' when the subject of bootloaders come up. :smiley:

Lefty

simplex:
Follow this tutorial:
http://pdp11.byethost12.com/AVR/ArduinoAsProgrammer.htm
Replace the atmega328p with your atmega8 and do not add any crystal and capacitors.

By doing so you can burn any code you like in your atmega8, including a bootloader if you really want to write one. In most cases, for stand alone applications, the bootloader is not necessary.

ive been to that page (which i said not to link) and it failed with same errors, try again and this time READ MY POST

mysteredding:
i cant believe this 9500 character limit so i had to split it into 7 posts, please go forth and read

You can attach files to your post you know. Making 7 posts just to attach files is a mis-use of the forum. You can attach multiple files, or make a single .zip file.

please for the love of god DO NOT "LINK" TUTORIALS just lay out what i need to do HERE

If there is a tutorial, that explains what to do, why should it be copied and pasted here, when you just have to go to a link? The tutorial might have photos, etc.

[quote author=Nick Gammon link=topic=134097.msg1009443#msg1009443 date=1353876423]

mysteredding:
i cant believe this 9500 character limit so i had to split it into 7 posts, please go forth and read

You can attach files to your post you know. Making 7 posts just to attach files is a mis-use of the forum. You can attach multiple files, or make a single .zip file.

please for the love of god DO NOT "LINK" TUTORIALS just lay out what i need to do HERE

If there is a tutorial, that explains what to do, why should it be copied and pasted here, when you just have to go to a link? The tutorial might have photos, etc.
[/quote]ive never used forums before and so i didnt know you could attach files, as for the linking im just tired of sifting thru bullshit just to find out it didnt work, i just want short simple answers to whats wrong

OP, please DO NOT hit the "report to moderator" control again.

AWOL:
OP, please DO NOT hit the "report to moderator" control again.

then how do i delete irrelevant posts?

mysteredding:
i just want short simple answers to whats wrong

You haven't actually said what's wrong, so it is hard to advise. Other than, I guess, it isn't doing what you expect. If you described what you did, what you expect to happen, and what actually happened, you might get somewhere.

Reporting someone three times for posting a link to a tutorial is abuse of the forum. Don't do it again.

On this page I have a sketch that runs on a Uno that will program a bootloader on various chips, including the Atmega8.

I'm not going to copy and paste thousands of words, and photos, to save you the trouble of following one link.

mysteredding:
ive been to that page (which i said not to link) and it failed with same errors, try again and this time READ MY POST

Failed with what "same errors"?
What command line you use in avrdude and which was the error it displayed?

[quote author=Nick Gammon link=topic=134097.msg1009461#msg1009461 date=1353877048]

You haven't actually said what's wrong, so it is hard to advise. Other than, I guess, it isn't doing what you expect. If you described what you did, what you expect to happen, and what actually happened, you might get somewhere.

Reporting someone three times for posting a link to a tutorial is abuse of the forum. Don't do it again.
[/quote]actually i told the entire story about whats wrong all you have to do is READ?!?! and btw i hit the repost button once and had to refresh, then hit it on a different post

simplex:

mysteredding:
ive been to that page (which i said not to link) and it failed with same errors, try again and this time READ MY POST

Failed with what "same errors"?
What command line you use in avrdude and which was the error it displayed?

i dont use command line i use arduino IDE

[quote author=Nick Gammon link=topic=134097.msg1009466#msg1009466 date=1353877184]
On this page I have a sketch that runs on a Uno that will program a bootloader on various chips, including the Atmega8.

I'm not going to copy and paste thousands of words, and photos, to save you the trouble of following one link.
[/quote]this is basically the arduinoisp tutorial the only difference is mutilation of a good 6pin header

I'm guessing that English isn't your first language - your sentence structure is hard to follow.
Is there one of the sections in the International section that might be able to help better?

as you can see ive got quite a few boards ive tried already with avrdude: stk500_recv(): programmer is not responding when i use a pull-up resistor and avrdude: stk500_getsync(): not in sync: resp=0x## with different # each time and even sometimes get avrdude: stk500_getsync(): not in sync: expect:0x## or something to that effect, im stressing hard guys i need your help somebody anybody tell me what im doing wrong and what i need to do to fix this problem, or atleast a step in the right direction,

What programmer are you using?

mysteredding:
this is basically the arduinoisp tutorial the only difference is mutilation of a good 6pin header

Not at all. It doesn't use avrdude at all, so you won't get any avrdude error messages. You did read it, didn't you?

The bootloader is programmed onto the Uno, you connect them together, and (under command from the serial monitor) it writes the bootloader.

mutilation of a good 6pin header

I made up that header for my convenience. Just use six jumper wires if you prefer.

AWOL:
I'm guessing that English isn't your first language - your sentence structure is hard to follow.
Is there one of the sections in the International section that might be able to help better?

you have no un-spoken language section, and english was my first spoken language