Other Parts Discussed in Thread: MSP430G2553
Hi Everybody,
I'm working with msp430g2553 and ccs
i'm sending from the computer to the mcu via rs232 the character a (the software i'm using is com port data emulator)
the USCI0RX interrupt is triggered but the UCA0RXBUF doesn't have the character a
here's the code (i took it from the code examples):
#include <msp430.h>
unsigned char data;
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT // All P2.x reset
P1SEL = BIT1 + BIT2 ; // P1.1 = RXD, P1.2=TXD
P1SEL2= BIT1 + BIT2 ; // P1.1 = RXD, P1.2=TXD // All P3.x reset
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600 = 3.41
UCA0BR1 = 0x00; //
UCA0MCTL = UCBRS1 + UCBRS0; // Modulation UCBRSx = 3
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, interrupts enabled
}
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCIAB0RX_VECTOR))) USCI0RX_ISR (void)
#else
#error Compiler not supported!
#endif
{
data = UCA0RXBUF;
}
the data doesn't have the character i sent
