Fusebit setting for ATmega8L

I am confusing which crystal I need to use forATmega8L.

I had set the HighFuse: F9, LowFuse: F8;
When I try to get the Fusebit setting again, it return Chip enable error.
Then I add 2x22pF and 8MHz. But the error still occur.

What I need to do to fix the problem?

But according to data sheet, the max speed is 8MHz. Am still can put 12MHz/16MHz with 22pf / 36pf ???

Thank you

1 Like

HighFuse to F9 disables ICSP programming. If you don't have a high voltage programmer, get a new chip.

The ATmega8L is the low-speed ATmega8 and can only run up to 8 MHz. I expect the fuse settings will be the same as for the ATmega8 but with the different processor and lower clock speed.

This is the current entry for the Arduino NG and earlier models which could have an ATmega8

##############################################################
atmegang.name=Arduino NG or older
atmegang.upload.tool=avrdude
atmegang.upload.protocol=arduino
atmegang.upload.speed=19200
atmegang.bootloader.tool=avrdude
atmegang.bootloader.unlock_bits=0x3F
atmegang.bootloader.lock_bits=0x0F
atmegang.build.mcu=atmegang
atmegang.build.f_cpu=16000000L
atmegang.build.board=AVR_NG
atmegang.build.core=arduino
atmegang.build.variant=standard

## Arduino NG or older w/ ATmega168
## --------------------------------
atmegang.menu.cpu.atmega168=ATmega168
atmegang.menu.cpu.atmega168.upload.maximum_size=14336
atmegang.menu.cpu.atmega168.upload.maximum_data_size=1024
atmegang.menu.cpu.atmega168.bootloader.low_fuses=0xff
atmegang.menu.cpu.atmega168.bootloader.high_fuses=0xdd
atmegang.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
atmegang.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_ng.hex
atmegang.menu.cpu.atmega168.build.mcu=atmega168

## Arduino NG or older w/ ATmega8
## ------------------------------
atmegang.menu.cpu.atmega8=ATmega8
atmegang.menu.cpu.atmega8.upload.maximum_size=7168
atmegang.menu.cpu.atmega8.upload.maximum_data_size=1024
atmegang.menu.cpu.atmega8.bootloader.low_fuses=0xdf
atmegang.menu.cpu.atmega8.bootloader.high_fuses=0xca
atmegang.menu.cpu.atmega8.bootloader.extended_fuses=
atmegang.menu.cpu.atmega8.bootloader.file=atmega8/ATmegaBOOT-prod-firmware-2009-11-07.hex
atmegang.menu.cpu.atmega8.build.mcu=atmega8

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

I would guess that this might work for the ATmega8L.
I changed ".build.f_cpu=16000000L" to ".build.f_cpu=8000000L".
I changed ".upload.speed=19200" to ".upload.speed=9600" because the bootloader will be running at half speed.
I changed ".build.mcu=atmega8" to ".build.mcu=atmega8l" so avrdude will expect the 8L signature.
Note: I don't know if the avrdude that comes with the Arduino IDE knows about the ATmega8L processor.

##############################################################
arduino8l.name=Arduino w/ ATmega8L

arduino8l.upload.tool=avrdude
arduino8l.upload.protocol=arduino
arduino8l.upload.speed=9600
arduino8l.upload.maximum_size=7168
arduino8l.upload.maximum_data_size=1024

arduino8l.bootloader.tool=avrdude
arduino8l.bootloader.unlock_bits=0x3F
arduino8l.bootloader.lock_bits=0x0F
arduino8l.bootloader.low_fuses=0xdf
arduino8l.bootloader.high_fuses=0xca
arduino8l.bootloader.extended_fuses=
arduino8l.bootloader.file=atmega8/ATmegaBOOT-prod-firmware-2009-11-07.hex

arduino8l.build.mcu= atmega8l
arduino8l.build.f_cpu=8000000L
arduino8l.build.board=AVR_NG
arduino8l.build.core=arduino
arduino8l.build.variant=standard
##############################################################

