Storing info on the Flash area

Started by hc08jb8 January 13, 2004
Hello again

I have another question and to keep the message threads consistent I
am posting this as another entry.

If I need to store a application parameter in the FLASH area what
should I look into? I hear that you can only bulk erase the flash,
would it be possible to just to erase/modify a byte location? I need
to keep a user defined unique ID for each mcu, which may be changed
in the field after deployment.

Thanks again
Jay



The HCS12 can sector modify the EEPROM...but it does so 32 bits at a
time.

John -----Original Message-----
From: hc08jb8 [mailto:]
Sent: Tuesday, January 13, 2004 9:06 AM
To:
Subject: [68HC12] Storing info on the Flash area Hello again

I have another question and to keep the message threads consistent I
am posting this as another entry.

If I need to store a application parameter in the FLASH area what
should I look into? I hear that you can only bulk erase the flash,
would it be possible to just to erase/modify a byte location? I need
to keep a user defined unique ID for each mcu, which may be changed
in the field after deployment.

Thanks again
Jay --------------------To learn more
about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu o learn more about Motorola
Microcontrollers, please visit http://www.motorola.com/mcu


>I hear that you can only bulk erase the flash,
> would it be possible to just to erase/modify a byte location?

The C32 has emulated EEPROM using the FLASH. It can be sector erased
and word modify.

However, if modifying same address then the whole sector needs to be
read and stored in RAM. After the DATA are saved then the sector is
erased. Modify the DATA in RAM then write to FLASH.

I haven't done it but that is how it was explained to me.



--- In , "zeta_alpha2002" <zeta_alpha2002@y...> wrote:
> >I hear that you can only bulk erase the flash,
> > would it be possible to just to erase/modify a byte location?
>
> The C32 has emulated EEPROM using the FLASH. It can be sector erased
> and word modify.
>
> However, if modifying same address then the whole sector needs to be
> read and stored in RAM. After the DATA are saved then the sector is
> erased. Modify the DATA in RAM then write to FLASH.

I have implemented such a scheme for the EEPROM.
It allows a byte/word/sector write, on or accross boundaries.
Of course in this case it is 32 bits or 64 bits retrieve, store and modify ram and then rewrite to EE.

It was done as an excersize to discover the methods needed for this type of device, flash would be very similar but for larger sectors.

The files are avilable in the files area, they are commented and work in my test setup, they have not been used in production.

Feel free to use and improve if wanted, improvements are welcome back in the files area:-)

Cheers,

Theo



You can program the eeprom one word, line or block at at time. I saw an
application note somewhere on the motorola site but do not remember all the
details. If you want some example code for working with the eeprom and/or
flash, or even using an external serial eeprom you can check out Prof
Han-way Huang's book on the 68HC12 series (ISBN 0-7668-83448-4). His
examples do work as I can verify! SCF
----- Original Message -----
From: John Theofanopoulos
To:
Sent: Tuesday, January 13, 2004 9:15 AM
Subject: RE: [68HC12] Storing info on the Flash area The HCS12 can sector modify the EEPROM...but it does so 32 bits at a
time.

John -----Original Message-----
From: hc08jb8 [mailto:]
Sent: Tuesday, January 13, 2004 9:06 AM
To:
Subject: [68HC12] Storing info on the Flash area Hello again

I have another question and to keep the message threads consistent I
am posting this as another entry.

If I need to store a application parameter in the FLASH area what
should I look into? I hear that you can only bulk erase the flash,
would it be possible to just to erase/modify a byte location? I need
to keep a user defined unique ID for each mcu, which may be changed
in the field after deployment.

Thanks again
Jay --------------------To learn more
about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu o learn more about Motorola
Microcontrollers, please visit http://www.motorola.com/mcu
--------------------To learn more
about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu
o learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu

----
--
Yahoo! Groups Links

a.. To