I use inside RTC of MSP430FG4619, the code:
SCFI0 =0;//0x04 ; // D=1, MCLK 1.3 - 12.1 MHz
SCFQCTL = 60;//121; // (121+1) x 32768 x 2 = 7995392; 3.99 Mhz (3997696)
FLL_CTL0 = DCOPLUS + XCAP18PF; // DCO+ set so freq= xtal x D x N+1
FLL_CTL1 = 0x20;
RTCCTL = RTCHOLD + RTCMODE_3 + RTCTEV_0 + RTCIE; //RTCBCD + no BCD, Real Clock, minutes Interrupt
I use 32768 crystal on Xin/Xout pin.
The RTC looks like work well, but after a year running, it has a big off in some cases, like 10 hours slow.
why like that? how accuracy it should be ?
thanks a lot
jim