Actually I succee to set the fusebit to
HighFuse: D9,
LowFuse: E9;
(I am not sure, but I can confirm while I at home)

I just want to change to external crystal to accurate the speed in 8MHz.

PS, 8L maximum speed is 8MHz.

Actually, I have 6Mhz, 8MHz, 12MHz and 16MHz. Also the 4Mhz and 20Mhz are shipping here.

pylon:
HighFuse to F9 disables ICSP programming. If you don't have a high voltage programmer, get a new chip.

Thanks for your reply, I find this post, and wire the beard board version.
Now my ATmega8L was come back.

Some comment for anyone who hit my issue.

  • There are 2 version of AVR HV RESCUE SHIELD on provided website, both of them are ok. I follow the simple one (v1)
  • Reset the Fuse to default; LFuse: 0xE1, HFuse: 0xD9;
  • Update config (LFuse and HFuse, F_CPU, etc) in arduino boards.txt
  • After reset Fuse successfully, using ArduinoISP to upload the BootLoader
  • Upload you sketch to ATmega8L via ArduinoISP

PS: pylon, just add Karma to you.
PS2: hopefully if I have time, I may try to design the Arduino Nano / Pro Mini version which replace the AVR HV RESCUE SHIELD.

List the useful and tested fusebit setting here:

  • Default: LFuse: E1; HFuse: D9;
  • 8MHz (Internal): LFuse: A4; HFuse: D9;
  • 8MHz (External + 2* 22pF): LFuse: FF; HFuse: D9;

More detail please check it out at: AVR® Fuse Calculator – The Engbedded Blog

allen727hk:
List the useful and tested fusebit setting here:

  • Default: LFuse: E1; HFuse: D9;
  • 8MHz (Internal): LFuse: A4; HFuse: D9;
  • 8MHz (External + 2* 22pF): LFuse: FF; HFuse: D9;

More detail please check it out at: AVR® Fuse Calculator – The Engbedded Blog

For AVR devices that have the "low power / full swing" crystal drive option (low fuse, bit 0 (CKSEL0)) the low fuse, bit 0 should be programmed (that is LFUSE should be 0xF7 instead of 0xFF) - this sets the crystal oscillator to full swing which makes the board a lot more stable (runs fine at lower voltages, doesn't flake out if you hold the board and accidentally touch near the crystal, etc..).

Why the Arduino default is 0xFF (low power oscillator) is beyond me. The Icc difference is only a milliamp or so......

pylon:
HighFuse to F9 disables ICSP programming. If you don't have a high voltage programmer, get a new chip.

I added a small hack to my AVRDUDE. Before programming a chip, it checks if HFUSE, bit 5 (SPIEN) is going to be un-programmed and if so it prints a warning saying that this will disable further programming and can only be recovered by using a high voltage programmer and do you REALLY REALLY want to do this?

It's saved me a few times from doing something stupid when I've been up all night programming and my brain has since turned to mush... :slight_smile:

krupski:
For AVR devices that have the "low power / full swing" crystal drive option (low fuse, bit 0 (CKSEL0)) the low fuse, bit 0 should be programmed (that is LFUSE should be 0xF7 instead of 0xFF) - this sets the crystal oscillator to full swing which makes the board a lot more stable (runs fine at lower voltages, doesn't flake out if you hold the board and accidentally touch near the crystal, etc..).

Why the Arduino default is 0xFF (low power oscillator) is beyond me. The Icc difference is only a milliamp or so......

Thankyou for your reply, Is it simple to said, using LFuse: F7 better than FF, but both of them are work fine for external 8MHz.

Just in case for someone still have a trouble.
Following this link GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB
and it work with ATmega8 & ATmega48.

In order to my testing, it also works with:

  • ATmega8A, and
  • ATmega8L, and
  • ATmega48V