Other Parts Discussed in Thread: MSP430G2231
Hi,
I have been attempting to use the MSP430G2231 as an I2C real time clock, however, I have been encountering quite a bit of time drift (on the order of several minutes in a day). I am using Micro Crystal 12pF 20ppm part that is on evaluation board, which should only have a drift of 1.7 seconds a day. I would appreciate any suggestions on how to better implement this. My current implementation is as below:
My RTC timer is setup as:
TACTL = TASSEL_1 + MC_1 + TAIE;
TACCR0 = 32767;
With the interrupt routine simply:
#pragma vector=TIMERA1_VECTOR
__interrupt void Timer_A(void)
{
switch( TAIV ) {
case 2: break; // CCR1 not used
case 4: break; // CCR2 not used
case 10:
realTimeClockSeconds++;
break;
}
}
I also have a USI interrupt routine with an I2C slave state machine, which will handle requests to set the realTimeClockSeconds variable or to read back the variable.