I have bare Atmega8 with fuses to factory defauls (1mhz internal clock).
Standard bootloading procedure doesn't runs, seems there is no SPI communication (error message "avrdude: stk500_getsync(): not in sync: resp=0x66")
fuses used for bootloader
atmega8bb.name=ATmega8 on a breadboard (8 MHz internal clock)
I just modified the "bootloader uploader" sketch to have the Atmega8A signature and bootloader. I'm not certain if I got it right, as I don't have that processor here to test, but I hope so.
The wiring (for connecting the programmer to the chip) should be the same as shown for the Atmega328P.
It appeared that fuses aren't factory default, clock was set to external cristal 8mhz, after connect 8mhz cristal, optiloader worked, then I played with ArduinoISP sketch with boards file
atmega8bb.name=ATmega8 on a breadboard (8 MHz internal clock)
atmega8bb.upload.protocol=stk500
atmega8bb.upload.maximum_size=7168
atmega8bb.upload.speed=9600
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
I did.
But if you read my posts, you'll understand that my problem wasn't just bootloader, due to different fuses I supposed, Atmega wasn't starting up.
If you used optiloader to put the bootloader on there, then you have "optiboot" rather than ATmegaBOOT, and the upload speed will be 57600 if you're running at 8MHz.
Nick Gammon, verification error means that bytes written doesn't mach bytes read (read was FF, therefore there is nothing written), I hasn't dig into that sketch yet, so don't sure what causes that error.
westfw, that's interesting, I'll try.
Should I always put exact speed supposing that lower speed won't work?
Should I always put exact speed supposing that lower speed won't work?
Yes. None of the bootloaders suppor any form of bitrate detection. You have to talk to them at the exact bitrate that they were compiled to accept (possibly taking into account changes in clock rate. optiboot is designed to run at 115200bps at 16MHz; If you run that same code on an 8MHz cpu, it will go (exactly) 57600 (half the clock rate, half the bitrate.))
Compiling the bootloader to accept a lower bitrate MIGHT improve reliability of uploads, IF certain types of error are involved...
I'm success now, but I don't know why
Anyway, thanks to westfw for the hint.
What I did:
I've tried 57600 serial rate with optiloader bootloader uploaded, and received another error
Binary sketch size: 918 bytes (of a 7,168 byte maximum)
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
I suppose there is problem with lock bits.
Anyway, than I've tried Arduino standard bootloader
Uploaded via ArduinoISP sketch using Arduino IDE tool (burn bootloader).
After upload, I've played with several rates for sketch uploading and got success with 9600.
But receiving again the same error about invalid signature.
Than I tried old IDE 0022 version and it worked :))) I suppose it uses that "-F" switch for avrdude for overriding signature or lock bits.
BTW, I tried noxtal bootloader Minimal Arduino with ATmega8 – todbot blog
And none of serial rates worked. They say serial speed 38400 should work, but it doesn't, neither any other speed from 2400 to 57600.
kaor:
Nick Gammon, verification error means that bytes written doesn't mach bytes read (read was FF, therefore there is nothing written), I hasn't dig into that sketch yet, so don't sure what causes that error.