Using EEPROM to store variables...


Closed Thread
Results 1 to 22 of 22

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Then, to get the data back out - I am OK on how to get a byte out, but for a word, i'd need to read the memory location, and memory location +1, reading the lowbyte and highbyte, correct? In this example, I need to retrieve "16472" which is more than a byte.
    Tom,

    looks like you are getting lost with bits, bytes and words.

    you should take a break, have a cup of coffee or tea, and look at my last code example, it does read and write a word at a time.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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


    Did you find this post helpful? Yes | No

    Thumbs up Thanks Group!

    I figured it out. Thanks to all who contributed, it was a 'learning experience'..

    The root of my mis-understanding was this:

    1. WORDS can be stored with a simple I2Cwrite command, and it is not necessary to write variable.byte0, then variable.byte1 in order to do this. Writing a WORD at a memory location just STARTS there and goes forward to the next location (Byte). I did not get this.

    2. If you leave out [ ] around what you are writing or reading, it will pass compiler, but not do anything. This was my biggest issue. I was just writing

    I2Cread , Dpin, Cpin, Chip1, location , data, failroutine

    This works fine, but does not write anything for 'data'... If you do this:

    I2Cread , Dpin, Cpin, Chip1, location , [data], failroutine

    It works PERFECTLY... Once I went back and added the brackets, and made sure I was dealing with WORDS, it all came together..


    THANKS.

    TOM

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


    Did you find this post helpful? Yes | No

    Default

    Good to hear you are back on track!
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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. 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. eeprom how many data can store
    By DragonBall_6 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th December 2006, 11:39
  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