I2CWRITE writing Strings to EEPROM


Results 1 to 10 of 10

Threaded View

  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default I2CWRITE writing Strings to EEPROM

    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
    Last edited by NavMicroSystems; - 18th December 2004 at 01:06.

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. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  3. My I2CWRITE - timings and tricks
    By FinchPJ in forum Code Examples
    Replies: 5
    Last Post: - 3rd March 2008, 21:40
  4. Code Problem - Strings/ LCD/ internal EEPROM
    By jorge in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 4th February 2008, 20:24
  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 : 0

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