此帖出自微控制器 MCU论坛
最新回复
#include "msp430x54x.h"void main(void){ WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1DIR |= 0x01; // P1.0 output TA1CTL = TASSEL_2 + MC_2 + TACLR + TAIE; // SMCLK, contmode, clear TAR // enable interrupt __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, enable interrupts __no_operation(); // For debugger}// Timer_A3 Interrupt Vector (TAIV) handler#pragma vector=TIMER1_A1_VECTOR__interrupt void TIMER1_A1_ISR(void){ switch(__even_in_range(TA1IV,14)) { case 0: break; // No interrupt case 2: break; // CCR1 not used case 4: break; // CCR2 not used case 6: break; // reserved case 8: break; // reserved case 10: break; // reserved case 12: break; // reserved case 14: P1OUT ^= 0x01; // overflow break; default: break; }}CCIE是对CCR0
详情
回复
发表于 2011-12-16 18:20
| ||
|
||
此帖出自微控制器 MCU论坛
| ||
|
||
EEWorld Datasheet 技术支持