Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

P3SEL |= 0x30; // P3.

4,5 = USART0 TXD/RXD ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD UCTL0 |= CHAR; // 8-bit character UTCTL0 |= SSEL0; // UCLK = ACLK = 32.768kHz UBR00 = 0x03; // 32.768kHz/9600 - 3.41 UBR10 = 0x00; UMCTL0 = 0x4a; // Modulation UCTL0 &= SWRST; // Initialize USART state machine IE1 |= URXIE0 + UTXIE0; // Enable USART0 RX/TX interrupt TXBUF0 = information[i]; while (!(IFG1 & UTXIFG0));

#pragma vector=USART0RX_VECTOR __interrupt void usart0_rx (void) { while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready? TXBUF0 = RXBUF0; // RXBUF0 to TXBUF0 }

ADC

WDTCTL = WDTPW + WDTHOLD; // Stop Watch Dog Timer ADC12CTL0 = SHT0_2 + ADC12ON; // Set sampling time, turn on ADC12 ADC12CTL1 = SHP; ADC12IE = 0x01; // Enable interrupt ADC12MCTL0 = 0x01 ; ADC12CTL0 |= ENC ; // Conversion enabled P6SEL |= 0x02 ; // P6.1 ADC option select P6DIR |= 0x04; // P6.2 is output for LED

You might also like