I2CRead & I2CWrite not working as expected


Closed Thread
Results 1 to 31 of 31

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,650


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    Only VDD/VSS and SDA/SCL pins are used, others are left floating, according to datasheet.
    start a TEST first to see if your I2C unit is OK
    let go here
    or read the data sheet again and work out the consequences of floating address pins on the device address
    Warning I'm not a teacher

  2. #2
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    From the datasheet:


    DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1 and A0 pins are device address
    inputs that are hard wired or left not connected for hardware compatibility with
    AT24C16. When the pins are hardwired, as many as eight 32K/64K devices may be
    addressed on a single bus system (device addressing is discussed in detail under the
    Device Addressing section). When the pins are not hardwired, the default A2, A1, and A0
    are zero.
    WRITE PROTECT (WP): The write protect input, when tied to GND, allows normal write
    operations. When WP is tied high to VCC, all write operations to the upper quandrant
    (8/16K bits) of memory are inhibited. If left unconnected, WP is internally pulled down to
    GND.


    The A2, A1, and A0 pins use an internal proprietary circuit that biases them
    to a logic low condition if the pins are allowed to float.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,650


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    to my surprise i found the 24c32 on my ds3231 module did not behave as expected when the resistor block [circled] was removed
    to conserve energy for a battery device
    Name:  Screenshot 2021-10-08 164704.jpg
Views: 14568
Size:  60.7 KB

    the address was still 0xAE, contrary to the datasheet , so i looked at a data sheet from another manufacturer, where for a 24c32n
    they did not describe this address pin biased low behavior for their version

    to ensure 0xA0 the pins needed to be grounded

    so how sure are you that the datasheet matches the chip?
    its an easy test
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    I will try grounding. I will also hook up scope to see what happens.
    I do have pull up resistors in place for SDA/SCL pins.
    Regarding how I know about datasheet?
    I bought this IC from digikey, and downloaded datasheet from the SKU page
    This is genuine atmega part.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    It could be that a static discharge killed the pull down circuitry, so the floating pins may not be a $A0 anymore.

    I had in the past various issues with static and decided to be almost paranoid with this thing. Have anti-static mate on the floor, also on the bench and I earth my self too. Of course the soldering iron is earthed too by a tens of kΩ range resistor.

    Chips from various vendors also have differences and datasheet may not cover that. Richard is right.

    Ioannis

  6. #6
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    Here I connected the scope.
    This is how this code looks:
    My scope (Hantek DSO2D10) Has I2C decode function, but I can't get it running properly.

    Code:
    mainloop:
    
    
       For B0 = 0 To 15 step 2  
         I2CREAD DPIN,CPIN,$A0,B0,X  
         lcdout $fe, $1, dec b0, " ", dec X 
         pause 1000
       Next B0
    
    
    Goto mainloop
    Name:  i2c.jpg
Views: 15335
Size:  107.0 KB

  7. #7
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CRead & I2CWrite not working as expected

    Oh by the way, I swapped chip with 24C04N - no difference.

Similar Threads

  1. I2cwrite - I2cread
    By savnik in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th July 2006, 01:12
  2. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th June 2006, 20:03
  3. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th June 2006, 18:32
  4. PFC8583 Connection and I2Cwrite I2cread!
    By uludere72 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 27th February 2006, 13:32
  5. I2CWRITE and I2CREAD
    By Tomas in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd April 2004, 02:30

Members who have read this thread : 1

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