Making best use of EEPROM Page Memory


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125

    Question Making best use of EEPROM Page Memory

    Folks:

    I have a program that collects 36 bytes per pass, and wants to write this to EEPROM. I am using a big chip, the 24LC512 which can hold:

    512000 bits or 64000 Bytes

    BUT, its page size is 128... So I am forced to increment my address by 128 each time I write 36 bytes!!

    Therefore, If i use the page write [string\36], I use only a little bit of the total chip capacity -- only 36 bytes of each 128. Really only able to use 28% of the memory...

    SO, what to do?

    1. Write a byte at a time? I suppose I could make a loop after I pick up the 36 byte string, and :

    oldaddress ' where we last wrote

    for X = oldaddress to (oldaddress+35)
    I2cwrite DPIN, CPIN, Chip1, X, string[x],failw
    wait 10
    next x

    The problem is that this will take 36 * 10 ms or .36 seconds.. tooo long!


    2. Somehow store up 3 strings and write them every 3rd pass?
    bigstring[108] = string[36] + string2[36] + string3[36]

    ...then write bigstring\108 into memory on each page, thereby only wasting 20 bytes per page??

    Problem there is I think the biggest array is 96.. (and I don't know how to make a big array out of smaller ones.

    3. ?????

    Someone must have some really good ideas about how to deal with this as I am sure it is really common.

    Thanks

    Tom

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    if timing is really important, you can use Ramtron's FRAM that don't need any delay between each byte write. They work the same way or almost as your 24LC512

    BUT there's probably somebody else here who can provide a better solution.

    question only for my own knowledge here... for once... AND NO I DIDN'T compare both... i feel lazy today Is there a big difference between SRAM and FRAM in access speed? OR i'm just comparing orange and potatoe?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default FRAM and EEPROM

    Thanks --

    I have some FRAM coming for testing. I was wondering if there were other programming methods folks have tried (Like cramming data into 128byte pages) somehow to use the less expensive serial EEPROMS..

    The FRAM is 3x the cost!!

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Tom, I beg to differ. The page size of the 24LC512 is 64 bytes. I know this as I have been using it for logging depth and temperature of a towable apparatus used for fishing.

    Dave Purola,
    N8NTA

  5. #5
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    Hmm.. Mine fail at 64b page writes, and a review of the data sheet it clearly says 128. The 24LC51*5* is 64by pagewrite... but it also needs to switch address blocks at 256kbits (upper and lower). the 512 is one block of bits.

    TG

    So nobody has invented a better scheme of using EEPROM pages... ack. Has anyone used Compact Flash with PB Pro then? I see the Proton+ development environment supports CF commands but I don't know about PBP...

  6. #6
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Tom Gonser
    Has anyone used Compact Flash with PB Pro then? I see the Proton+ development environment supports CF commands but I don't know about PBP...
    Hi Tom,
    Check here for PicBASIC code to write/read MMC / SD cards. The 'free' software version does not handle FAT formatting of the cards for use with Windows.

    http://www.compsys1.com/workbench/On...c_project.html

    Arch

  7. #7
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Default

    Thanks for the pointer. I assume with this kind of setup, the strategy is to write 512bytes or so to EEPROM, (in my case 14.2 records) actually 14 records, and I guess nothing goes in the last '.2'.. (also what happens when I read it back? Does the extra unused space show up in read data as $ffff or something?)

    Then, a routine writes from EEPROM to the SD card. Then we'd increment the sector on the SD card and keep going?

    I see that there is code available to write to FAT 16 formatted cards also - for my project this would be a big benefit. However, I don't know much about the SD formats, etc.

    1. Are SD cards pre-formatted as Fat16?
    2. If it is not formatted as FAT16, is there ANY way to read the data from a PC?
    3. What does 'write only one file' mean? I assume just a contigous block of incrementing addresses?

    Why does one use SHIFTIN or SHIFTOUT?? Is it for SPI mode?

    Tom

  8. #8
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Tom, I'm sorry, you are right. I must have been having a serior moment..... I am using the 24LC515.... Oh well, Next time I'll keep my mouth shut......

    Dave Purola,
    N8NTA

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Replies: 4
    Last Post: - 2nd March 2007, 06:12
  3. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  4. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts