| Electronic Components Datasheet Search |
|
AN1572 Datasheet(PDF) 2 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1572 Datasheet(HTML) 2 Page - STMicroelectronics |
|
2 / 9 page ![]() AN1572 2/9 Doc ID 10604 Rev 2 Address auto-increment and clock data coherency When reading and writing the time/date, users should always use the address auto- increment feature of the serial interface. This ensures that the data is transferred coherently between the user and the counters. The time/date values read from the counters will all come from the same instant in time (or be written to the counters at the same instant in time). This does not apply to the non clock registers (eg, Flags or Watchdog registers), only to the clock/calendar registers at addresses 00h to 07h. For example, without using auto-increment, the user must read the time using multiple accesses. On the first access, the seconds are read. Then, on the next transfer, the minutes are read. This continues until all the date and time values have been read as shown in the timing diagram below. Figure 1. I2C timing sequence These transfers, in more detail, are depicted below. To read the seconds, two 2-byte transfers occur in sequence. First, the processor sends the slave address and write bit followed by the register address (01h). Then the slave address is sent again, with the read bit, followed by a read of the seconds register. To read the minutes, this same sequence is repeated, but with a different register address (02h). Figure 2. Detailed I2C timing sequence In reading the time this way, each byte comes from a different time. The seconds are from time t1, the minutes are from time t2, and so forth. That is, the seconds, minutes, hours, and so forth, are each read at a different instant in time. They are not coherent; they are not from the same instant in time. Example: the user begins reading at 23:59:59 (t1), and reads 59 as the seconds, then reads 59 minutes (at t2). Before the hours are read, the RTC increments such that the new time is 00:00:00. So the hours are read (at time t3) as 00 and not 23. Thus the time, when re- assembled, will appear to be 00:59:59. It is incorrect by one hour. Thus, it is better to read all the time/date registers during the same transfer so that they come from the same instant in time. That way, the time read will be coherent. BUS ACTIVITY time READ SECONDS t1 READ MINUTES t2 READ HOURS t3 READ YEAR t7 1ST ACCESS 2ND ACCESS 7TH ACCESS BUS ACTIVITY time READ SECONDS t1 READ MINUTES t2 READ HOURS t3 READ YEAR t7 SEND SLAVE ADDR AND WRITE BIT t1 SEND SECONDS REGISTER ADDR SEND SLAVE ADDR AND READ BIT READ SECONDS REGISTER 1 BYTE 1 BYTE 1 BYTE 1 BYTE |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |