- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which I2C_SLAVE_ADDR do you use?
Keep in mind that most of the APIs (except those for reading a byte) return a status byte which, when non-zero indicates an error condition.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
I used 0x68 as I2C_SLAVE_ADDRESS
And looks like now working, some connection issues.
Thanks,
Ashok r