problems working with 24C512


Closed Thread
Results 1 to 12 of 12

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    ' ** Setup the I2C configuration **
    
    Define I2C_SCLOUT 1 ' No need for the pullup resistor on the SCL pin
    Not sure if it works without pull-up with this define...

    BUT if you receive always 2, maybe you reverted your SDA, SCL line as well.. who knows?
    Steve

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

  2. #2
    Join Date
    Apr 2006
    Posts
    29


    Did you find this post helpful? Yes | No

    Default

    Dear jerson and mister e

    i have rechecked my connections, they are correct. I dont know where is the problem. I have even grounded WP which i havent done before. One more technical aspect that i want to tell you that i have connect WP and A0 and A1 directly to ground i.e. no pull down resistors. IS this making the problem. If any one of you have a working circuit of 24C512 with PIC, please send it so that i can rechecked my connections. Please send me coding as well.
    LETS MOVE TOWARDS SOMETHING PRACTICAL---

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by shaiqbashir View Post
    no pull down resistors
    Pull DOWN resistors? Don't remember anything about Pull DOWN resistors.

    If any one of you have a working circuit of 24C512 with PIC, please send it so that i can rechecked my connections
    The '512 datasheet I've got has a fairly good schematic. What's your datasheet say?

    Please send me coding as well.
    ???????????????????????????????????????????????
    Not asking for much eh?
    Last edited by skimask; - 28th May 2008 at 19:04.

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    970


    Did you find this post helpful? Yes | No

    Default

    Are you sure your PIC is working? Any test pins that you can blink / toggle to make sure ? I think you have all the coding right including the pin config. I doubt your watchdog / brownout is killing the code execution. This can be ruled out if you can blink a test pin every time you read

  5. #5
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Dear all,
    If you read the datasheet of a 24C512 then you wil see this:

    "device address,first word address,second word address,data"

    so your line
    Code:
    EWrite:
    I2CWRITE SDA,SCL,%10100000,Addr,[E_ByteOut]
    is not correct
    it must be
    EWrite:
    I2CWRITE SDA,SCL,%10100000,Addr1,[Addr2,E_ByteOut]
    the same for I2CREAD
    Don't forget to mark the read bit.

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


    Did you find this post helpful? Yes | No

    Default

    mmm... not sure as the address is a WORD here and PBP handle the WORD variable for address. It always worked for me with the EEPROM i used, i've never use the C512, but C1024.

    If by FIRST they mean Most Significant, it has to work, unless, yes you're in a kind of trouble... but this said, if you read the same way you write, you shouldn't have any problem huh?

    For no reason, i stick to a swap of SDA & SCL pin idea and 1.8-4.7K pull-up on both pins.
    Last edited by mister_e; - 28th May 2008 at 22:09.
    Steve

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

  7. #7
    Join Date
    Apr 2006
    Posts
    29


    Did you find this post helpful? Yes | No

    Default

    thanks for your help

    mat jensson you have raised a nice point here. I have tried almost every possibility in my coding as well as in my connections, but its not working at all. Please explain me your idea,
    i mean what do u mean by marking the read bit? and how can i specify two addresses, can u explain me a bit.

    One more thing that i want to share with u all. I get different numbers as output when i connect SDA SCL on different ports.


    when i have

    SDA = portB.1
    SCL= portB.0
    output= 2

    SDA = portD.1
    SCL= portD.0
    output= 2

    SDA = portC.1
    SCL= portC.0
    output= 8

    I just couldnt get it.



    Regards,

    Shaiq Bashir
    LETS MOVE TOWARDS SOMETHING PRACTICAL---

Similar Threads

  1. PIC30f4012 Problems
    By Insane in forum mel PIC BASIC
    Replies: 4
    Last Post: - 18th June 2010, 08:16
  2. Blink.Bas on 18f45k20 Newbie seeks working example.
    By DiscoEd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th December 2009, 04:36
  3. lcd menu problems
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd April 2009, 20:00
  4. 2 PWM in 16F690 problems
    By ciendavila in forum mel PIC BASIC
    Replies: 9
    Last Post: - 27th April 2008, 10:03
  5. Why is this so hard? HSEROUT problems.
    By groston in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th November 2006, 14:01

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