2 Replies Latest reply on Dec 10, 2016 10:22 PM by user_361616940

    PsoC4 Interfacing with DS3231 (RTC)

    user_361616940

      Dear all,

         

      I am using CY8CKIT-049-42xx kit to interface with my DS3231 RTC module via I2C,

         

      I tried to initialize the RTC by the following code but did not works, i am not sure about this I2C communication,

         

      please help me , if any example code or project is avilable?

         

        I2CM_I2CMasterSendStart(I2C_SLAVE_ADDR,I2CM_I2C_WRITE_XFER_MODE);
          I2CM_I2CMasterWriteByte(0x00);// 00H register
          I2CM_I2CMasterWriteByte(0x00);// sec
          I2CM_I2CMasterWriteByte(0x00);// min
          I2CM_I2CMasterWriteByte(0x00);// hrs
          I2CM_I2CMasterWriteByte(0x01);// day
          I2CM_I2CMasterWriteByte(11); // day
          I2CM_I2CMasterWriteByte(12);//month
          I2CM_I2CMasterWriteByte(16);//year
          I2CM_I2CMasterSendStop();

         

      Thanks,

         

      Ashok R