MSP430 Serial Monitor

by drselim in Circuits > Microcontrollers

4127 Views, 2 Favorites, 0 Comments

MSP430 Serial Monitor

MSP430 Serial Monitor

In this instructable, we'll see how to write a serial monitor program for MSP430 in Code Composer Studio and we're going to get the temperature and humidity values from a DHT11 sensor to the terminal window.

To see the details about how to use DHT11 sensor with the MSP430 microcontroller, you can check the following instructable first:

https://www.instructables.com/MSP430-DHT11-Tempera...

If you want to jump directly to see how it's working, you can check the video above.

Supplies

MSP430, DHT11 Sensor, Code Composer Studio

Simple Text to the Serial Output

code1.JPG

Let's first see how we can create a UART connection from the MSP430 and write a simple sentence to the Terminal:

The code in the link below is going to set the USCI (Universal Serial Communication Interface) module of the MSP430 run at 19200 baud and output the "I am an MSP430" sentence to the COM port (You need to check which COM port MSP430 is using from the device manager, you can see from the picture that it's COM3 in my example)

https://github.com/selimg76/microcontroller/blob/m...

In the code, the ser_output function is sending the content of the character str pointer's address that is sent as an parameter, and it continues to send the characters until the content in the memory address is null.

Showing the Values From the DHT11 Sensor

main_pic.png

In the code that can be seen in the link below, the temperatue and the humidity values are read from the DHT11 sensor and sent to the serial output. Here, the built in terminal window of the CCS is used however you can use any terminal (such as putty) to make the connection.

After the values are read from the sensor, the device gets a sw reset with the watchdog timer so that it can send the measured values in a loop.

https://github.com/selimg76/microcontroller/blob/m...

If you like the content please subscribe to my YouTube channel for similar tutorials and projects.

https://www.youtube.com/c/drselim

Thank you for your time...