EmbeddedRelated.com
Forums
Memfault Beyond the Launch

RTC for MSP430f5528

Started by Abhay July 26, 2011
Hi
Intention is to build a simple RTC block .

Code:
void main(void)
{

WDTCTL = WDTPW + WDTHOLD; // Stop Watchdog Timer

RTCCTL1 = BIT7+BIT6+BIT5; // RTC enable, BCD mode and Hold
RTCCTL1 &= ~RTCRDY; //Reset Ready

// Init time
RTCSEC = 0x00; // Set Seconds
RTCMIN = 0x00; // Set Minutes
RTCHOUR = 0x08; // Set Hours

// Init date
RTCDOW = 0x01; // Set DOW
RTCDAY = 0x25; // Set Day
RTCMON = 0x07; // Set Month
RTCYEAR = 0x2011; // Set Year

RTCCTL1 &= ~RTCHOLD; // Enable RTC

__bis_SR_register(LPM0_bits + GIE); // Enter LPM3 w/ interrupt
}

// Basic Timer interrupt service routine
#pragma vector=RTC_VECTOR
__interrupt void RTC_ISR(void)
{
_nop();
}

My concern / Or my question ; How do i confirm my RTC module is working correctly ???
And if any pointers on above RTC module greatly appreciated !!!.
[external tools i possess :Oscilloscope and FT232 only]

Thanks
Ak

Beginning Microcontrollers with the MSP430


Memfault Beyond the Launch