PDA

View Full Version : I2CWRITE writing Strings to EEPROM



NavMicroSystems
- 18th December 2004, 00:39
Undocumented Feature?

On one of my current projects I had the challenge to store about 300 strings
(up to 20 chars each)

The strings contain system messages
and a (very) complex menu structure.

I decided to store the strings in an external EEPROM (24FC512)
which was already on board for data logging.

After having done some first tests I had to realize that
every time when I had a firmware update that required changes in Menu text or system messages
I had to take the EEPROM off the board, reprogram it and plug it back.

This is certainly nothing a customer could do.

So I thought I needed some kind of Loader for the EEPROM.

The trick is:

Write the string to the EEPROM:

(The PBP Manual doesn't tell this is possible)

IC2WRITE SDA, SCL, ADR, [20,"This is my String #1"]
where 20 is the length of the srting.

My finding is:
This "Page Write" works great as long as ADR is a multiple of 32.
(haven't tried odd multiples of 16 as my Strings are up to 20 bytes)

Next step is to "compress" the Data we have just written to the EEPROM.
(We used up 32 bytes for 21 Bytes of information)

Read the EEPROM content bytewise and write it back bytewise
and use a multilpe of 21 for the starting address of a new string.

And finally (if you want to) fill up all "unused" locations with $FF

So in case the Strings in EEPROM are to be updated along with Firmware of the PIC
all the customer needs to do is:
Flash the device twice,
1st with the EEPROM Loader that does the EEPROM update
and then with the latest Firmware.

regards

Ralph

mister_e
- 18th December 2004, 11:48
Hi Ralph, That's exactly what i do in my currents project. This is really working great. I'm to develop an user interface to flash directly the target PIC/EEPROM with a simple clic, everything else will be done by software. I'll let you know as soon i'll finish it... must have time before :)

regards

NavMicroSystems
- 18th December 2004, 14:37
Originally posted by mister_e
... I'm to develop an user interface to flash directly the target PIC/EEPROM with a simple clic, everything else will be done by software. I'll let you know as soon i'll finish it... must have time before :)

regards

Sounds good !

NavMicroSystems
- 29th January 2005, 11:55
Hi Steve,

any progress with your "FlashLoader" ?

regards

Ralph

mister_e
- 29th January 2005, 21:36
Not at this point, many stuff to be finished before... still need time.

i've plan a program to edit EEPROM that allow to move/insert/delete EEPROM addresses. Handy IMO.

I've a snippet that work, I'll let you know as soon as it's finished.

Tom Gonser
- 27th March 2005, 16:51
Using the same 25LC512 EEPROMs, I have a similar issue I think...

I write 36 bytes per record which I get every .25 seconds.. maybe faster. I want to write these to EEPROM, but not take a whole page (128b). I understand I can't write to addresses in the size I want, ie 0, 36, 72, 108, 144, etc, but rather only 0, 128, 256, etc.... This leads to massive waste of space

How does one make use of the unused EEPROM space? I can't write byte at a time because it takes too long...

1. If I page write to anything from 0 to 128 will it overrite that page?

2. Should I be thinking about a way to save data into a string that is 128b long before writing it? Like perhaps creating a 'superstring' that has 3 x 36 bytes, and write that (only wasting 20b per page?)

Thanks,

Tom

NavMicroSystems
- 27th March 2005, 19:21
TOM,

you haven't told us all details,
but let's do some math based on the info we have:

36 bytes per record
one record every 250 ms
EEPROM size 512kbit

You can store about 1770 records
It will take about 7.5 minutes to completely fill up your EEPROM.

Probably FRAM would be a better choice.

Tom Gonser
- 27th March 2005, 19:26
Ralph:

Be happy to fill in any gaps, I was trying to be as complete as I could without using too much junk..

You are right about 7.5 min per chip if I can not waste any space.. Two chips = 15 min at that rate, at 1 second update much more.

I am not familiar with FRAM.. How is it used? Does PBP work easily with it?

Tom

Archilochus
- 27th March 2005, 19:43
I am not familiar with FRAM.. How is it used? Does PBP work easily with it?
Tom

The FRAM is great! Virtually unlimited write cycles, writes data as its clocked in with no write delay, single byte writes, available in SPI, I2C etc.
Check out Ramtron.

Arch

NavMicroSystems
- 27th March 2005, 19:45
TOM,

FRAM is handeled just like EEPROM (I2C)

have a look at www.ramtron.com