Jump to content
Nolan

SoftwareSerial with MSP430fr5969

Recommended Posts

My eventual goal is to pass in NMEA GPS strings to our board and use them in our code. 

 

For now I am trying to connect a SparkFun venus GPS unit to a TI-MSP430FR5969 board (version 2.0). I am using the SoftwareSerial example:

 


 

 

The error message when compiling is that the SoftwareSerial only supports 16MHz processors. My confussion is that the comments in the code make specific mention of having resolved this issue. Additionaly, if i understand correctly the MSP430fr5969 board is a 16MHz processor. I have already replaced the files in the softwareSerial library folder with the code from GitHub. 

 


 

The eventual goal will be to use a NMEA.h library with an Airmar wind sensor to receive GPS and other sensor readings. 

 

Could you assist me in solving this error message?

 

Thank you. 

Share this post


Link to post
Share on other sites

Energia runs the FR5969 at 8MHz to avoid employing FRAM wait states (kinda silly IMO as they don't seem to hurt much). But the fact is the FR5969 has TWO hardware UARTs. I recommend you use them.

 

Sent from my Galaxy Note II with Tapatalk 4

Share this post


Link to post
Share on other sites

Energia runs the FR5969 at 8MHz to avoid employing FRAM wait states (kinda silly IMO as they don't seem to hurt much). But the fact is the FR5969 has TWO hardware UARTs. I recommend you use them.

 

 

 

As a beginner I am still unsure on how to proceed. I understand the concept of UART but not necessarily how to implement that on the board. Are you referring to the RxD and TxD pins? 

 

Additionally I do not see how this would solve the problem of the compiler error. 

 

-Nolan 

Share this post


Link to post
Share on other sites

As a beginner I am still unsure on how to proceed. I understand the concept of UART but not necessarily how to implement that on the board. Are you referring to the RxD and TxD pins? 

 

Additionally I do not see how this would solve the problem of the compiler error. 

 

-Nolan 

Gotcha.  So here's what you need to know.  Check @@Rei Vilo 's excellent diagram of the FR5969 LaunchPad here - http://energia.nu/wordpress/wp-content/uploads/2014/10/LaunchPad-with-MSP430FR5969.jpg

 

Note the RXD, TXD pins listed on the left side, around the middle/upper-middle of the board.  Those refer to an internal set of circuit board traces which connect between the MSP430 and your PC (via the "emulation layer" which is the upper half of the board, with its associated USB-UART bridge hardware et al).  That's the serial channel you see in the Serial Monitor et al, and is represented in Energia by the "Serial" object.  In more technical MSP430 jargon, those lines correspond to the USCI_A0 peripheral.

 

But look on the LaunchPad's boosterpack layout.  Pins 3 and 4 have "RX (1)" and "TX (1)" as alternate "functions".

 

That RX(1) and TX(1) means they connect to the 2nd hardware UART onboard (known as USCI_A1 in MSP430 tech jargon).  It's called "Serial1" to Energia and it's all ready for you to play with.  Connect your GPS to those pins and run Serial1.begin(9600) and otherwise just use Serial1 to talk with that GPS.

 

The way you get rid of your compiler error, if I'm reading your post right, is to stop using SoftwareSerial and delete all references to it from your code.  You don't need it at all.  Looking at the SoftwareSerial example you posted, what you will do is use "Serial1" in place of "mySerial" but otherwise keep the code similar, just NO REFERENCES to SoftwareSerial and NO "#include <SoftwareSerial.h>" in your sketch.

 

(private note to @@Rei Vilo - your FR5969 diagram linked above misspells RXD and TXD in the emulator jumper area, calling it >>RDX and <<TDX instead)

Share this post


Link to post
Share on other sites

Gotcha.  So here's what you need to know.  Check @@Rei Vilo 's excellent diagram of the FR5969 LaunchPad here - http://energia.nu/wordpress/wp-content/uploads/2014/10/LaunchPad-with-MSP430FR5969.jpg

 

Note the RXD, TXD pins listed on the left side, around the middle/upper-middle of the board.  Those refer to an internal set of circuit board traces which connect between the MSP430 and your PC (via the "emulation layer" which is the upper half of the board, with its associated USB-UART bridge hardware et al).  That's the serial channel you see in the Serial Monitor et al, and is represented in Energia by the "Serial" object.  In more technical MSP430 jargon, those lines correspond to the USCI_A0 peripheral.

 

But look on the LaunchPad's boosterpack layout.  Pins 3 and 4 have "RX (1)" and "TX (1)" as alternate "functions".

 

That RX(1) and TX(1) means they connect to the 2nd hardware UART onboard (known as USCI_A1 in MSP430 tech jargon).  It's called "Serial1" to Energia and it's all ready for you to play with.  Connect your GPS to those pins and run Serial1.begin(9600) and otherwise just use Serial1 to talk with that GPS.

 

 

 

I believe I have done as instructed: The board is connected to the computer via USB. Pin 3 (Rx) is connected to Tx on the GPS. Pin 4 (Tx) is connected to Rx on the GPS. Additionally there is a connection of power and ground (Pin 1 & 20) to the GPS. The code that i have uploaded runs Serial1.begin(9600). 

 

However, When i open up the Serial Monitor ( COM 3, 4 or 5) with the correct rate selected (9600), the monitor remains blank.

 

Thanks,

Nolan 

Share this post


Link to post
Share on other sites

I believe I have done as instructed: The board is connected to the computer via USB. Pin 3 (Rx) is connected to Tx on the GPS. Pin 4 (Tx) is connected to Rx on the GPS. Additionally there is a connection of power and ground (Pin 1 & 20) to the GPS. The code that i have uploaded runs Serial1.begin(9600). 

 

However, When i open up the Serial Monitor ( COM 3, 4 or 5) with the correct rate selected (9600), the monitor remains blank.

 

Thanks,

Nolan 

As a quick test, remove the >>RXD and <<TXD jumpers between the lower 2/3rds and top 1/3rd of the board; the upper pins on both those jumpers lead towards the USB emulation part of the LaunchPad.  Attach your GPS's TX pin to the upper pin of the <<RXD jumper.  Open Serial Monitor at 9600, be sure the GPS is powered; this will feed data directly from the GPS into the launchpad's backchannel UART where the Serial Monitor should show it (bypassing the MSP430 completely).

 

Also, try a basic serial sketch that prints to the serial monitor (without involving the GPS) to make sure the MSP430 itself is alive and functioning.  (Make sure the >>RXD/<<TXD jumpers are *installed* when doing that)

Share this post


Link to post
Share on other sites

I have now completed both the test above and unfortunately, neither showed anything in the serial monitor. :(  

 

The first test I completed as stated.

 

The second test i placed the following: Serial1.print("hello") into the void loop. I also tried this in setup following the serial1.begin. In addition I tried both those with Serial.print instead of Serial1.print 

 

-Nolan 

Share this post


Link to post
Share on other sites

I have now completed both the test above and unfortunately, neither showed anything in the serial monitor. :(  

 

The first test I completed as stated.

 

The second test i placed the following: Serial1.print("hello") into the void loop. I also tried this in setup following the serial1.begin. In addition I tried both those with Serial.print instead of Serial1.print 

 

-Nolan 

edit: erm, one sec, didn't read the 2nd test when I posted

 

Which serial port do you have Energia pointed to?  If you need a guide, go to the computer's Device Manager and expand the Serial Ports.  The COM# you should be using is called MSP Application UART.

Share this post


Link to post
Share on other sites

The GPS being used is a Sprakfun venus GPS. https://www.sparkfun.com/products/11058

 

We were connected to the four pins in the lower left corner of the board (grnd, power, Tx, Rx). 

 

I will try to connect this gps to an arduino later today and see if i can get serial communication working on that.

 

Thanks,

Nolan 

Share this post


Link to post
Share on other sites

edit: erm, one sec, didn't read the 2nd test when I posted

 

Which serial port do you have Energia pointed to?  If you need a guide, go to the computer's Device Manager and expand the Serial Ports.  The COM# you should be using is called MSP Application UART.

 

The MSP Application UART is on COM5. 

Share this post


Link to post
Share on other sites

The MSP Application UART is on COM5. 

Ok, so with COM5 selected in Energia, opening serial monitor and setting to 9600, and all those jumpers installed between the microcontroller and upper "emulation layer" on the board... this sketch should produce text:

void setup() {
  Serial.begin(9600);
  delay(1000);  // 1 second delay to give you time to open serial monitor
}

void loop() {
  static unsigned int i = 0;

  Serial.print("Text number: ");
  Serial.println(i++);

  delay(250);  // 1/4sec delay between messages
}

edit: Also, be sure the jumper setting for the SUPER CAP is set to "Bypass", and the jumper setting for POWER SELECT (right side of the board) is set to "Debugger".

 

This is using Energia 14 I assume, and there is no error during the code upload part right?

Share this post


Link to post
Share on other sites

Ok, so with COM5 selected in Energia, opening serial monitor and setting to 9600, and all those jumpers installed between the microcontroller and upper "emulation layer" on the board... this sketch should produce text:

 

edit: Also, be sure the jumper setting for the SUPER CAP is set to "Bypass", and the jumper setting for POWER SELECT (right side of the board) is set to "Debugger".

 

This is using Energia 14 I assume, and there is no error during the code upload part right?

 

Ok, So i have disconnected the GPS entirely. I have put all of the jumpers back to the way you stated. The only jumpers not in place on the upper right section are the RTS and STS pins. 

 

I copied in the code that you provided. The code only uploads with the board plugged into the USB port on the right hand side of my laptop (the other side yields a "initialization failed" error.

 

When the code does upload with the message " Done Uploading" and "No unused FET found" I then opened the serial monitor (ctr+sft+m) and made sure the right serial port was selected. The serial monitor port remained blank. 

Share this post


Link to post
Share on other sites

Ok, So i have disconnected the GPS entirely. I have put all of the jumpers back to the way you stated. The only jumpers not in place on the upper right section are the RTS and STS pins. 

 

I copied in the code that you provided. The code only uploads with the board plugged into the USB port on the right hand side of my laptop (the other side yields a "initialization failed" error.

 

When the code does upload with the message " Done Uploading" and "No unused FET found" I then opened the serial monitor (ctr+sft+m) and made sure the right serial port was selected. The serial monitor port remained blank. 

"No unused FET found" is an error.  "Done Uploading" is just Energia stating that it saw the programmer application exiting, but "No unused FET found" means it can't find the launchpad's debugger.  Something's wrong there.  Have you tried using "Update Programmer" on this board?  Maybe give that a try...

Share this post


Link to post
Share on other sites

"No unused FET found" is an error.  "Done Uploading" is just Energia stating that it saw the programmer application exiting, but "No unused FET found" means it can't find the launchpad's debugger.  Something's wrong there.  Have you tried using "Update Programmer" on this board?  Maybe give that a try...

Updating the programmer, as you suggested, cleared away the errors. Now the program updates with no warning or messages other then "Erasing...Programming...Done, 3072 bytes total" 

 

However, Opening the software Serial monitor still shows a blank serial monitor. 

Share this post


Link to post
Share on other sites

Updating the programmer, as you suggested, cleared away the errors. Now the program updates with no warning or messages other then "Erasing...Programming...Done, 3072 bytes total" 

 

However, Opening the software Serial monitor still shows a blank serial monitor. 

Ok, we're getting somewhere now...

 

Have you re-verified the COM port for the application UART?  If so, I dunno, maybe reboot for kicks...

Also try a Blink example to make sure the MSP430 is indeed being programmed.  Sounds like you've had to go through a lot of the basics here but I bet success is a step or 2 away...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...