Quote Originally Posted by jayanthd View Post
You have given RTC Read function. It used Bcd2Dec. I need Dec2Bcd for RTC Writing.

is this RTC Read code correct
Code:
 ssec = ((sec & 0x70) >> 4) + (sec & 0x0F)
That will give you the ones place.

From the manual
4.17.7. DIG

DIG returns the value of a decimal digit. Simply tell it the digit number (0 - 4 with 0 being the rightmost digit) you would like the value of, and voila.

B0 = 123 ' Set B0 to 123
B1 = B0 DIG 1 ' Sets B1 to 2 (digit 1 of 123)