I2C RTC Control | Cypress Semiconductor
I2C RTC Control
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 = 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.