6 Replies Latest reply on Aug 26, 2017 8:22 AM by sagard_1819731

    (DS1307 RTC) I2C Not Working

    sagard_1819731

      Hi All,

       

      Am using CYBLE 012012-00

       

      I have DS1307 Tiny RTC module which I2C based from which i want get data.

       

      Below is code snippet of my code:-

       

      while(I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterStatus())

          {

          I2CM_I2CMasterClearStatus();

          }

          while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(0x68u, 0x00u)); 

          CyDelay(10);

          while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterWriteByte(0x00u)); 

          CyDelay(10);

          while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendRestart(0x68u, 0x1u));

          CyDelay(10);

          d1 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d2 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d3 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d4 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d5 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d6 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d7 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);

          d8 = I2CM_I2CMasterReadByte(I2CM_I2C_NAK_DATA);

          I2CM_I2CMasterSendStop();

       

      i am not able to go forward beyond below line:-

      while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(0x68u, 0x00u)); 

       

      not sure what to do?

       

      i am using PSOC 4 creator

       

      I have connected pins as below:-

      RTC---proc side

       

      vcc--3.3v

      gnd--gnd

      scl-scl(P3[5])

      sda-sda(P3[4])

       

      have anyone configured this before please help me out

       

      Thanks