issues with 24lc1025


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2007
    Posts
    17

    Default issues with 24lc1025

    Hi. Can anybody please explain (with source code if possible) how to access memory over 65535 (I can't use the 24lc1025 over 65535) and how can I append data to the memory (if I switch off the power and turn it back on I want to know where to continue from).

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    <IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1748&stc=1&d=118207160 5">

    In your code you should be able to modify bit3 of your control byte OR you could use 2 different constant
    Code:
    Block0 CON %10100000
    Block1 CON %10101000
    and later you just need to use the according constant
    Code:
    I2CREAD SDA,SCL, Block0, Addr,[YourVar] ' read from Block0
    I2CREAD SDA,SCL, Block1, Addr,[YourVar] ' read from Block1
    <hr>
    You could store the address and the Block in the PIC internal EEPROM (if equipped with) when you turn off the PSU. Battery back-up? Nah, i don't think so.
    http://www.picbasic.co.uk/forum/show...52&postcount=3

    Or it could be possible to detect a Brown-out/Power Down event.
    <hr>
    There's still the option to scan The Whole EEPROM until you reach a specific value or detect a blank cell ($FF).

    But... How long this will need ?
    Attached Images Attached Images  
    Last edited by mister_e; - 17th June 2007 at 10:40.
    Steve

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

  3. #3
    Join Date
    May 2007
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Thanks, but can you please provide me with some code that actually writes to PIC's EEPROM the location where it should continue from, and the one with addressing over 65536 (since this part I didn't really get it)

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by johnmiller View Post
    Thanks, but can you please provide me with some code that actually writes to PIC's EEPROM the location where it should continue from, and the one with addressing over 65536 (since this part I didn't really get it)
    There's a few search hits here that talk specifically about that issue and the fix for it...

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


    Did you find this post helpful? Yes | No

    Thumbs up

    I think something like that have to work
    Code:
    <font color="#000000">Address     <font color="#000080">VAR WORD
    </font>OldAddress  <font color="#000080">VAR WORD
    </font>ControlByte <font color="#000080">VAR BYTE
    </font>Block0      <font color="#000080">CON </font>%10100000
    Block1      <font color="#000080">CON </font>%10101000
    
    Address=0
    ControlByte = Block0
    
    Start:
        <font color="#000080">I2CWRITE </font>SDA, SCL, ControlByte, Address, [0]
        <font color="#000080">PAUSE </font>10
        OldAddress = Address
        Address = Address + 1
        <font color="#000080">IF </font>Address&lt;OldAddress <font color="#000080">THEN      </font><font color="#008000">' Overflow?
                                        ' ----  YES
            </font><font color="#000080">IF </font>ControlByte=Block0 <font color="#000080">THEN  </font><font color="#008000">'       Are we in Block0?
                                        '       ----  YES    
                </font>ControlByte=Block1      <font color="#008000">'               Switch To Block1
                </font>Address = 0             <font color="#008000">'               Start at first address
                </font><font color="#000080">ELSE                    </font><font color="#008000">'       ----  NO
                    </font><font color="#000080">STOP                </font><font color="#008000">'               EEPROM is full.. 
                </font><font color="#000080">ENDIF                   </font><font color="#008000">'
            </font><font color="#000080">ENDIF
        GOTO </font>Start
    Now you just need to keep track of ControlByte and Address values.

    HTH
    Last edited by mister_e; - 17th June 2007 at 21:29.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    johnmiller, (HINT), Use the page write mode as this will increase the available individual data points you can access. I currently use 2 of them for a total of over 2m bits in my TempTracker fishing accessory to log data at 1 second intervals with 2047 records of 128 bytes in page write mode. They work flawlesly. You might want to use page write mode instead of individual location reads and writes as this speeds up the transfer speed during write mode.
    Dave Purola,
    N8NTA

  7. #7
    Join Date
    May 2007
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Thanks mister_e, that worked!

    Dave, I tried to write data to the device using page write mode and it works first time, but when I write to it a second time it just overwrites some data. Here is how I write to it:
    Code:
    var SerData byte [80]
    I2CWRITE SDApin, SCLpin, ControlByte, i2cAddress, [str SerData\80]
    i2cAddress = i2cAddress + 80
    any thoughts on this one?

    I found the same problem here: http://www.picbasic.co.uk/forum/showthread.php?t=347 but nobody posted any response
    Cheers

    PS: I think I know why (after reading some on the internet) and now instead of [str SerData\80] I use 128 (since I read that it overwrites that page with the new contents).
    Last edited by johnmiller; - 20th June 2007 at 03:28. Reason: Maybe that's why...

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


    Did you find this post helpful? Yes | No

    Default

    johnmiller, Yes it will overwrite the locations because it is only writing 80 bytes instead if 128 bytes before you are changing the address.....
    Dave Purola,
    N8NTA

  9. #9
    Join Date
    Feb 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Hello everyone,
    I have the same problem with a 24lc1025, used as a data logger with a 16f876.
    It writes and reads fine on the first block, but won't write anything on the second block.
    Does anyone have any idea ?

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


    Did you find this post helpful? Yes | No

    Default

    novino, Let's see some code......

Similar Threads

  1. 24lc1025 24lc256 external memory
    By JAY.M in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd October 2010, 07:44
  2. SERIN2 buffer issues...
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 16th October 2008, 03:49
  3. Solved: notes on annoying little issues
    By Probotics in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th May 2008, 20:02
  4. Where should I discuss SD/MMC FAT issues?
    By JD123 in forum General
    Replies: 92
    Last Post: - 2nd April 2008, 21:41
  5. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33

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