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.

MSP430G2553 UART on breadboard

Other Parts Discussed in Thread: MSP430G2553

Hi,

I am currently attempting to use a MSP430G2553 for serial communication through UART with a Bluetooth module(attempted with HC-06 and RN-42).

I'm using an Android phone to send a letter 'a' and receive 'aaa' back. This works when i place the MSP430 into the launchpad and apply VCC and GND using a power supply (no usb connection).

The problem occurs once i remove it from the launchpad and place it onto a breadboard. Communication no longer works and i will not receive 'aaa' back. I am using a 47k pull up resistor on reset from vcc. I have also moved the jumpers horizontally to when debugging to use the hardware UART.

Below is an example of the code i have loaded onto the MSP430.

Any help is appreciated. Thanks.

#include "msp430g2553.h"

const char stringA[] = {"AAA\r\n" };

unsigned int i; 
unsigned int j;
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
P1DIR |= BIT0;
P1SEL = BIT1+BIT2; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 104; // 1MHz 9600
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1
UCA0CTL1 &= ~UCSWRST;
IE2 |= UCA0RXIE;
P1SEL2 = BIT1 + BIT2;
__bis_SR_register(LPM0_bits + GIE);

while(1){

}
}
#pragma vector=USCIAB0TX_VECTOR
__interrupt void USCI0TX_ISR(void){
if (j == 0){
UCA0TXBUF=stringA[i++]; // TX next character
if (i == sizeof stringA - 1) // TX over?
UC0IE &= ~UCA0TXIE; // Disable USCI_A0 TX interrupt
}
}

#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void) {
if (UCA0RXBUF=='a') // 'a' received?
{ i = 0;
j = 0;
UC0IE |= UCA0TXIE; // Enable USCI_A0 TX interrupt
}
}

  • Victor Medina said:
    Solved

    How?

    I'm not interested in the answer myself, but others might. And since your thread is already there and can be found using the forum search, posting your solution here (if possible/legally allowed to you) might help them.

    (there are already a number of threads with a 'solved it myself' post and then, a year or two later, someone else adds a reply asking 'how?')

  • Please say how as I am trying to get an MSP430g2553 to communicate though the uart tx & rx pins with an RN-42 and having no luck at all doing such with my own code, nor your code.

  • Did anyone solve this problem and willing to share the solution? I am having the same problem with the same components

  • As JMG pointed it out...there it is. Unfortunately Victor didn't come back to share his solution.
    What's your problem in detail, Ben?

    Dennis
  • Well five hours after I made my post we figured out the problem. So my group has been using the MSP430G2553 and a HC-06 bluetooth module, it worked on the launchpad, but when we transferred to a breadboard we couldn't get Rx pin on the MSP430 to recognize the commands being sent from our Android phone. So after a long period of head scratching and just plain testing points on the launchpad, we arrived to a solution that wasn't as apparent to do. The HC-06 has been configured to be a receiver, so instead of leaving Rx pin on the HC06 as an open, we had to connect both Rx and Tx pins of the module to the Rx pin (pin 3) of the MSP430. What we found after testing all the points is that the Emulator side of the launchpad does this connection already on the jumpers, we initially thought it didn't mean anything but to get into the emulator, this is not the case. I hope that this helps anyone else who is searching for an answer to this.

**Attention** This is a public forum