Author |
Message |
Manik Chandra science forum beginner
Joined: 26 May 2006
Posts: 3
|
Posted: Tue Jun 06, 2006 1:17 pm Post subject:
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 |
|
Back to top |
|
 |
Jerry Avins science forum Guru
Joined: 03 May 2005
Posts: 534
|
Posted: Tue Jun 06, 2006 2:18 pm Post subject:
Re: Store values on MPC5xx?
|
|
|
Manik Chandra wrote:
Quote: | 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?
|
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
Back to top |
|
 |
Tim Wescott science forum Guru Wannabe
Joined: 03 May 2005
Posts: 292
|
Posted: Tue Jun 06, 2006 2:21 pm Post subject:
Re: Store values on MPC5xx?
|
|
|
Manik Chandra wrote:
Quote: | 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
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
http://www.wescottdesign.com
Posting from Google? See http://cfaj.freeshell.org/google/
"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html |
|
Back to top |
|
 |
Usenet user science forum Guru Wannabe
Joined: 06 May 2005
Posts: 166
|
Posted: Tue Jun 06, 2006 3:52 pm Post subject:
Re: Store values on MPC5xx?
|
|
|
Quote: | Manik Chandra wrote:
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
|
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 |
|
Back to top |
|
 |
Jerry Avins science forum Guru
Joined: 03 May 2005
Posts: 534
|
Posted: Tue Jun 06, 2006 4:10 pm Post subject:
Re: Store values on MPC5xx?
|
|
|
Tim Wescott wrote:
Quote: | Manik Chandra wrote:
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
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.
|
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
Back to top |
|
 |
Tim Wescott science forum Guru Wannabe
Joined: 03 May 2005
Posts: 292
|
Posted: Tue Jun 06, 2006 4:22 pm Post subject:
Re: Store values on MPC5xx?
|
|
|
Andy Sinclair wrote:
Quote: | Manik Chandra wrote:
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
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
|
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
http://www.wescottdesign.com
Posting from Google? See http://cfaj.freeshell.org/google/
"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html |
|
Back to top |
|
 |
Tim Wescott science forum Guru Wannabe
Joined: 03 May 2005
Posts: 292
|
Posted: Tue Jun 06, 2006 4:24 pm Post subject:
Re: Store values on MPC5xx?
|
|
|
Jerry Avins wrote:
Quote: | Tim Wescott wrote:
Manik Chandra wrote:
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
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.
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
|
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
http://www.wescottdesign.com
Posting from Google? See http://cfaj.freeshell.org/google/
"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html |
|
Back to top |
|
 |
Jerry Avins science forum Guru
Joined: 03 May 2005
Posts: 534
|
Posted: Tue Jun 06, 2006 4:33 pm Post subject:
Battery-backed CMOS RAM. Was "Store values on MPC5xx?"
|
|
|
Tim Wescott wrote:
Quote: | Jerry Avins wrote:
|
...
Quote: | I used to buy a 256-byte DIP RAM chip with a lithium battery built in. I
forget the maker, but no matter.
|
...
Quote: | Dallas used to make them ...
|
Thanks for jogging my memory.
Quote: | And some sort of hardware protection on write is an essential thing, to
be sure.
|
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ |
|
Back to top |
|
 |
Google
|
|
Back to top |
|
 |
|