Jump to content
ansh

Interfacing CC3200 and MSP-430G2553 using UART

Recommended Posts

There are serial examples in Energia that work fine for the CC3200 and MSP430 - I've got a setup doing exactly that for my IoT sensors.  The Communication examples are a good start.  Is there any part in particular you're struggling with?

Share this post


Link to post
Share on other sites

Yes,I am sending data using msp430 , the data is being sent but its not received by cc3200 , i think there is a problem of pin multiplexing ..

Share this post


Link to post
Share on other sites

@@ansh - can you send a picture or description of your setup (just in case it's hardware)?  Which serial port are you trying to use?  In my setup I'm using Serial1 to listen to input from the MSP430 and Serial to provide feedback to my PC (if attached).  Since it's on the same pin as one of the LEDs, I did have to set the pin as INPUT (something that wasn't done in the init for some reason).  

  pinMode(GREEN_LED,INPUT);

Also - make sure you've got the GND pins of the two boards connected, and that you've got a power supply big enough to run the two.  There are a lot of other considerations depending on your setup - so I'll add more once we get there.

Share this post


Link to post
Share on other sites

@@cubeberg i have attached my sender code from MSP430G2553 and receiver code for CC3200 

SENDER MSP430 :-

 

#define LED RED_LED
 
 
char ch;
void setup()
{
  
  Serial.begin(9600);
  // put your setup code here, to run once:
  
}
 
void loop()
{
  Serial.write('c');
  delay(1000);
  
  
  // put your main code here, to run repeatedly:
  
}
 
 
RECEIVER CC3200 :-
 
#define LED RED_LED
 
char c;
void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
  pinMode(LED,OUTPUT);
  pinMode(GREEN_LED,INPUT);
}
 
void loop()
{
  if(Serial.available()>0)
  {
    c=Serial.read();
    Serial1.print©;
    if(c=='Y')
    {
      digitalWrite(LED,HIGH);
    }
    else if(c=='y')
    digitalWrite(LED,LOW);
  }
}
 please check is this correct because i am not getting the output..

Share this post


Link to post
Share on other sites

It still depends on your physical setup - but you're reading from the primary serial port and writing that input to Serial1.  If you're expecting to see this on your computer via USB then you've got the classes backwards as Serial writes to the PC.  Based on what I'm seeing - you're actually waiting for input from your computer and writing to the MSP430 instead of the other way around.

Share this post


Link to post
Share on other sites

@@ansh - absolutely, but I'll need to know what you're actually trying to do.  If you're trying to take data in on RX(1) and transmit it to your computer, just swap your Serial and Serial1 references in the above code.  

#define LED RED_LED  char ch;void setup(){    Serial.begin(9600);  // put your setup code here, to run once:  } void loop(){  Serial.write('c');  delay(1000);      // put your main code here, to run repeatedly:  }  RECEIVER CC3200 :- #define LED RED_LED char c;void setup(){  Serial.begin(9600);  Serial1.begin(9600);  pinMode(LED,OUTPUT);  pinMode(GREEN_LED,INPUT);} void loop(){  if(Serial1.available()>0)  {    c=Serial1.read();    Serial.print

Share this post


Link to post
Share on other sites

Energia pin maps are here - http://energia.nu/pin-maps/

It depends on how you've got your setup, but here is how I'm using it:

 

Program your MSP430 with a program that provides some sort of serial output

Only the CC3200 is connected to your PC

Connect GND and VCC between the two devices (this way, the power from the CC3200 board powers the MSP430 board)

Pull all the jumpers on the MSP430 board (this prevents us from powering the debugger on the MSP430 and messing with the UART pins which are connected to a USB -> UART bridge)

Connect the TX pin on the MSP430 to the RX(1) on the CC3200.  

Make sure your MSP430 is transmitting at the same speed as the CC3200 Serial1 (I suggest 9600 unless you have a crystal soldered on the board).  Make sure Energia has serial set to the same speed as Serial on the CC3200 (115200 in the example I provided above)

 

You should see the green LED flash a bit when data is being sent by the MSP430

Share this post


Link to post
Share on other sites

Hi @@ansh - the sketch and directions work good for me but be sure to use Pin 10 of the CC3200 for RX(1) - the pin map also shows Pin 39 but that doesn't seem to work....  I am transmitting from Pin 4 of the MSP430G2553.

 

Thanks @@cubeberg for posting this.  I've been meaning to try it for a while..

Share this post


Link to post
Share on other sites

Lovely!

 

Catch is 

#1) Baud Rate .. for Serial > Serial1 

#2) Baud Rate for Serial1 in Transmitter == Serial1 in Receiver 

 

Also, while sampling on computer com port make sure we set Receiver Serial baud rate (NOT Serial1)

 

I've tried this with TWO CC3200 and Screen shot attached!  please watch out for

#1) baud rate in COM port console

#2) and TX pin (P01) in transmit CC3200 is connected to RX pin (P02) of receiver CC3200 

PS: P01 == P1-10

P02 == P1-9

post-48482-0-60433900-1460051996_thumb.jpg

post-48482-0-95215800-1460052322_thumb.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×