Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Wiring Hardware >> Troubleshooting >> ATmega128 Fuses
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1230625663

Message started by letaage on 12/30/08 at 08:27:43

Title: ATmega128 Fuses
Post by letaage on 12/30/08 at 08:27:43
Hi all,

I have built a barebones Wiring compatible board to experiment with.  It consists of:

- ATmega128 CPU
- 16MHz xtal
- 32.768KHz watch xtal
- LED on PG0
- ISP Header (using 10 pin ATMEL ISP variant) to PE0, PE1, PB1, /RESET
- Reset Switch and 10k pull up
- +5V supply
- FTDI Serial/USB cable TTL-232R

ie it's all as per the wiring schematic (the Serial/USB cable replaces the FT232BM).

I have programmed the wiring boot loader into the device using AVR Studio v4.15, I have an original ATMEL STK500 serial ISP programmer.

AVR Studio can talk to the device and read the signature back (and program the flash), but I'm having a hard time working out what the exact fuse settings should be.  I've already fritzed one CPU in the process, and for some reason I was unable to get it working again using an external clock directly to pin 24 (XTAL1).

The default fuses of the unprogrammed ATmega128 are (X = "selected", O = "not selected" in AVR Studio):

M103C       X
WDTON      O
OCDEN       O
JTAGEN      X
SPIEN        X
EESAVE      O
BOOTSZ     Boot Flash size = 4096 words start address = $F000
BOOTRST   O
CKOPT       O
BODLEVEL  Brown-out detection level at VCC=2.7 V
BODEN       O
SUT_CKSEL   Int. RC OSc 1MHz; Start-up time: 6 CK + 64 ms

Giving:
EXTENDED = 0xFD
HIGH        = 0x99
LOW         = 0xE1

Now from what I've read on this forum I think I need to set the fuses as follows:

M103C       O
WDTON      O
OCDEN       O
JTAGEN      X
SPIEN        X
EESAVE      O
BOOTSZ     Boot Flash size = 1024 words start address = $FC00
BOOTRST   X
CKOPT       X
BODLEVEL  Brown-out detection level at VCC=4.0 V
BODEN       X
SUT_CKSEL   Ext. Crystal/Resonator High Freq; Start-up time: 16K CK + 64 ms

Giving:
EXTENDED = 0xFF
HIGH        = 0x8C
LOW         = 0x3F

I don't want to disable the JTAG interface since I have read that it can be used to fix a CPU with bad fuse settings (been caught by that once already!)

Can anyone confirm that these settings should work and not cause me to lose another CPU???

Thanks,
Tom

Title: Re: ATmega128 Fuses
Post by barragan on 12/30/08 at 23:04:33
those are correct. Thatīs odd about losing a cpu, it never happened here, we donīt enable the JTAG.
h.

Title: Re: ATmega128 Fuses
Post by letaage on 12/31/08 at 01:56:49
Thanks for that, it worked this time, the clock started running.

I'm not sure what caused the problem last time, but I think that I had other hardware issues on my lashed together set up.

Now to test the bootloader with the wiring environment....

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.