Reply by mteversmith February 1, 20052005-02-01

--- In , "gewitter2000" <martin@c...> wrote:
>
> Hi!
>
> Has someone used the flash memory of the lpc21xx for eeprom
purposes?
> Or is it more usefull to take an additive eeprom to the design? I
only
> want to store some parameters.
>
> Thank you for feedback!
> Martin

Ho,

I've implemented an eeprom emulation for a LPC2106 in my "T-Clock"-
project. In the application it's just used to store two bytes for
brightness (backlight LED PWM) and contrast (contrast voltage PWM
AD-converter) values of the GLCD. You may find useful information in
the files iap*.* and the linker-scripts in the archive available from
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/glcd_dcf77
One 8kByte memory-sector is reserved for "persistent storage" but the
emulation is a "512Byte EEPROM" to minimize sector-erase. Basic
approach: IAP and read-modify-write.

HTH
Martin Thomas



An Engineer's Guide to the LPC2100 Series

Reply by lpc2100_fan February 1, 20052005-02-01

Hi Martin,

there has been a thread a while ago with the title "Partial Flash
Programming" which you can use to do a search in the archive. In
particular there was a posting from Philips_apps message # 2681 which
give all the information necessary and some background why the flash
can only be used in chunks of 16 bytes for EEPROM simulation and so on.

hth, Bob --- In , "gewitter2000" <martin@c...> wrote:
>
> Hi!
>
> Has someone used the flash memory of the lpc21xx for eeprom purposes?
> Or is it more usefull to take an additive eeprom to the design? I only
> want to store some parameters.
>
> Thank you for feedback!
> Martin



Reply by microbit February 1, 20052005-02-01
Hi Owen / Martin,

Maybe it's also worth to point out that you can emulate EEPROM closer
by "spreading" the data in Flash, and leaving markers - although I'm not
sure with the sector sizes involved, it would have to be large amounts to
make it worth.
If you have plenty spare Flash, you can get closer to EEPROM by typically
using 4-8 times the amount of Flash, and emulate EEPROM like that.
(ie. for 4 K EEPROM you'd need at least 16K Flash)
If you need further info, send me a direct Email.

Cheers,
Kris > --- In , Owen Mooney <ojm@s...> wrote:
> > Yes I have. Its easy, but you have to use up a whole page (unless
> you read - modify - write) I had lots of spare flash and was typically
> saving a configuration just a few times so these limitations didn't
> matter.
> >
> > Code using IAP instructions below.
> >
> > Accessing the stored structure is just a direct memory access.
> >
> > The write cycle limitations have been well documented by those
> willing to offer an opinion but not answer your question !!!
> >
> > Owen Mooney
> >
> > #define IAP_LOCATION 0x7ffffff1
> >
> > void savesetup(struct SETUP *setup){
> > typedef void (*IAP)(unsigned int [],unsigned int[]);
> > unsigned int command[5];
> > unsigned int result[2];
> > IAP iap_entry;
> > __ARMLIB_disableIRQ();
> > iap_entry=(IAP) IAP_LOCATION;
> > // get part ID
> > command[0]T;
> > result[0]=0;
> > iap_entry(command, result);
> > // result in result[1]
> > // prepare to erase
> > command[0]P;
> > command[1];
> > command[2];
> > iap_entry(command, result);
> > if (result[0] != 0) goto error;
> > // erase
> > command[0]R;
> > command[1];
> > command[2];
> > command[3]745;
> > iap_entry(command, result);
> > if (result[0] != 0) goto error;
> > // prepare to program
> > iap_entry=(IAP) IAP_LOCATION;
> > command[0]P;
> > command[1];
> > command[2];
> > iap_entry(command, result);
> > if (result[0] != 0) goto error;
> > // program
> > command[0]Q;
> > command[1]=0x1C000;
> > command[2]=(int)setup;
> > command[3]Q2;
> > command[4]745;
> > iap_entry(command, result);
> > if (result[0] != 0) goto error;
> > __ARMLIB_enableIRQ();
> > return;
> > error:
> > __ARMLIB_enableIRQ();
> > printf("bum");
> > }
> >
> >
> > Hi!
> >
> > Has someone used the flash memory of the lpc21xx for eeprom purposes?
> > Or is it more usefull to take an additive eeprom to the design? I only
> > want to store some parameters.
> >
> > Thank you for feedback!
> > Martin
> >
> >
> >
> >
> >
> > ____________ > --
------
> Yahoo! Groups Links
>
> a.. To




Reply by gewitter2000 February 1, 20052005-02-01

Hi Owen,

Yes, this helps a lot.
Thank you!

Martin

--- In , Owen Mooney <ojm@s...> wrote:
> Yes I have. Its easy, but you have to use up a whole page (unless
you read - modify - write) I had lots of spare flash and was typically
saving a configuration just a few times so these limitations didn't
matter.
>
> Code using IAP instructions below.
>
> Accessing the stored structure is just a direct memory access.
>
> The write cycle limitations have been well documented by those
willing to offer an opinion but not answer your question !!!
>
> Owen Mooney
>
> #define IAP_LOCATION 0x7ffffff1
>
> void savesetup(struct SETUP *setup){
> typedef void (*IAP)(unsigned int [],unsigned int[]);
> unsigned int command[5];
> unsigned int result[2];
> IAP iap_entry;
> __ARMLIB_disableIRQ();
> iap_entry=(IAP) IAP_LOCATION;
> // get part ID
> command[0]T;
> result[0]=0;
> iap_entry(command, result);
> // result in result[1]
> // prepare to erase
> command[0]P;
> command[1];
> command[2];
> iap_entry(command, result);
> if (result[0] != 0) goto error;
> // erase
> command[0]R;
> command[1];
> command[2];
> command[3]745;
> iap_entry(command, result);
> if (result[0] != 0) goto error;
> // prepare to program
> iap_entry=(IAP) IAP_LOCATION;
> command[0]P;
> command[1];
> command[2];
> iap_entry(command, result);
> if (result[0] != 0) goto error;
> // program
> command[0]Q;
> command[1]=0x1C000;
> command[2]=(int)setup;
> command[3]Q2;
> command[4]745;
> iap_entry(command, result);
> if (result[0] != 0) goto error;
> __ARMLIB_enableIRQ();
> return;
> error:
> __ARMLIB_enableIRQ();
> printf("bum");
> } > Hi!
>
> Has someone used the flash memory of the lpc21xx for eeprom purposes?
> Or is it more usefull to take an additive eeprom to the design? I only
> want to store some parameters.
>
> Thank you for feedback!
> Martin > ____________



Reply by 42Bastian Schick February 1, 20052005-02-01

> AFAIK FRAM does not have unlimited life. It was around 10^6 cycles
> when I forst looked at it many years back and I believe it is now
> around 10^12 cycles, compared to around 10^5 cycles for EEPROM and
> flash.

For the FM23CL64 Ramtron claims Unlimited Read/Write cycles ! --
42Bastian Schick



Reply by 42Bastian Schick February 1, 20052005-02-01
> Because it is "just like RAM" once might be tempted to try place
> variables in FRAM or data items that you read frequently (data as
> well as code). In this case you could hit that 10^12 cycles pretty
> fast. With worst case code on an LPCxxx style device you could end up
> hitting the FRAM for more than 10^7 cycles per second, giving only a
> useful life of 10^5 seconds or just over a day.

Not quiet right. I just looked up on datasheet at Ramtron.
The max. bus-freq. is 1E6 Hz for a 256KB FRAM.
20bits to read memory => max. 50000 reads/s
The chip I look at has an endurance of 1E10, gives 200.000s ~= 138d.

Also not forever, but slightly longer :-)

