Eeprom 24lc256


Closed Thread
Results 1 to 8 of 8

Thread: Eeprom 24lc256

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    22

    Unhappy Eeprom 24lc256

    Hi,
    This program works well whit EEPROM 24LC02B street I2C with the pic16F84A.
    With the EEPROM 24LC256 and 24C32 don't work.
    There are not other EEPROM in fall therefore byte of control is "% 10100000."
    Help..


    '16F84A scrittura su EEPROM
    INCLUDE "Modedefs.bas"
    DEFINE CHAR_PACING 10
    DEFINE OSC 4


    SCL Var PORTA.1
    SDA Var PORTA.0
    Addr Var byte
    E_ByteOut Var Byte
    E_ByteIn Var Byte

    serout PORTB.4,2,[12,1]

    For Addr = 0 To 50
    E_ByteOut = Addr*3
    I2CWRITE SDA,SCL,%10100000,Addr,[E_ByteOut]
    Pause 10
    Next Addr

    pause 1000

    For Addr = 0 To 50
    I2CREAD SDA,SCL,%10100000,Addr,[E_ByteIn]
    serout PORTB.4,2,["Indirizzo = "]
    serout PORTB.4,2,[#Addr,10,13 ]
    serout PORTB.4,2,[" EEPROM = "]
    serout PORTB.4,2,[#E_ByteIn ]
    Pause 100
    serout PORTB.4,2,[12,1]
    Next Addr
    end

  2. #2
    Join Date
    Mar 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Unhappy Eeprom 24lc256

    Hi,
    This program works well whit EEPROM 24LC02B street I2C with the pic16F84A.
    With the EEPROM 24LC256 and 24C32 don't work.
    There are not other EEPROM in fall therefore byte of control is "% 10100000."
    Help..


    '16F84A write on EEPROM

    INCLUDE "Modedefs.bas"
    DEFINE CHAR_PACING 10
    DEFINE OSC 4


    SCL Var PORTA.1
    SDA Var PORTA.0
    Addr Var byte
    E_ByteOut Var Byte
    E_ByteIn Var Byte

    serout PORTB.4,2,[12,1]

    For Addr = 0 To 50
    E_ByteOut = Addr*3
    I2CWRITE SDA,SCL,%10100000,Addr,[E_ByteOut]
    Pause 10
    Next Addr

    pause 1000

    For Addr = 0 To 50
    I2CREAD SDA,SCL,%10100000,Addr,[E_ByteIn]
    serout PORTB.4,2,["Indirizzo = "]
    serout PORTB.4,2,[#Addr,10,13 ]
    serout PORTB.4,2,[" EEPROM = "]
    serout PORTB.4,2,[#E_ByteIn ]
    Pause 100
    serout PORTB.4,2,[12,1]
    Next Addr
    end
    ----------------------------------
    THX chip_s

  3. #3
    Join Date
    Mar 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Unhappy Eeprom 24lc256

    Hi,
    This program works well whit EEPROM 24LC02B street I2C with the pic16F84A.
    With the EEPROM 24LC256 and 24C32 don't work.
    There are not other EEPROM in fall therefore byte of control is "% 10100000."
    Help..


    '16F84A write on EEPROM

    INCLUDE "Modedefs.bas"
    DEFINE CHAR_PACING 10
    DEFINE OSC 4


    SCL Var PORTA.1
    SDA Var PORTA.0
    Addr Var byte
    E_ByteOut Var Byte
    E_ByteIn Var Byte

    serout PORTB.4,2,[12,1]

    For Addr = 0 To 50
    E_ByteOut = Addr*3
    I2CWRITE SDA,SCL,%10100000,Addr,[E_ByteOut]
    Pause 10
    Next Addr

    pause 1000

    For Addr = 0 To 50
    I2CREAD SDA,SCL,%10100000,Addr,[E_ByteIn]
    serout PORTB.4,2,["Addr = "]
    serout PORTB.4,2,[#Addr,10,13 ]
    serout PORTB.4,2,[" EEPROM = "]
    serout PORTB.4,2,[#E_ByteIn ]
    Pause 100
    serout PORTB.4,2,[12,1]
    Next Addr
    end
    ----------------------------------
    THX chip_s

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default maybe

    Maybe you should consider if a byte is really enough for the addressing. It could be that a really tiny ee2 has a byte as address but the bigger ones might need a word.

    you can probably see this in the datasheet :-)

    24lc02b (256 * 8 bit) so a byte is nice for this.
    24lc32 (4K *8 bit ) so here we need more than a byte for addressing

    /me

  5. #5
    Join Date
    Mar 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Default replay

    Then as I can modify my program?
    chip_s

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


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Just look at how the 3 MSB addresses must appear ... ( AKA ... see datasheet ! )

    I think a SEARCH will show you the subject is well known ...

    Alain
    Last edited by Acetronics2; - 23rd March 2008 at 17:32.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    I think a SEARCH will show you the subject is well known ...
    Or unknown apparently!

  8. #8
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    The address is a word on this eeprom, not a byte. PBP catches this automatically. Just change the address to a word (2 byte address data size)

    Addr Var byte > Addr Var word

    Oh, and STOP the spam!
    Last edited by JD123; - 23rd March 2008 at 19:23.
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

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. Pic16F628A and 24LC256 EEPROM I2C
    By Mike96 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st January 2006, 03:13
  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