UART Serial Terminals (MobaXTerm Setup)

Windows Users


Textual Tutorial

The MobaXterm terminal (available from https://mobaxterm.mobatek.net/) creates a UART connection with the board using the existing USB connection.

Step 1) Install and open the program.


Step 2) On the top left of the window, choose "session" whose icon is a computer display. A new window pops up.

Step 3) On the new window, choose "Serial" from the top row.


Step 4) From the drop-down menu for Serial port, choose the one that has the word UART in it.


Step 5) From the speed drop-down menu choose 9600, if different.


Step 6) Open the advanced Serial settings. Choose all the options similar to the below image.

Step 7) Choose "OK". This will open a UART connection with the board.


Step 8) On the left pane, where you see user sessions right-click on COM3 (yours might have a different name.) A new menu will drop as shown below, where you see "Rename session" on top.

Step 9) Choose "Rename session". In the new window, change the session name to 9600, which was

the baudrate you chose earlier, and click OK. This will save this session for you with this name.


Step 10) Close the session by click in the small x on the top right corner of the black session screen.


Step 11) Repeat steps 2-10 for 19200 and any other baudrate speed you will need to work for your

homework and lab. Whenever you need to change the speed of the UART connection on the Mobaxterm

side, all you need to do is the close the current session and pick one from the list of sessions you have

created in advance. This makes this process much faster and more reliable as you are certain of the

speed you have chosen.

Of Special Mention to Linux Users...

If you use Linux, instead of using MobaXTerm, you can simply use the Terminal. The following instructions were tested using Ubuntu 18.04 LTS, but since you're using Linux, we trust that you know how to install the packages you need to follow these directions.

Open a terminal and type the following command:

dmesg | grep tty

You should see output on your terminal which looks something like this

Ensure that /dev/ttyACM0 is present in the output of this command. For reasons which are not yet well understood, the MSP432P401R opens two serial ports when you plug in the board to your PC. We will be connecting to /dev/ttyACM0, which is equivalent to opening a serial terminal through UART to your microcontroller.

To connect to the board, simply type the following command:

screen /dev/ttyACM0 <baudrate>

This means, for example, to connect with baudrates 9600, 19200, or 38400, you would type ONE of the following commands:

screen /dev/ttyACM0 9600

screen /dev/ttyACM0 19200

screen /dev/ttyACM0 38400

If everything worked, your terminal should be completely empty, and your cursor should be in the top left! At this time, anything you type into the terminal will be sent through UART to your board, and your board will send back any packets through this terminal. Let's say that you have a program which implements the following pseudocode:

int main()

{

    UART_SetupWithBaud(9600);

    while (1)

    {

        char c = '\0';

        if (UART_CanReceiveChar()) {

            c = UART_GetChar();

        }

        

        if (UART_CanSendChar()) {

            UART_SendChar(c);

        }

    }

}

When you type into the terminal Hello, ECE 2564!, this is what you should see:

Finally, when you wish to exit your serial terminal session, follow these steps:

Congratulations. You can now proceed with the UART section of this course on Linux!

MAC OS USERS

Just like with Linux, Mac users are able to use the terminal instead of MobaXTerm (Which is also not available for MacOS). 


Step 1) Open up the terminal window, which can be found under Launchpad → Other → Terminal


Step 2) To find the serial port to connect to, first make sure your board is connected, then type the following into the terminal:


ls /dev/tty.*


This will pull up all “files” under the file structure “/dev/” that start with tty and have anything after the ‘.’.

Your terminal output will look like the above.


Step 3) Look for the port your board is connected to, for the MSP432 is will have a similar format to “/dev/tty.usbmodemM43210051” or “/dev/tty.usbserialM43210051”. Unlike Linux, it is unclear which of the two MSP432 ports to connect to, so connect to the first port on the list and it will work. For me, that was “/dev/tty.usbmodemM43210051”.


You can open the serial terminal at the specified port by typing the following command in the terminal:

Note: The following command uses the port “/dev/tty.usbmodemM43210051”, make sure to enter YOUR port instead.


screen /dev/tty.usbmodemM43210051 baud_rate


Where “baude_rate” is the baud rate you would like to use the terminal with. So, if you are using a baud rate of 9600, the command would be as follows:


screen /dev/tty.usbmodemM43210051 9600

Step 4) After you enter the command, the terminal will be replaced by the serial terminal similar to the one picture below. Now you are ready to interact with your board through UART! 

As seen in the title, this is a serial terminal running at a baud rate of 9600 and at port /dev/tty.usbmodemM43210051.