M128 flash gets trashed?

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

Hi all

I have seen this happening a number of times:
the M128 runs fine for a long time and then one day when you switch the circuit on, it is dead or it is just funny. If you re-download the firmware, everything is cool again. This happens with both the bootloader and application firmware. If I enable the on-chip BOD, the problem is much better, but it still happens now and then, so this shows me that the problem has something to do with brown-outs, and also that the on-chip BOD is not that great.

anyone with experience on this matter?

regards
carel

www.pteq.net
Home of:
- Polygon Technologies CC

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

Instead of simply reloading the firmware do a verify instead, then you'll know whether it's really corrupted or not.

My guess is that you have a bug.

My Mega128 based units have run continuously and worked reliably for years without resetting, watchdogging or anything nasty.

I don't think you can blame the chip.

Nigel

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

Hi,

I had a similar problem with an 8515 or 8535 long ago. When the supply
was disconnected and the voltage ran down too slow because of the VDD
capacitor, then the flash memory was corrupted and I had to reprogram the chip. Later I tried using an external reset circuit (TL7705) at the reset
pin, so that reset became low before VDD ran slowly down. The problem
disappeared.

But I never had problems like these with a Mega128.

Regards,
Armin

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

Avrfreakscarel wrote:
one day when you switch the circuit on, it is dead or it is just funny. If you re-download the firmware, everything is cool again. This happens with both the bootloader and application firmware. If I enable the on-chip BOD, the problem is much better

"bootloader" sounds like you use SPM to reprogram the device. You should note that if you do that, then you must make absolutely sure that the power supply does not drop while you are in the middle of reprogramming. If power drops before you have reprogrammed everything, you will have a temporary result, and if it drops in the middle of an SPM the result is undefined. The BOD cannot stop this situation from happening. The BOD will simply prevent the CPU from executing when power is too low, to prevent unintentional SPM, EEPROM write and so on. It is the entire application that must determine when it is safe to reprogram the Flash in such a way that everything can be reprogrammed without being interrupted by too low power (or reset or code run-away or...). Since you mention the BOD it seems you might have a situation with unstable power. The first step should be to ensure that you never run SPM in situations with unstable power.

Hope this helps.
Arne

There are 10 kinds of people, those who understand binary and those who don't