pcf85263A fails to upgrade time

We have developed timer based lubrication system for which we have used PCF85263A RTC chipset. I am facing one issue that RTC timer normally updates correctly but when time reaches 19:59:00(24hour mode), the next minute, time resets to 00:00:00 instead of 20:00.

if i set time 00:00:00 to 19:59:00, it sets time correctly and RTC updates time correctly up to 19:59:59 but next second, it resets to 00:00:00.

If i set time as 21:00:00, it sets time as 1:00:00, when i set time as 22:00:00, it sets time as 02:00:00, when i set time as 23:00:00 then it sets time as 03:00:00. So my RTC time is not updating more than 20hours.

Can anyone please help me what might be problem? what are registers to be set etc. I need to set 24hour format

The problem got solved. I had done mistake in reading RTC time. basically 6bits are assigned for hour(24hour format) but i was doing logical AND operation with 0x1F to the read RTC hour value instead of 0x3F and hence the hour value 20-23hrs was reading as 0-3hrs.

I can see your wrote that --The problem got solved. I had done mistake in reading RTC time. basically 5bits are assigned for hour but i was doing logical AND operation with 0x1F to the read RTC hour value instead of 0x3F and hence the hour value 20-23hrs was reading as 0-3hrs.