Eeprom Word Addressing


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Simon Brodeur's Avatar
    Simon Brodeur Guest


    Did you find this post helpful? Yes | No

    Default

    Also, will any previous value at the same address be overwrited?

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


    Did you find this post helpful? Yes | No

    Default

    As long as you increment/decrement your address by 2 you shouldn't overwrite any previous/next data.

    Writing to the same adress ( let's say $06) will overwrite the previous value wich was @ $06 and $07
    Steve

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

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Simon

    I had the same problem with EEprom 16 bits storing ...

    a simple way is to trucate values into Value.lowbyte and value.highbyte

    for addressing, i.e use addresses for Highbytes as 2*n and for lowbytes as 2*n + 1 ...

    and when reading you do the same.

    there's no mix that way - just takes 2 I2CWRITE lines instead of 1 !!!

    as address is defined as a Word ... the count for me is 65536 locations at max ...so, it could explain overwriting some values !!! for 256k you will probably have to add some extra block addressing.

    in French .... would be easier !!! let's say this accelometer makes me think to something in the air ....

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Simon Brodeur's Avatar
    Simon Brodeur Guest


    Did you find this post helpful? Yes | No

    Default

    I resolved some problem in my code, but something trouble me about the FOR...Next loop. My code is :

    For address = 0 to last STEP 4
    I2CREAD SDA,SCL,cbit,address,[xsend.Highbyte]
    address = address + 1
    I2CREAD SDA,SCL,cbit,address,[xsend.Lowbyte]
    ...
    Next


    My value in my EEPROM are like this (numbers are EEPROM locations) :

    01 23 45 67 89
    |xx|yy|xx|yy|xx|...

    Normally, the output value of address should be : 0,4,8,12,16,...
    But will the '' address = address + 1 '' line affect this output, giving result like this : 0,5,10,15,20,... ????????

    This should be an easy question for you

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


    Did you find this post helpful? Yes | No

    Default

    well yes no toaster hamburger. What about the whole variable definition or code?
    Steve

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

  6. #6
    Simon Brodeur's Avatar
    Simon Brodeur Guest


    Did you find this post helpful? Yes | No

    Default

    Here's my whole code... but it may be difficult to follow.

    Check the subroutine LOAD, it is the problem I verified the writing with another program.
    Attached Files Attached Files

Similar Threads

  1. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 02:51
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 04:17
  3. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 08:25
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th July 2008, 00:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 16:23

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