cancel
Showing results for 
Search instead for 
Did you mean: 

About I2C read RTC

zues
Associate II
Posted on September 23, 2005 at 23:24

About I2C read RTC

2 REPLIES 2
zues
Associate II
Posted on May 17, 2011 at 12:08

Dear All:

I use upd3300_elcd board,and use some sample code,

but I can't read M41ST87 date and time,

my test code (all functione use sample code):

I2C_ADDR=0xD0

upsd_i2c_init (400,I2C_ADDR); // I2C initialize

temp_xmit_buf[0] = 0x01; // ready to read ST87 register=01

upsd_i2c_Master_Xmit(I2C_ADDR,temp_xmit_buf,1);

upsd_i2c_Master_Recv(I2C_ADDR,temp_rcv_buf,255);

Is something worng?

Zues

Posted on May 17, 2011 at 12:08

It's too bad there wasn't a timely reply to biczues' message, but in case someone else encounters this: the text of the M41ST87 (M41ST87W) datasheet appears to be wrong in claiming that the address is D0h.  If you look at the timing diagrams, it clearly uses a 7-bit I2C address.  That is, 1101000 -> 0x68.  When you write it out over the wire, you add one more low bit to indicate read/write, so the wire value will look like 0xD0 or 0xD1, both meaning address 0x68.