> As always, design with your eyes open!
Anyway a good hint :-)

--
42Bastian Schick



Reply by Robert Adsett February 1, 20052005-02-01
At 04:25 AM 2/1/05 +0000, embeddedjanitor wrote:
>AFAIK FRAM does not have unlimited life. It was around 10^6 cycles
>when I forst looked at it many years back and I believe it is now
>around 10^12 cycles, compared to around 10^5 cycles for EEPROM and
>flash.


They rate the low voltage devices as unlimited read/write cycles (I just
re-checked). As I recall, it is only within the last couple of years that
devices rated for that have been available. The high voltage (5V) devices
range from 10^10 to 10^12 read/write cycles. The write speed of FRAM
compared to ee is certainly an advantage but I wouldn't want to put a
millisecond clock in an older device.

Robert

" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "

Kelvin Throop, III


Reply by Varuzhan Danielyan February 1, 20052005-02-01
Dear embeddedjanitor,

Please, open your eyes and have a look to www.ramtron.com. You will see, that many
of their FRAMs now have not any write/read cycles limiting!

Varuzhan

----- Original Message -----
From: embeddedjanitor
To:
Sent: Tuesday, February 01, 2005 8:25 AM
Subject: [lpc2000] Re: Using flash memory instead of eeprom?
AFAIK FRAM does not have unlimited life. It was around 10^6 cycles
when I forst looked at it many years back and I believe it is now
around 10^12 cycles, compared to around 10^5 cycles for EEPROM and
flash.

The smallprint though is that for EEPROM and flash, the endurance
counts only the write cycles and not read cycles whereas FRAM
endurance counts both.

Because it is "just like RAM" once might be tempted to try place
variables in FRAM or data items that you read frequently (data as
well as code). In this case you could hit that 10^12 cycles pretty
fast. With worst case code on an LPCxxx style device you could end up
hitting the FRAM for more than 10^7 cycles per second, giving only a
useful life of 10^5 seconds or just over a day.

