confuse page write??


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2008
    Posts
    85

    Default confuse page write??

    i have a confusion of understanding on page write can people help, really thanks,

    for 24lc 256

    64 bytes are writable on 1 page @ 1 shot.
    but a boundary page is 256 bytes (EEprom in the pic?)
    the 24lc256 is 32k bytes, so there are 500 pages in the 24lc256? just simple calculation, i do not understand much,

    thanks in advance for your explaination

    MInh Le

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    Array       Var  Byte [100]
    AA          Var Byte 
    Address   Var Word
    
    I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\64]
    'This command will write one page of 64 bytes starting from address position
    
    I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\10]
    'This command will write 10 bytes starting from address position
    
    
    I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\100]
    'This command will NOT write 100 bytes starting from address position
    
    'If you need to write 100 bytes then you will need two write instruction:
    
    'First
    
    I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\64]
    'This command will write one page of 64 bytes starting from address position
    
    Address = Address + 64
    For AA = 0 to 35
    Array[AA]=Array[AA+63]
    next AA
    
    ' Moving remaing bytes in the low side of the array
    
    I2CWRITE DataPin, ClockPin, Control, Address, [Str Array\36]
    [COLOR="Red"]'This command will write the remaining 36 bytes starting from 
    address but in the following page.
    In the last example, since 100 is not a multiple of 63 will give you a lot of problem in writing the remaining pages since in the second page after the two writing sequence the space left in the second page is 64-36 = 28 Bytes.

    Hoping now is sligtly more clear.

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    many thanks Aratti

    how about the page boundary 256 bytes is this located in the pic?
    if so, when i use LOOKUP, the boundary is 256 bytes

    LOOKUP I, [1st.......255th], BUFFER ;( i go 0 to 255)

    I = 0 to 255
    K = 1 TO 4 ; loop for 4 pages
    IF I = K*63 THEN ; loop for 1 page of writing
    I2CWRITE ...... I, [STR BUFFER\64]
    PAUSE 15
    ( i preload data into LOOKUP then write them on the External eeprom

    I confuse BUFFER in the LOOKUP it should be BUFFER[1000] for example ?
    thanks again,
    Minh LE

    .......
    Last edited by MINHLE; - 21st April 2010 at 22:30. Reason: correct something

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Hi MINHLE, I have to admit that I did understand what you are trying to do!

    how about the page boundary 256 bytes is this located in the pic?
    if so, when i use LOOKUP, the boundary is 256 bytes
    You should not worry PBP will take care of the pic internal page boundary.

    The code you have posted for tranferring 256 byte from your lookup table to the serial eeprom will not work. Here a working snippet:

    Code:
    AA      var Word
    KK      var Byte
    II       var Byte
    Buffer Var Byte [64]
    
    For KK = 0 to 192 step 64
    
    For II = 0 to 63
    
    AA = II + KK
    
    Lookup AA,[1st.......255th], Buffer[II]
    
    Next II
    
    AA = AA - 63
    
    I2CWRITE DataPin, ClockPin, Control, AA, [Str Buffer\64]
    
    Next KK
    Al.
    Last edited by aratti; - 21st April 2010 at 23:07.
    All progress began with an idea

  5. #5
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Thanks a lot Aratti,


    I see clearly now,

    the data loaded into a pic is limited. in case of the volume of external Eeprom is bigger than that of internal eeprom? but i do not have a eeprom programmer


    thanks a gain Aratti,
    Minh LE

  6. #6
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Eeprom again

    Hello Aratti,
    thanks a lot for your help,
    i realize that i should not have to use an external eeprom. the pic 16f877a containes an 8k bytes, a lot of space to be written on. the problem now is how to write data on these pages (FLASH MEMORY), use DATA , EEPROM or other PBP commands; or copy the code from data sheet?

    but,,, not sure i understand all.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    the pic 16f877a containes an 8k bytes, a lot of space to be written on
    Be carefull because 8Kb are code space ram. Available eeprom is 256 bytes ( see table attached)

    Read PEEKCODE and POKECODE commands @ pag 113 & 115 of PBP manual.

    Al.
    Attached Images Attached Images  
    All progress began with an idea

  8. #8
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    thanks a lot Aratti,

    i see now, and will try it later,

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