本帖最后由 昊430 于 2017-10-21 17:32 编辑
#include <io430g2553.h>
#include <in430.h>
//#include "BoardConfig.h"
void main(void)
{
unsigned int i;
//BoardConfig(0xb8);
BCSCTL1 |= DIVA_2; // ACLK/4
WDTCTL = WDT_ADLY_1000; // WDT 1s/4 interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= BIT6;
P1OUT |= BIT6;
for (i = 180; i>0; i--);
P1OUT &= ~BIT6;
while(1)
{
unsigned int i;
_BIS_SR(LPM3_bits + GIE); // Enter LPM3
P1OUT |= BIT6; // Set P3.5 LED on
for (i = 180; i>0; i--); // Delay
P1OUT &= ~BIT6; // Clear P3.5 LED off
}
}
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer (void)
{
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
}
|