msp430g2xx2 1 vlo

1 95 0
msp430g2xx2 1 vlo

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

Thông tin tài liệu

//****************************************************************************** // MSP430G2xx2 Demo - Software Toggle P1.0, MCLK = VLO/8 // // Description; Pulse P1.0 with a 1/100 active duty cycle using software // Ultra-low frequency ~ 1.5kHz, ultra-low power active mode demonstrated // ACLK = VL0, MCLK = VLO/8 ~1.5kHz, SMCLK = n/a // // MSP430G2xx2 // // /|\| XIN|// | | | // |RST XOUT|// | | // | P1.0| >LED // // D Dang // Texas Instruments, Inc // December 2010 // Built with CCS Version: 4.2.0 and IAR Embedded Workbench Version: 5.10 //****************************************************************************** #include void main(void) { volatile unsigned int i; WDTCTL = WDTPW + WDTHOLD; BCSCTL3 |= LFXT1S_2; IFG1 &= ~OFIFG; bis_SR_register(SCG1 + SCG0); BCSCTL2 |= SELM_3 + DIVM_3; P1DIR = 0xFF; P1OUT = 0; P2DIR = 0xFF; P2OUT = 0; } for (;;) { P1OUT |= for (i = P1OUT &= for (i = } 0x01; 10; i > 0; i ); ~0x01; 1000; i > 0; i ); // // // // // // // // // // Volatile to prevent removal Stop watchdog timer LFXT1 = VLO Clear OSCFault flag Stop DCO MCLK = LFXT1/8 All P1.x outputs All P1.x reset All P2.x outputs All P2.x reset // // // // P1.0 set Delay 1x P1.0 reset Delay 100x

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

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan