#include "io430.h"
#include "io430g2332.h"
void main(void)
{
unsigned long Delay=0;
Clock_Config();
IO_Config();
IO_State_Init();
TIMER_Config();
while(1)
{}
}
#pragma vector = TIMER0_A1_VECTOR
__interrupt void Timer_A (void)
{}
void Clock_Config(void)
{
WDTCTL = WDTPW + WDTHOLD; //关闭看门狗
DCOCTL = DCO1+DCO0;
BCSCTL1 = XT2OFF+RSEL3;
BCSCTL2 = 0;
}
void TIMER_Config(void)
{
TACTL |= TASSEL_2+ID_0+MC_1+TAIE; //时钟选择SMCLK,不分频,增计数模式,使能中断
//CCTL0 = CCIE; //使能CCR0中断
//CCR0 = 2047; //设定周期0.5S
CCR0 = TIME;
TAR = TIME;
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = 500;
}
程序设置基本就是这样,#pragma vector = TIMER0_A1_VECTOR或者TIMER0_A0_VECTOR都不能进入中断,没用过msp430,不知道如何配置;还有那个全局中断IE1里面,好像没有和定时器有关的位吧?希望能得到尽快解决,最好有MSP430G2332的初始化配置程序可以学习下、