Am working with PCF8563 here i am setting the date and time, Then am reading the same thing at every two seconds using some timer concept here for one to two hours the time is updating properly , after that the time is not increasing gradually some 10 minutes deviation is happening.
The same thing if i read every one seconds means time is getting update properly, What is the issue. Where am doing the mistake. What and all the possibilities for this issue.How to resolve this.
I attached my I2C files.
uint8_t RTC_buffer_Write[14]={0x30,0x00,0x12,0x02,0x01,0x01,0x15};
uint8_t RTC_buffer_Read[13];
am using this line for writing the date and time to RTC
I2C_Read_Write(RTC8563_ADDR,0x02,&RTC_buffer_Write[0],&RTC_buffer_Read,0,7);
this line for reading the date and time
I2C_Read_Write(RTC8563_ADDR,0x02,&RTC_buffer_Write,&RTC_buffer_Read,1, 7);
/***********SECONDS***************/
RTC_buffer_Read[0]=RTC_buffer_Read[0] & 0x7f;
/***********MINUTES***************/
RTC_buffer_Read[1]=RTC_buffer_Read[1] & 0x7f;
/***********HOURS***************/
RTC_buffer_Read[2]=RTC_buffer_Read[2] & 0x3f;
/***********DAYS***************/
RTC_buffer_Read[3]=RTC_buffer_Read[3] & 0x3f;
/***********NAME_OF_DAY***************/
RTC_buffer_Read[4]=RTC_buffer_Read[4] & 0x07;
/***********MONTHS***************/
RTC_buffer_Read[5]=RTC_buffer_Read[5] & 0x1f;
Solved! Go to Solution.
Please refer to the PCF8563 Data Sheet document, available on the PCF8563 Documentation web page:
Refer to the Section 8.5 "Setting and reading the time" that describes in details the mechanism and algorithm of setting and reading the PCF8563 counter values. Check whether your code follows exactly this algorithm. Also, check whether the I2C bus transfer is performed at highest possible (400kHz) speed. Using highest transfer speed is prefered to avoid non-monolitic counter
increment. Also, since undervoltage condition on the VDD supply voltage can break the counters integrity, check whether the undervoltage condition occurs on VDD and whether the VL bit in the VL_seconds register is ever set.
Have a great day,
Artur
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Please refer to the PCF8563 Data Sheet document, available on the PCF8563 Documentation web page:
Refer to the Section 8.5 "Setting and reading the time" that describes in details the mechanism and algorithm of setting and reading the PCF8563 counter values. Check whether your code follows exactly this algorithm. Also, check whether the I2C bus transfer is performed at highest possible (400kHz) speed. Using highest transfer speed is prefered to avoid non-monolitic counter
increment. Also, since undervoltage condition on the VDD supply voltage can break the counters integrity, check whether the undervoltage condition occurs on VDD and whether the VL bit in the VL_seconds register is ever set.
Have a great day,
Artur
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------