本帖最后由 昊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)
- }
复制代码
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
但是仿真模式下我也是全速运行的,没有让它单步运行
一周热门 更多>