I2C RTC Control | Cypress Semiconductor

I2C RTC Control

Summary: 2 Replies, Latest post by Madhu Sudhan on 27 May 2015 02:24 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
ryoik's picture
2 posts

please tell me how to control I2C RTC chip.
I use "SII S-3539" RTC.


this device have some device address for RTC register access.
for example, 0b01100001 is status register read.
0b01100101 is date&time read.

this means msb 4 bits is "device code(0b0110), and next 3 bits is command code.
lsb 1 bit is read/write bit.

For this reason, this device is NOT need register address.

I use FX3 register mode I2C API. and writed code is below.

/* Status Register */
devAddr = 0x60 | 0x00;
/* Update the preamble information. */
preamble.length = 1;
preamble.buffer[0] = devAddr | 0x01; // Read
preamble.ctrlMask = 0x0001;

/* Read */
status = CyU3PI2cReceiveBytes (&preamble, buffer, byteCount, 10);

return status is CY_U3P_SUCCESS. but always read 0x00.
sometime, I changed preamble.ctrlMask to another value and tried, but cannot read.

please let me know how to use this device from FX3.

ryoik's picture
2 posts


mady's picture
Cypress Employee
963 posts


Please make the following changes:

preamble.buffer[0] = devAddr;

preamble.buffer[1] = devAddr | 0x01;

preamble.length = 3;

preamble.ctrlMask = 0x0002;

For read, we should specify both write and read address in the preamble.


- Madhu Sudhan

Log in to post new comments.