Forums

Locked out of ATmega48

Started by Hoi Wong June 16, 2008
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:
http://www.stanford.edu/~wonghoi/atmega48lockout.png

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



On Sun, 15 Jun 2008 20:43:55 -0700, "Hoi Wong" <wonghoi@stanford.edu> wrote:

>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: >http://www.stanford.edu/~wonghoi/atmega48lockout.png > >Can anybody suggest what has happened and how can I gain access back to the >chip? I couldn't program, erase, or change anything.
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&#2013266172;&#2013265951;en Frank-Christian Kr&#2013266172;gel
"Hoi Wong" <wonghoi@stanford.edu> wrote in message 
news:g34ni1$op7$1@news.stanford.edu...
>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: > http://www.stanford.edu/~wonghoi/atmega48lockout.png > > 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 > > >
Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and reprogram it using 'med freq Xtal'.
"TT_Man" <Someone@ntlworld.com> wrote in message 
news:C1s5k.168323$UP6.7858@newsfe14.ams2...
> > "Hoi Wong" <wonghoi@stanford.edu> wrote in message > news:g34ni1$op7$1@news.stanford.edu... >>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: >> http://www.stanford.edu/~wonghoi/atmega48lockout.png >> >> 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 >> >> >> > Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and > reprogram it using 'med freq Xtal'. >
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.
">>>
>>> Thanks. >>> >>> Cheers, >>> Hoi >>> >>> >>> >> Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and >> reprogram it using 'med freq Xtal'. >> > > 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. >
Look at the data sheet........ or bring it over to my house and I'll do it while you wait.
On Mon, 16 Jun 2008 11:29:00 -0700, "Hoi Wong" <wonghoi@stanford.edu> wrote:

>> Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and >> reprogram it using 'med freq Xtal'. >> > >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?
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&#2013266172;&#2013265951;en Frank-Christian Kr&#2013266172;gel
"Frank-Christian Kruegel" <dontmailme@news.invalid> wrote in message 
news:need549q4tdd3v4vivedfv0k4uvn2pt5t3@4ax.com...
> On Mon, 16 Jun 2008 11:29:00 -0700, "Hoi Wong" <wonghoi@stanford.edu> > wrote: > >>> Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and >>> reprogram it using 'med freq Xtal'. >>> >> >>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? > > 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&#2013266172;&#2013265951;en > > Frank-Christian Kr&#2013266172;gel
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
On Mon, 16 Jun 2008 13:05:36 -0700, "Hoi Wong" <wonghoi@stanford.edu>
wrote:

>"Frank-Christian Kruegel" <dontmailme@news.invalid> wrote in message >news:need549q4tdd3v4vivedfv0k4uvn2pt5t3@4ax.com... >> On Mon, 16 Jun 2008 11:29:00 -0700, "Hoi Wong" <wonghoi@stanford.edu> >> wrote: >> >>>> Yes, fit a xtal, temporarily to X1X2 ( no need for the 22pf caps), and >>>> reprogram it using 'med freq Xtal'. >>>> >>> >>>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? >> >> 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&#2013266172;&#2013265951;en >> >> Frank-Christian Kr&#2013266172;gel > >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?
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 http://www.avrfreaks.net to see if you can locate somebody. -- Rich Webb Norfolk, VA
> > 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 >
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
"TT_Man" <Someone@ntlworld.com> wrote in message 
news:vcA5k.168794$UP6.124415@newsfe14.ams2...
> >> >> 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 >> > 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 > >
I couldn't even erase it. It seems like the microcontroller is not talking to the programmer at all.