1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

msp430g2x12 ca 01

1 103 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1
Dung lượng 2,08 KB

Nội dung

//****************************************************************************** // MSP430G2x12/G2x52 Demo - Comp_A, Output Reference Voltages on P1.1 // // Description: Output Comparator_A reference levels on P1.1 Program will // cycle through the on-chip comparator_A reference voltages with output on // P1.1 Normal mode is LPM0, TA0_ISR will interrupt LPM0 // ACLK = n/a, MCLK = SMCLK = default DCO // // MSP430G2x12/G2x52 // // /|\| XIN|// | | | // |RST XOUT|// | | // | P1.1/CA1| > Vref // | | // // D Dang // Texas Instruments Inc // December 2010 // Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10 //****************************************************************************** #include void delay(void); // Software delay void main (void) { WDTCTL = WDTPW + WDTHOLD; CACTL2 = P2CA4; CCTL0 = CCIE; TACTL = TASSEL_2 + ID_3 + MC_2; _EINT(); // // // // // } while (1) { CACTL1 = 0x00; _BIS_SR(LPM0_bits); CACTL1 = CAREF0 + CAON; _BIS_SR(LPM0_bits); CACTL1 = CAREF1 + CAON; _BIS_SR(LPM0_bits); CACTL1 = CAREF1 + CAREF0 + CAON; _BIS_SR(LPM0_bits); } // Timer A0 interrupt service routine #pragma vector=TIMER0_A0_VECTOR interrupt void Timer_A (void) { _BIC_SR_IRQ(LPM0_bits); } Stop WDT CA1/P1.1 = +comp CCR0 interrupt enabled SMCLK/8, cont-mode enable interrupts // Loop // // // // // // // // No reference voltage Enter LPM0 0.25*Vcc, Comp on Enter LPM0 0.5*Vcc, Comp on Enter LPM0 0.55V, Comp on Enter LPM0 // Clear LPM0 bits from 0(SR)

Ngày đăng: 26/12/2017, 07:50

TỪ KHÓA LIÊN QUAN

w