Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/27/09 15:24
Modified:
  08/27/09 16:03

Read: times


 
#168578 - DS1307 stores registers in BCD
Responding to: ???'s previous message
I am not entirely sure I understand your message.

The simplest way of displaying your time is with hexadecimal:

// **** EDIT ****
// CLARIFIED FOR THE BENEFIT OF MR MALUND 
// read all the registers into a buf[] with i2c_read()
// then display with:
printf("%02x:%02x:%02xr", buf[2], buf[1], buf[0]);

 


If you use decimal display, you will get strange values unles you convert with a bcd2bin() function.

If you are missing the least significant bits from the hour register, but can read the least significant bits from the seconds register you must have a broken chip. If both registers lose the LSBs you have got a duff i2c_read() function.

David.


List of 8 messages in thread
TopicAuthorDate
DS1307 glitch            01/01/70 00:00      
   DS1307            01/01/70 00:00      
      @Hal            01/01/70 00:00      
         Quit sure time problem ;)            01/01/70 00:00      
   DS1307 stores registers in BCD            01/01/70 00:00      
      never heard of that one            01/01/70 00:00      
   problem phinally solved!            01/01/70 00:00      
      Let this be a turning point....            01/01/70 00:00      

Back to Subject List