Skip to main content
Visitor II
October 12, 2009
Question

How to handle IIC bus while the slave hold the SDA low

  • October 12, 2009
  • 4 replies
  • 1088 views
Posted on October 12, 2009 at 15:29

How to handle IIC bus while the slave hold the SDA low

    This topic has been closed for replies.

    4 replies

    jjyeh1976Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:05

    Hi,

    I'm using the STM8S105K4 with a IIC slave device, while power-on, the IIC bus always in the 'busy' state, that is , the SDA line always low. How can

    I overcome this issue? (NOT use HW Reset.., thanks)

    Jason

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:05

    Hi Jason,

    The External pull-up resistances (4.7k) are needed on SCL and SDA, please check this point.

    Regards

    mozra

    jjyeh1976Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:05

    Hi,

    Both the SDA & SCL are pulled high with 4.7K resistor.

    I can access the I2C slave in debug, while first time

    power on, the slave seems hold the SDA low (I don't know

    why), if I press ''reset'' button, the mcu and the I2C

    slave work well.

    I'vd see a document of Silabs's C8051 series, they handled

    such problem by changing the SDA & SCL pin to GPO mode (open

    drain) and wait for SDA high, but I don't know how to

    configure the STM8S105 from alternate function (I2C) to

    GPO mode, any idea?

    regards,

    Jason

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:05

    Hi Jason,

    It can happen that it is the master that forces the line in the low state!!! What is the master device used in your case?

    The SDA & SCl are configured as alternate function when enabling the I2C, you don't have access to reconfigure the I/O as alternate function but you can add a software pull-up on the I/O:

    GPIOE->CR1 = 0x06;

    Please try this and keep us informed

    Regards

    mozra