As always, design with your eyes open!

--- In , Robert Wood <robert.wood@a...> wrote:
> Serial FRAM is available and not too outrageously priced now. Not
as cheap as
> EEPROM, but if your project isn't cost sensitive it works a treat
and you
> have unlimited life non-volatile memory.
>
> --------------------------
>
> There are many serial flash devices (I Use SST25vf512)that guarantee
> 100K cycles and 100 years. Flash offers byte write and sector
erase,
> while EEPROM offers both byte write and erase but are SLOW.
>
> Richard
>
> --- In , "gewitter2000" <martin@c...> wrote:
> >
> > Hi!
> >
> > Has someone used the flash memory of the lpc21xx for eeprom
purposes?
> > Or is it more usefull to take an additive eeprom to the design? I
only
> > want to store some parameters.
> >
> > Thank you for feedback!
> > Martin >
> Yahoo! Groups Links


------
Yahoo! Groups Links

a.. To


Reply by embeddedjanitor February 1, 20052005-02-01

AFAIK FRAM does not have unlimited life. It was around 10^6 cycles
when I forst looked at it many years back and I believe it is now
around 10^12 cycles, compared to around 10^5 cycles for EEPROM and
flash.

The smallprint though is that for EEPROM and flash, the endurance
counts only the write cycles and not read cycles whereas FRAM
endurance counts both.

Because it is "just like RAM" once might be tempted to try place
variables in FRAM or data items that you read frequently (data as
well as code). In this case you could hit that 10^12 cycles pretty
fast. With worst case code on an LPCxxx style device you could end up
hitting the FRAM for more than 10^7 cycles per second, giving only a
useful life of 10^5 seconds or just over a day.

As always, design with your eyes open!

--- In , Robert Wood <robert.wood@a...> wrote:
> Serial FRAM is available and not too outrageously priced now. Not
as cheap as
> EEPROM, but if your project isn't cost sensitive it works a treat
and you
> have unlimited life non-volatile memory.
>
> --------------------------
>
> There are many serial flash devices (I Use SST25vf512)that guarantee
> 100K cycles and 100 years. Flash offers byte write and sector
erase,
> while EEPROM offers both byte write and erase but are SLOW.
>
> Richard
>
> --- In , "gewitter2000" <martin@c...> wrote:
> >
> > Hi!
> >
> > Has someone used the flash memory of the lpc21xx for eeprom
purposes?
> > Or is it more usefull to take an additive eeprom to the design? I
only
> > want to store some parameters.
> >
> > Thank you for feedback!
> > Martin >
> Yahoo! Groups Links




Re: Using flash memory instead of eeprom?
Re: Using flash memory instead of eeprom?
Re: Using flash memory instead of eeprom?
Reply by Owen Mooney January 31, 20052005-01-31
Yes I have. Its easy, but you have to use up a whole page (unless you read - modify - write) I had lots of spare flash and was typically saving a configuration just a few times so these limitations didn't matter.

Code using IAP instructions below.

Accessing the stored structure is just a direct memory access.

The write cycle limitations have been well documented by those willing to offer an opinion but not answer your question !!!

Owen Mooney

#define IAP_LOCATION 0x7ffffff1

void savesetup(struct SETUP *setup){
typedef void (*IAP)(unsigned int [],unsigned int[]);
unsigned int command[5];
unsigned int result[2];
IAP iap_entry;
__ARMLIB_disableIRQ();
iap_entry=(IAP) IAP_LOCATION;
// get part ID
command[0]T;
result[0]=0;
iap_entry(command, result);
// result in result[1]
// prepare to erase
command[0]P;
command[1];
command[2];
iap_entry(command, result);
if (result[0] != 0) goto error;
// erase
command[0]R;
command[1];
command[2];
command[3]745;
iap_entry(command, result);
if (result[0] != 0) goto error;
// prepare to program
iap_entry=(IAP) IAP_LOCATION;
command[0]P;
command[1];
command[2];
iap_entry(command, result);
if (result[0] != 0) goto error;
// program
command[0]Q;
command[1]=0x1C000;
command[2]=(int)setup;
command[3]Q2;
command[4]745;
iap_entry(command, result);
if (result[0] != 0) goto error;
__ARMLIB_enableIRQ();
return;
error:
__ARMLIB_enableIRQ();
printf("bum");
} Hi!

Has someone used the flash memory of the lpc21xx for eeprom purposes?
Or is it more usefull to take an additive eeprom to the design? I only
want to store some parameters.

Thank you for feedback!
Martin ____________



Re: Subject: Using flash memory instead of eeprom?
Re: Subject: Using flash memory instead of eeprom?