有中文的RTC官方手册翻译 、 附上官方RTC的例子 //****************************************************************************** // MSP430F54xA Demo - RTC_A in real time clock mode // // Description: This program demonstrates the RTC mode by triggering an // interrupt every second and minute. This code toggles P1.0 every second. // This code recommends an external LFXT1 crystal for RTC accuracy. // ACLK = LFXT1 = 32768Hz, MCLK = SMCLK = default DCO = 32 x ACLK = 1048576Hz // // MSP430F54xA // ----------------- // /|\ | XIN|- // | | | 32kHz // ---|RST XOUT|- // | | // | P1.0 |--> Toggles every second // | | // // W. Goh // Texas Instruments Inc. // April 2010 // Built with CCS version 4.2 and IAR Embedded Workbench Version: 4.21.8 //******************************************************************************
#include <msp430x54xA.h>
void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop Watchdog Timer P1DIR |= BIT0; // Set P1.0 as output