This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP-EXP430G2ET: Problems interfacing with the back channel UART with Visual Basic

Part Number: MSP-EXP430G2ET
Other Parts Discussed in Thread: MSP430G2553

Hello All,

thanks for taking a look at my question. I have a launchpad kit and would like to interact with it using a visual basic program. I made a vb program that displays the current ports on the system, and displays the ports specs. As seen below:


I have a MSP430G2553 hooked into my launchpad and have the following code Running:

/------------------------------------------------ Code ----------------------------------------------------------------------------------------------------------------
int main(void)
{
//------------ Turn Off WDT -------------------------------------------------
WDTCTL = WDTPW + WDTHOLD; // Stop Watchdog

//------------ Check clock calibration and set clock to 1MHz ----------------
if (CALBC1_1MHZ==0xFF) // Check if calibration constant erased
{
while(1); // do not load program
}
DCOCTL = 0; // Select lowest DCO settings
BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1 MHz
DCOCTL = CALDCO_1MHZ;

//-------- Pin Setup ------------------------------------------------------------
P1SEL = BIT1 + BIT2 ; // Select UART RX/TX function on P1.1,P1.2
P1SEL2 = BIT1 + BIT2;

//P1OUT&= ~(BIT0|BIT3|BIT4|BIT5|BIT6|BIT7); //Turns output low.
P2OUT&= ~0xFF; //Turns output low
P3OUT&= ~0xFF; //Turns output low

// P1DIR|= BIT0|BIT3|BIT4|BIT5|BIT6|BIT7; //Turns the rest of Port1 to outputs.
P2DIR|=0xFF; //Turns all of port 2 to outputs
P3DIR|=0xFF; //Turns all of port 3 to outputs

UCA0CTL1 |= UCSSEL_2+ UCSWRST; // UART Clock -> SMCLK, and put in reset state
UCA0BR0 = 104; // Baud Rate Setting for 1MHz 9600
UCA0BR1 = 0; // Baud Rate Setting for 1MHz 9600
UCA0MCTL = UCBRS_1; // Modulation Setting for 1MHz 9600


UCA0STAT |= UCLISTEN;
UCA0CTL1 &= ~UCSWRST; // Initialize UART Module
IE2 |= UCA0RXIE; // Enable RX interrupt

P2OUT|= 0xFF;
while(1){
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, Enable Interrupt
}


}

#pragma vector=USCIAB0RX_VECTOR // UART RX Interrupt Vector
__interrupt void USCI0RX_ISR(void)
{

while (!(IFG2&UCA0TXIFG)); // Check if TX is ongoing
//UCA0TXBUF = UCA0RXBUF + 1; // TX -> Received Char + 1
unsigned char temp;
IFG2 &= ~UCA0RXIFG; // Clear RX flag
char x;
temp = UCA0RXBUF;
x = (char)temp;

if(x == 0x41){
P2OUT|=0xFF;
}
if(x == 0x42){
P2OUT&= ~0xFF;
}
}

/----------------------------------------- End Code ---------------------------------------------------------------->


As can be seen, the uC is waiting for an "A", or "B" character, and flips the outputs to On for A, or Off for "B". The problem I'm having is the MSP430 never sees a signal being sent by Visual basic.

Can anyone help me?

**Attention** This is a public forum