mega128 doesn't work anymore

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I have a circuit board with a Mega128, voltage regulator etc. I used the old version of the board for 2 years without problems. Since two days, I have a new one which worked fine, too (same electronics).

I flashed the mega128 about 8 or 9 times since yesterday. Then, from one moment to the other, AVR Studio says: Entering Programming Mode: FAILED!
and the program which is already on the chip doesn't work too, but worked fine before.

Question: Is it possible that the mega128 is damaged? I used the internal clock with 8MHZ and think that I did not set any lock bits. I'm a little bit surprised because this never happend during the past years with the old board.

5V supply is still ok, reset pins etc. are exaclty as they were before. I use an STK500 to programm the chip.

Thanks,
tappo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I completely hosed a mega128 one time by accidentally changing the clock mode to (I believe) an undefined mode. It was my error, but it made the processor completely unresponsive to everything. If I remember right, CKOPT was programmed and CKSEL3-0 was 0100.

Anyway, long story short I ended up replacing the controller. Afterward, I remember finding a hint that using a JTAG programmer (which I didnt have) might have been able to correct it.

James McKenna
Denver, CO, USA

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try putting a clock signal on the XTAL1 pin, 32KHz works well with the AVRISP, this should allow you to correct your fuses. Most of the external clock/xtal modes work well enough with a clock source on teh XTAL1 pin to correct any fuse errors. (also be sure to set the SPI programming clock to 32KHz in AVRstudio as well) IIRC 1MHz works better with ponyprog.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.