Jump to content

SoftwareSerial port for Energia?

Recommended Posts

The TBA remark was in reference to TimerSerial and it has been implemented. Energia isn't really setup to use 2 serial ports. TimerSerial isn't meant to multiplex between various serial devices. Its purpose is to provide a simple implementation to talk to the host.


To do what you are asking would require that you use the UART for one device and a either a custom timer serial or custom cycle counting serial. Neither of the secondary alternates are part of Energia. This doesn't seem to be a good fit for Energia.


What are you actually trying to do?

Link to post
Share on other sites

At the moment I'm porting my project for Arduino Nano which reads some data via software serial from LC-1 device and sends decoded data back to laptop so I can debug. Current state of the project doesn't really require TWO serials (second is used for debug purposes) and I believe that I can port it to LaunchPad without big hassle. However further plans for this project requires another one serial input to read data from another device and combine them with data coming from LC-1 :)

Link to post
Share on other sites

You could the launchpad with mspdebug and msp430-gdb for true hardware debugging. However, that isn't supported directly from the Energia environment. You would have to use the command line tools to get at that capability. Unfortunately it doesn't solve your other requirement of using two ports in the future.


What you want to do is possible. However, it would be best accomplished using native code to program the peripherals using a lower level access than the Energia API provides. You can look in the projects section of this forum for serial code that uses cycle counting and bit banging to implement alternate serial port capability.

Link to post
Share on other sites

Well, the answer is yes and no.


At the moment I'm having fun with microcontrollers to dilute my day-to-day work on various web projects. Diving to deep into architecture is a bit out of scope of my interest, I have no intention to become a msp430 or atmel ninja at the moment :) Getting project done is my biggest priority and hardware decisions is not a limitation but a tool. Of course I can turn this to a kind of challenge for myself to increase my motivation but

Link to post
Share on other sites
  • 7 months later...

I'm looking for the same that @@dchaplinsky was looking for.


I'm using Hardward Serial to connect to a GSM modem, while I want to use a 2nd Serial connection to the PC (only for debugging processes).


I've found the following libraries in GitHub where SofwareSerial are implemented for MSP430: https://github.com/energia/Energia/tree/master/hardware/msp430/libraries/SoftwareSerial


I tried to run the example that it's provided there, but I'm getting the following error when building (SS2 is the name of my Sketchbook):



e:/energia/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: SS2.cpp.elf section `.bss' will not fit in region `ram'
e:/energia/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: region `ram' overflowed by 16 bytes
collect2: ld returned 1 exit status


This error only happens if the line mySerial.begin(9600); is included. If I comment the line from, it builds fines, but of course, it doesn't work as expected when running.


Any clues or thoughts about it?


Thanks in Advance!

Link to post
Share on other sites

Thank you Rei Vilo! As I said, this is mainly for debugging proposes.


If I can use the TX serial port library to only send information to the PC, and I can use the Hardware Serial to connect to the GSM Modem, that could work.


If I'm correct, to do what I've described using the LaunchPad, I'll need to do some jumpers configuration, because by default, PC serial connection is directly connected to PIN1.1 & PIN1.2 (Hardware Serial). If I disconnect J3 Jumpers TXD & RXD, and I connect them to other ports (like PIN1.3 & PIN1.4) manually, should it work as I expect?




Link to post
Share on other sites

Thank you Rei Vilo! I could make it work =)


As a conclusion, I'd like to recommend using TX only Serial library when you're looking for connect to the PC for debugging proposes. This enables you to use Hardware Serial to connect to other devices that needs read/write from a serial connection.

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.

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...