#include<msp430f149.h>
void delay(int x)
{
int i,j;
for(i=x;i>0;i--)
for(j=112;j>0;j--);
}
int main( void )
{
// Stop watchdog timer to prevent time out reset
BCSCTL1 |= DIVA_2;
WDTCTL = WDT_ADLY_1000;
IE1 = WDTIE;
P2DIR |= BIT2;
P2OUT |= BIT2;
while(1)
{
_BIS_SR(LPM3_bits+GIE);
P2OUT &= ~BIT2;
delay(100);
P2OUT |= BIT2;
}
}
#pragma vector = WDT_VECTOR
__interrupt void watchdot_timer()
{
_BIC_SR_IRQ(LPM3_bits);
}
MSP430锁频环的使用
最新推荐文章于 2024-08-11 10:40:12 发布