ansh 0 Posted June 22, 2015 Share Posted June 22, 2015 i am trying to interface msp430 and cc3200 using UART .i am using the IDE energia ,basically i am reading analog sensor value through msp430g2553 and send it to cc3200 using UART can any one help me with code ?? Quote Link to post Share on other sites
cubeberg 540 Posted June 22, 2015 Share Posted June 22, 2015 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? Quote Link to post Share on other sites
ansh 0 Posted June 23, 2015 Author Share Posted June 23, 2015 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 .. Quote Link to post Share on other sites
cubeberg 540 Posted June 23, 2015 Share Posted June 23, 2015 @@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. Quote Link to post Share on other sites
ansh 0 Posted June 25, 2015 Author Share Posted June 25, 2015 @@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.. Quote Link to post Share on other sites
cubeberg 540 Posted June 25, 2015 Share Posted June 25, 2015 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. Quote Link to post Share on other sites
ansh 0 Posted June 29, 2015 Author Share Posted June 29, 2015 Can you help me with the code ?? Quote Link to post Share on other sites
cubeberg 540 Posted June 29, 2015 Share Posted June 29, 2015 @@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 Quote Link to post Share on other sites
ansh 0 Posted June 30, 2015 Author Share Posted June 30, 2015 I am simply trying to send data through UART from MSP430G2553 to CC3200 and display the data on serial monitor .. Quote Link to post Share on other sites
cubeberg 540 Posted June 30, 2015 Share Posted June 30, 2015 The second example should work then. Quote Link to post Share on other sites
ansh 0 Posted July 6, 2015 Author Share Posted July 6, 2015 Can you also tell me the hardware connection ?? I am still not able to get the output Quote Link to post Share on other sites
cubeberg 540 Posted July 6, 2015 Share Posted July 6, 2015 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 Fmilburn and gr8going 2 Quote Link to post Share on other sites
Fmilburn 445 Posted July 7, 2015 Share Posted July 7, 2015 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.. Quote Link to post Share on other sites
ansh 0 Posted July 8, 2015 Author Share Posted July 8, 2015 Ok sure Quote Link to post Share on other sites
gr8going 0 Posted April 7, 2016 Share Posted April 7, 2016 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.