Store values on MPC5xx?

Hi all, I want to store some values on an MPC5xx based controller. I want my code to maintain the last set of values on a few variables when it is
shut down, and these values should be accessed the next time the controller is started. How can it be done on the normal Flash memory? Or would I need some other hardware?
.m.c
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Manik Chandra wrote:

Ordinary flash takes a fair bit of time for writing, complicating the power-supply design.. A simpler solution is a small battery-backed RAM of the type used to remember the BIOS settings of a desktop computer.
Jerry
--
Engineering is the art of making what you want from things you can get.

  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Manik Chandra wrote:

This newsgroup is more about theory and techniques of control systems themselves, not the hardware that implements them. Where discussions of hardware are undertaken it is usually about PLCs, not embedded control. So this question is a much better fit for comp.arch.embedded and I have taken the liberty of cross-posting my reply over there.
Usually when you do this sort of thing with Flash you reserve one sector for parameters. When a parameter changes you have to erase the whole sector and re-write it with a copy that has your new parameter embedded in it.
Often if you know ahead of time that you need to save parameters you'll design your board with a serial EEPROM, which lets you manage just the memory space for the parameter you're changing instead of the whole block. You can even get fancy and do cell leveling to extend the life of the EEPROM.
--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Attempting to store variables in the flash of the MPC5xx series is asking for trouble. The flash on these parts is only really suitable for program storage, especially on the MPC555 which requires very careful programming and has a woeful write limit (100 cycles guaranteed).
Unless you have an absolute requirement for not modifying a board design, you should use a serial EEPROM for data storage. I recommend connecting it to one of the SPI ports for easy access.
Andy
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Andy Sinclair wrote:

FTP (Few Times Programmable)?
I've run into this in other processors. Even when I have good quality external flash I vastly prefer the EEPROM method, which is why I mentioned it.
--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Tim Wescott wrote:

I used to buy a 256-byte DIP RAM chip with a lithium battery built in. I forget the maker, but no matter. A 32-kilobyte chip will run off a lithium button cell for about ten years if the chip is used only for safe storage, and a bit less if the parameters are accessed from it in use. Hardware that senses the impending shutdown and blocks the write line before the supply drops so low that proper operation can't be guaranteed is a very worthwhile precaution.
Jerry
--
Engineering is the art of making what you want from things you can get.

  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Jerry Avins wrote:

Dallas used to make them -- I don't know if they survived the transition to Maxim, however. I don't like them because they're big and because I have less faith in the battery than I do in an EEPROM cell.
And some sort of hardware protection on write is an essential thing, to be sure.
--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Tim Wescott wrote:

...

...

Thanks for jogging my memory.

Easy to do when the board is laid out. A bit of a pain to add later unless there's a JIC area.
Jerry
--
Engineering is the art of making what you want from things you can get.

  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.