# include & lt; Msp430x14x. H>
Void main (void)
{
P6DIR |=BIT2; P6OUT |=BIT2;//off level conversion
WDTCTL=WDTPW + WDTHOLD;//Stop WDT
P3SEL |=0 x30;//P3.4, 5=USART0 TXD/RXD (choose IO port mode)
ME1 |=UTXE0 + URXE0;//USART0 transmit enable
UCTL0 |=CHAR;//8-bit character
UTCTL0 |=SSEL0;
UBR00=0 x03;//32 k/9600-3.41
UBR10=0 x00;//
UMCTL0=0 x4a;//9600 baud rate
UCTL0 & amp;=~ SWRST;//Initialize USART state machine
IE1 |=URXIE0;//Enable USART0 RX interrupt
//Mainloop
For (;; )
{
_BIS_SR (LPM3_bits + govemment);
while (! (IFG1 & amp; UTXIFG0));//USART0 TX buffer ready?
TXBUF0=RXBUF0;//RXBUF0 to TXBUF0
}
}
//UART0 RX ISR will for exit from LPM3 in Mainloop
# pragma vector=UART0RX_VECTOR
__interrupt void usart0_rx (void)
{
_BIC_SR_IRQ (LPM3_bits);//the Clear LPM3 bits from 0 (SR)
}
Problem description: the code to configure a serial port, and then enter the main loop, enter the lpm3 (CPU dormancy) and open global disruptions, now only waiting for interrupt request will continue to execute the following code, my question is: where does the interrupt request to (what is the reason for interruption?) Because this code is only opened the interrupt, but did not open the timer,
For: msp430f149 MCU