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.

MSP-EXP430FR2355: Communicating with UART backchannel on a Mac

Part Number: MSP-EXP430FR2355
Other Parts Discussed in Thread: CCSTUDIO

I'm new to programming MSP430s and am working with the Launchpad and the latest CcStudio.  As I test basic ideas for my new program, I'd like to be able to write diagnostic text output to a console (e.g., values read from an AD pin), and I'm doing this on a Mac.  It appears that the Launchpad is associated with four local devices that show up in /dev:  cu.usbmodem2101 ,  cu.usbmodem2103 , tty.usbmodem2101 , tty.usbmodem2103 .   I believe one of these (probably with the tty prefix, maybe 2013?) is the appropriate device for two-way serial communication via the UART backchannel, but beyond that, I'm stumped.

My questions:

  • What software interface do I need on my Mac to view serial output?  Can this all be done inside CcStudio, or do I need an external terminal app? 
  • How do I select the correct device from the four given, and how do I ensure that communication protocols match (baud rate, etc.)? 
  • Finally, in the MSP430 program itself, is 'standard out' already  associated with the UART backchannel by default, or do I need to write to a particular stream?

I have in fact succeeded in writing text to the console inside CcStudio with one simple 'hello world' program using a `printf()` statement, but similar code doesn't seem to work in every program, based on my limited experience so far.  Also, the program doesn't free-run but seems to hit a hardware breakpoint with every call to printf, if I'm interpreting things correctly.

Apologies for the newbie questions, but my previous experience is entirely with Arduinos.

  • 1. CCS has a terminal (In debug mode it is the second or third icon on the top that looks like a terminal. You can hover to verify). or you can use the screen command on the Mac.

    2. I always have to "suck it and see" to get the correct tty/cu file. Sorry, I wish I had a better answer. Since *you* are programming the MSP430, you should know what the UART settings are. Set CCS or Screen to those settings.

    3. stdout is actually associated with another backchannel communication that outputs via the console. It communicates over the cu file you don't use for the uart. Unless you do something different, the UART output is totally under your control with no stdio support.

    I suggest you start with the UART Echo demo you can get from Resource Explorer.

  • Hi,

    Attach the link mentioned by Keith:

    Resource Explorer UART ECHO example:

    https://dev.ti.com/tirex/explore/node?node=A__ALXTttnffpSeB73nkJ2g5g__msp430ware__IOGqZri__LATEST

    Thanks!

    Best Regards

    Johnson

  • Also, the program doesn't free-run but seems to hit a hardware breakpoint with every call to printf, if I'm interpreting things correctly.

    The default in the TI compiler run time library is that printf() uses C I/O, which as you have observed uses a hardware breakpoint when I/O is used.

    You can install a user-defined driver so that you can use the sophisticated buffering of the high-level C I/O functions on an arbitrary device, such as a UART.

    If you haven't seen it, Tips for Using Printf has more information on both of the above.

**Attention** This is a public forum