Part Number: MSP430G2553
Other Parts Discussed in Thread: MSP-EXP430G2ET, MSP430G2211, MSP430G2231
Hello all,
I'm trying to receive bytes on my msp430g2553 and insert this bytes into a variable 'd'. I use serial connection to receive this informations.
I saw a lot of forums who explained how can i do that, because i'm a beginner, but my program stop at 27th line before "#pragma vector", i don't know why.
Can anyone help me out on this issue ? Thanks
#include <msp430g2553.h>
typedef unsigned char u_char;
typedef unsigned int u_int;
u_char d;
unsigned int timerCount = 0;
void main(void) {
WDTCTL = WDTPW + WDTHOLD; //stop watchdog
DCOCTL = 0;
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
// setup USIB, needed for the driver
P1SEL |= BIT1 + BIT2; // P1.1 UCA0RXD input
P1SEL2 |= BIT1 + BIT2; // P1.2 UCA0TXD output
UCA0CTL1 |= UCSSEL_2 + UCSWRST; // SMCLK
UCA0BR0 |= 104;
UCA0BR1 = 0;
UCA0MCTL = UCBRS_1;
UCA0CTL1 &= ~UCSWRST;
IE2 |= UCA0RXIE;
_BIS_SR(GIE + LPM0_bits); // Going to LPM0
}
#pragma vector = USCIAB0RX_VECTOR
__interrupt void ReceiveInterrupt(void)
{
d=UCA0RXBUF;
IFG2 &= ~UCA0RXIFG; //clear RX flag
}