24lc512: i2cread don't work!


Closed Thread
Results 1 to 10 of 10
  1. #1
    LUCAS1983's Avatar
    LUCAS1983 Guest

    Exclamation 24lc512: i2cread don't work!

    I have the 18f458 20MHz and the 24lc512. I put all the pull-up resitor.But, as you can see in the picture, if I read the eeprom the result is always zero.where is the mystake?
    excuse for my English! thanks very much
    luca from italy
    Attached Images Attached Images  

  2. #2
    LUCAS1983's Avatar
    LUCAS1983 Guest


    Did you find this post helpful? Yes | No

    Default

    the i2cwrite works very very good!!!(I can program but not read the eeprom)
    if I use the i2cread to read the pcf8593 memory (time/date) it works...why it doesn't work with the eeproms?
    Please help me.it is important...

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    Please read the documentation !

    I think, you need to use WORD-variables for the adress while using such huge EEPROMs !

    ;-)

    I use them too, and i write and read with I2CREAD/I2CWRITE... It's not easy, but it works !
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    LUCAS1983's Avatar
    LUCAS1983 Guest


    Did you find this post helpful? Yes | No

    Default hi!

    thanks Wumpus for the help.
    But I use a WORD-variables for the adress. If you see the picture the variable B0 is defined as WORD.but it doesn't work!

  5. #5
    LUCAS1983's Avatar
    LUCAS1983 Guest


    Did you find this post helpful? Yes | No

    Wink

    I try to change the 4.7K pull-up resistor with a 10K pull-up resistor (I put that on the SCL or on the SDA or on both)... but if I read the EEprom the result is always 0.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Do you have Pins 1 & 2 (A0 & A1) tied to ground?
    Is Pin 3 (A2) tied to VDD?
    Is Pin 7 (WP) tied to ground?

    Do not leave any of those pins floating.
    <br>
    DT

  7. #7
    LUCAS1983's Avatar
    LUCAS1983 Guest


    Did you find this post helpful? Yes | No

    Default

    i have pin1 and pin2 to and pin3 and pin7 to gnd.
    why you say that i should have pin3 to VDD? the address is:
    $A0=%10100000 the data sheet says (show attach file) that I have pin1,2,3 to GND
    Attached Images Attached Images  

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Sorry, I was looking at the 24LC515 datasheet instead of the 512.

    You should be ok wired that way.
    <br>
    DT

  9. #9
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Luca,

    After looking at the Image in you're first post for a while longer, I think I found the problem. I hope.

    Something I missed the first time was that you're using an 18F458. That chip has Comparators multiplexed with the PORTD pins, and they default to analog mode. You can kind of see the results in the Variables window of the image. Both SDA and SCL are 0, instead of the 1 that they should be since I2C idles HIGH.

    You can just add a ...

    CMCON = 7

    and you should be smiling again.

    Also, the 24LC512 is a 400khz device, so I2C_SLOW isn't required.
    <br>
    Last edited by Darrel Taylor; - 8th December 2005 at 04:13.
    DT

  10. #10
    LUCAS1983's Avatar
    LUCAS1983 Guest


    Did you find this post helpful? Yes | No

    Smile

    thanks a lot Darrel now the i2cread works very fine...thanks thanks thanks luca
    Attached Images Attached Images  

Similar Threads

  1. 18f2550 + 24lc512
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2007, 22:02
  2. Need help to get I2CRead woriking
    By w7ami in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th November 2007, 16:22
  3. I2cwrite - I2cread
    By savnik in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th July 2006, 01:12
  4. PFC8583 Connection and I2Cwrite I2cread!
    By uludere72 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 27th February 2006, 13:32
  5. Pin RA4 doesn't work
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 15th July 2004, 12:03

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