How long will code last without power?

thunderace7

New Member
I'm sure someone has asked before but I can't find it in the archive.
How long will code last without any power being applied to the circuit? I have a picaxe controlling the lights in my kitchen and it has been running continually for over 5 years. Whilst we were on holiday recently there was a power cut and when it was restored all the lights started flashing. My neighbour pulled every plug that she could find in order to stop it.
When I returned I restored the power and found that the 28x1 had died. This might have been because of the power cut or the pulling of all the plugs but it did highlight the need for a reserve circuit. I have built a new box with a 9v power plug, a9 pin D socked for inputs and a 25 pin D socket for outputs so it will be easy to swap it out when it becomes necessary. I have used a 28x2 and rewritten a reduced set of code to suit. My fear is that it will sit in the cupboard unused for another 5 years or so and the code will deteriorate to a point where it won't work when it is needed.
How long will code last if the picaxe is not powered? Is it stored in the same way as the picaxe basic interpreter or in a less robust way? If it is the same then I guess it will last for quite a long time.
Thanks.
 

bpowell

Senior Member
According to the data sheet: Data retention without refresh is conservatively estimated to be greater than 40 years.
 

premelec

Senior Member
@thunderace7 - if your 28x1 actually is damaged it likely happened via a power surge or excess pin current sorts of things so you would do well to look for any such paths and put in a few current limiting resistors and such... there are many paths possible and it's often not easy to discern all of them. Electrolytic capacitors die [high ESR] and such in power supplies with time. Good luck!
 

thunderace7

New Member
Thanks for the replies, looks like program deterioration won't be a problem.
As for the 28x1, it still runs but about half of the outputs have stopped working. All of the outputs feed directly to ULN2803 drivers which feed in to optoisolators so I don't think that excessive current is likely. I'm more inclined to think it was a power surge caused by the supply failure. Maybe some bigger electrolytics on the 5v rail would help. It wouldn't hurt to change the regulator as well in case it got stretched a little.
 

neiltechspec

Senior Member
I've been aware of two recent power incidents locally where damage to my customers devices have occurred (commercial devices, not mine).

Both reported seeing the room lights going extremely bright for a second or so before power fails, indicating extreme supply voltage.
This blew numerous items, most were using 7812 or 7805 voltage regs from transformer derived low voltage and blew mains fuses in numerous others.

Switching type supplies withstood better, with only one failure to a TV.

The one, only affecting two houses, was caused by a faulty underground joint which blew a hole in a driveway.
The other, affecting a whole community, was caused by swans flying into overhead power lines, apparently.

Neil.
 
Top