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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/29/08 07:59
Read: times


 
#155246 - A full circle..
Responding to: ???'s previous message
Or so is what I have made.

I already have posted a full working code for a LCD clock based on PCF8583 in the code library long back !

I did go through the search on PCF8563 ( is this a drop in replacement for PCF8583??) and learnt a lot on the inaccuracy part and one of your suggestions to read the time code as a block. And K.V.Sutar has confirmed its working fine.

My main reason to try out the DS12887 was the fact it had built in battery back up and Crystal and hence thought will not struggle to resolve the inaccuracy of PCF8583.

But now that you have mentioned about reading all at once, will try that out. The current code to read time is ,
/*=============================================*/ 
void i2c_ReadClock (void)						 // Read the clock registers
    {									 // Disable interrupts
	  EA = 0;
	  i2c_GoMaster(SlvAdr_Wr);
	  i2c_WrByte(0x02);						 // Seconds register address
	  i2c_stop();								 
	  i2c_RcvData (3, SlvAdr_Rd);
	  second = tempVal[3];						 // Save Seconds value
	  minute = tempVal[2];						 // Save Minutes value
	  hour   = tempVal[1];						 // Save Hours value
          i2c_stop();
	  EA =1;							 // Enable interrupts

     }

/*=============================================*/ 

Is this what you meant ?? I am calling the above routine once every 500ms.

Thanks

Raghu

List of 15 messages in thread
TopicAuthorDate
DS12C887 with non mux interface            01/01/70 00:00      
   Throw that junk away...            01/01/70 00:00      
   Search For...            01/01/70 00:00      
      A full circle..            01/01/70 00:00      
         just did the same thing yesterday!            01/01/70 00:00      
            Why would anyone call you crazy ?            01/01/70 00:00      
               nop's            01/01/70 00:00      
            The full C code for the DS12887            01/01/70 00:00      
               just curious            01/01/70 00:00      
                  Selectable bus timings            01/01/70 00:00      
      I agree with Michael...            01/01/70 00:00      
         Are there any specific reasons ??            01/01/70 00:00      
   what does datasheet says            01/01/70 00:00      
   Memory mapping            01/01/70 00:00      
   Craig, which lead to the old issue            01/01/70 00:00      

Back to Subject List