ATmega103 refuses to be erased

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

Hi everyone!
I have encountered a very strange problem with my ATmega103 device.
In my project it gets 4V power supply and uses internal EEPROM. It was
running a simple test program which fills EEPROM with some data
(00,01,02,03...). While it worked, I decided to switch off the power
to see what will happen. Results exceeded expectations. When I powered
it again, EEPROM ceased to work at all! I can read it, but cannot
write to it (EEWE=1 and never becomes 0).
Furthermore, I have found one more serious thing. The device now
cannot be serial programmed. ERASE and WRITE commands doesn't work.
After first ERASE command Flash memory became corrupted and now can't
be written or erased anyway. I tried to change power supply voltage in
4-5V range, but without any result.
My circuit has brown-out detector which resets MCU when Vcc=3,7V.
Does anybody know what has happened and how to revitalize my
device?

admin's test signature
 

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

Hi Michael:

Sounds like a classic case of clearing your lock bits. Guess when you cut power it just really blew the 103's little mind. If either of the 2 lock bits gets reset (i.e. 0) "Further programming of the Flash and EEPROM is disabled." I don't know of a way to get around that.

Regards,
Clark

admin's test signature
 

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

THat's a giant step backward!

I thought we were in a good place with the previous implementations, where you could erase the chip always, you just couldn't read out the code.

I don't get why preventing the chip from being reprogrammed is a good thing.

admin's test signature
 

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

You know, looking back at the datasheet, it does state that "The Lock bits can only be erased to '1' with the Chip Erase command." Maybe if you set your programmer to erase the lock bits it will revive your system. Frankly, I don't use the lock bits so I am only offering that as a suggestion, not expert advice.

Regards,
Clark

admin's test signature
 

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

Hi

Try to select another not ATmega103 AVR-chip and try to erase it. Then select your ATmega103 and try to erase it again. I think, after some this erase-cycles you will erase your ATmega103 without any problems.

Yuri G. Salov

admin's test signature
 

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

Thanks a lot to you all, I solved this problem much more faster than expected. The matter was neither in lock bits nor in chip type. A small leakage of current occured from the circuit which manages 3V lithium battery for ext.SRAM backup. When powered off, MCU was still being powered by 1,5V leakage from the battery. As soon as I had been tuned up the battery switching circuit, the problem disappeared.
Sorry for bad English.
Thanks once more
Michael

admin's test signature
 

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

Hi Michael,

this sounds equal problems on early 1200 and the discontinued tiny22.
On both I detected also, some times it enters a complete hanging state, if voltage rises too fast / too slow / too often or not from zero.
Nothing helps, no watchdog, no brown out detect and no external reset.
Only removing power and waiting a long time (some minutes) to be sure, that powered up from zero.

I think, it's the highest time to solve such problems finally !

Peter

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

In AVR studio, after opening the tool STK500, check the programming, ISP or Parallel, maybe you just hit the wrong bottom.

admin's test signature