#include "io430.h"
#define uchar unsigned char
#define uint unsigned int
void BCSplus_init(void)
{
BCSCTL2 = SELM_3 + DIVM_0 + SELS + DIVS_0;
if (CALBC1_1MHZ != 0xFF) {
DCOCTL = 0x00;
BCSCTL1 = CALBC1_1MHZ; /* Set DCO to 1MHz */
DCOCTL = CALDCO_1MHZ;
}
BCSCTL1 |= XT2OFF + DIVA_0;
BCSCTL3 = XT2S_3 + LFXT1S_0 + XCAP_1;
}
int main( void )
{
WDTCTL =WDT_ADLY_1000;
BCSplus_init();
IE1|=WDTIE;
P1DIR|=0X01;
P1OUT|=BIT0;
__enable_interrupt();
while(1);
// return 0;
}
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
{
P1OUT=(~P1OUT)&0x01;
}
用的是LaundPad---2553的板子,那个LED灯一直亮。。。很久才灭,时间不对,但是,我设定的是1000ms的定时中断,哪里不对了,求助啊!!!谢了
此帖出自
小平头技术问答
一周热门 更多>