EEPROM 24lc02b


Closed Thread
Results 1 to 5 of 5

Thread: EEPROM 24lc02b

  1. #1
    Join Date
    Mar 2008
    Posts
    22

    Default EEPROM 24lc02b

    Hi to everybody,
    I have climbed on on the breadbord the circuit brought in the manual of the picbasic advantage related to the writing of an external eeprom.
    The brought code doesn't work. Why?
    thanks
    chip_select


    ----------------------------------------------------------------------------


    'PIC 16F84A & 24LC02B
    'LCD DEVANTECH 16 X 4 SERIAL

    include "modedefs.bas"
    define osc 4


    addr var byte
    dati var byte
    RD var byte
    dpin var porta.0
    dclk var porta.1


    for addr = 0 to 10
    dati = ADDR * 16
    i2cwrite dpin,dclk,%10100000,addr,[dati]
    pause 10
    next addr

    pause 1000

    serout portb.0,2,[12,1]
    PAUSE 400
    for addr = 0 to 10
    i2cread dpin,dclk,%10100000,addr,[RD]
    pause 10
    serout portb.0,2,["EEPROM CELL: "]
    serout portb.0,2,[#RD]
    PAUSE 40
    serout portb.0,2,[12,1]
    next addr

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by chip_select View Post
    The brought code doesn't work. Why?
    Do you have pullups on SDA and SCL?
    Also, use a STOP or END at the very end of your program...

  3. #3
    Join Date
    Mar 2008
    Posts
    22


    Did you find this post helpful? Yes | No

    Default eeprom

    Hi, I have been used 2 resistances of pull-up by 1k as suggested by the tutorial of the microchip.
    I will add "end" at the end of the program.
    thanks
    chip_select

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by chip_select View Post
    Hi, I have been used 2 resistances of pull-up by 1k as suggested by the tutorial of the microchip.
    1K might be a bit strong in a single chip situation. Try 4.7K and 10K also.

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


    Did you find this post helpful? Yes | No

    Default

    Common issues are not pulling WP lead to Vss (ground), not pulling A0:A2 to ground (but this doesn't apply to 2K chips), crossing clock/data lines and the pull-up resistors. I use 4.7K resistors for less current draw. The code looks clean except for the previously noted lack of END at the end of the program. The second 'Pause 10' (after i2cread) serves no practical purpose, but it won't kill the program.

    Is the hardware proven good, as in Mr. Blinky? Is the serial com working okay?

    Edit: I see Mr. Skimask (I'm assuming something here) said it first while I was typing... what he said.

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. How to define constants that specify eeprom addresses
    By DwayneR in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th December 2009, 04:07
  3. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  4. 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
  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