|
msp430f6638的单片机用定时器比较中断对xt2进行4分频,下面的程序对不对?
[复制链接]
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
UCSCTL6&=~XT2OFF;
UCSCTL6|=XT2DRIVE_3;
UCSCTL4|=SELM_5+SELS_5+SELA_5;
P3DIR |= BIT1; // P3.1 output
P3SEL |= BIT1; // P3.1 option select
TA1CCTL0 = OUTMOD_4; // CCR0 toggle mode
TA1CCR0 = 2;
TA1CTL = TASSEL_2 + MC_1 + TACLR;}
|
|