Locked out of ATmega48

I was trying to set my atmega48 to use internal 128kHz clock (CKSEL fuse) through AVR studio but I guess I accidentally locked myself out from programming the chip. I tried all ISP clock speed but had no luck with that.

Here's the screenshot:

formatting link

Can anybody suggest what has happened and how can I gain access back to the chip? I couldn't program, erase, or change anything.

Thanks.

Cheers, Hoi

Reply to
Hoi Wong
Loading thread data ...

High Voltage Parallel Programming in an Atmel STK500 dev board _always_ works. Otherwise try to connect an 4 or 8 MHz crystal oscillator to xclk1.

Mit freundlichen Grüßen

Frank-Christian Krügel

Reply to
Frank-Christian Kruegel

Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and reprogram it using 'med freq Xtal'.

Reply to
TT_Man

I have a 4-pin 12MHz oscillator on my hand. Can you show me which pins should go to XTAL1 and XTAL2? Or I need to hook more than 2 pins?

Thanks.

Reply to
Hoi Wong

">>>

Look at the data sheet........ or bring it over to my house and I'll do it while you wait.

Reply to
TT_Man

Pin 1 (the one with the dot, edge or other mark): open Pin 7: Ground Pin 8: connect to XTAL1 Pin 14: VCC Leave XTAL2 open.

Pin numbering is the same as 14 pin DIL.

Mit freundlichen Grüßen

Frank-Christian Krügel

Reply to
Frank-Christian Kruegel

Thanks. The crystal gives a correct 12MHz signal, but I still couldn't program the atmega48. All I did was to change the clock from internal 8Mhz to internal 128kHz (and disabled CLKDIV8 because of the warning message), and all of a sudden, I was completely locked out of the system.

I have a STK500 programmer, but not the development board. Is there a way to do high voltage serial programming on ATmega48?

Cheers, Hoi

Reply to
Hoi Wong

The data sheet has a section on parallel programming. If you have access to another microcontroller, a +12 V supply, and some miscellaneous parts you could run the parallel programming sequence just as far as erasing the "bad" mega48. That should reset the lock bits (but not the fuses) if you've inadvertently locked yourself out. There's a section on doing the fuses, too, if you have to go that far (remember that a programmed fuse is "0"). Sounds like a good exercise!

Alternately, you may be able to locate somebody with an STK500 board (not just the AVRISP) close enough to you to use the parallel programming mode. Might also try over on

formatting link
to see if you can locate somebody.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

Erase the device, then reset the fuses to ext .xtal. med. freq . clear the device protect fuses as well and just program that. Then try and program the device

Reply to
TT_Man

I couldn't even erase it. It seems like the microcontroller is not talking to the programmer at all.

Reply to
Hoi Wong

How about reducing your programming clock speed? Can't run ISP clock at high frequency when the CPU is running at low frequency. Also, you cannot run > 10 MHz CPU clock, unless you increase voltage.

--
Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may not be shared by my employer Atmel Nordic AB
Reply to
Ulf Samuelsson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.