+ Reply to Thread
Results 1 to 5 of 5

Thread: Testing EEPROM Size

  1. #1

    Default Testing EEPROM Size

    I have several projects that use multiple Propellers all loaded with the same code. I assign an ID number to each Prop and store the ID number in upper EEPROM.

    This ID number is read by the Propellers and is used in several of my Prop to Prop communication protocols.

    I'm trying to make my "Assign ID" program a bit more user friendly. I have the program check the EEPROM to see if anything is already written to the area of upper EEPROM where I store the ID number, prior to writing the ID number. I also want the program to check if the EEPROM is at least 64K (hopefully without writing to the EEPROM).

    My current technique is to read 64 bytes from lower EEPROM starting at address $30 and then reading 64 bytes from address $8030. If the two 64 byte samples are the identical to each other, then I assume it's only a 32K EEPROM. (I believe that's the way a 32K version work; it treats addresses higher than $7FFF as if they were $8000 locations lower.)

    I've learned from Mike Green's FemtoBasic (and the chips' datasheet) that Winbond memory chips use a JEDEC device number. I couldn't find information about any sort of ID number in the EEPROM datasheet.

    Do any of you have suggestions on why to tell a 32K EEPROM from a 64K EEPROM? I know I could write to the EEPROM to test its size but I was wondering if there were a different way.

  2. #2

    Default Re: Testing EEPROM Size

    Duane, why don't you read a byte from the highest possible address and store it.
    Then write a different byte to that adddress and read it back in.
    If you get back what you wrote, rewrite the original byte back where it came from.

    Not elegant but should work.

  3. #3

    Default Re: Testing EEPROM Size

    Ron has the right idea, but you read a value from $7FFF and then another from $FFFF. You then write the 1's complement of the $7FFF value into $FFFF and read from $7FFF again. If the value at $7FFF is the same as the saved $7FFF, you have a 64K or larger EEPROM and you restore the $FFFF value from where you saved it. Otherwise you have a 32K EEPROM and you restore $7FFF from the saved $7FFF.

  4. #4

    Default Re: Testing EEPROM Size

    Thanks Ron and Mike.

    Ron, as Mike points out I have check the EEPROM in two places because a 32K EEPROM will read and write the value from an address 32K lower than the 64K EEPROM (the 32K version just wraps the address back to zero at address $8000).

    Mike, Thank you for your answer. I was just admiring the way your Winbond driver sets "maxSize" based on the JEDEC code and hoping for something as elegant to use with EEPROM chips. I'll use your suggestion.

  5. #5

    Default Re: Testing EEPROM Size

    This topic has come up a couple of times lately.

    I've posted the program that checks the EEPROM size here.

    I'm also attaching the program to this post to make easier for others to find it.

    It uses a baud of 57,600bps. It gives you a couple of seconds to open a terminal window before displaying the EEPROM information.

    See the post linked to above for the expected output.

+ Reply to Thread

Similar Threads

  1. Testing a new logo for size
    By Humanoido in forum Test Forum
    Replies: 0
    Last Post: 08-06-2011, 11:29 AM
  2. Replies: 2
    Last Post: 04-20-2007, 12:07 AM
  3. Bigger size eeprom for BS2
    By ion in forum BASIC Stamp
    Replies: 2
    Last Post: 10-08-2004, 12:06 PM
  4. Size Limit of EEPROM
    By Archiver in forum BASIC Stamps Archive
    Replies: 1
    Last Post: 02-14-2002, 12:34 AM
  5. Parallax BS2 OEM and eeprom size
    By Archiver in forum BASIC Stamps Archive
    Replies: 2
    Last Post: 10-25-2001, 10:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

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