Path: EDN Asia >> Design Centre >> IC/Board/Systems Design >> Guide to using MSP430 Launchpad (Part 3)
IC/Board/Systems Design Share print

Guide to using MSP430 Launchpad (Part 3)

20 Nov 2014  | Adrian Fernandez, Dung Dang

Share this page with your friends

Note: For individuals looking to explore MCUs and MCU-based design principles, low-cost development kits offer an easy, low-risk entry into the intricacies of these complex ICs. In this detailed guide to the TI LaunchPad development kit, the authors break down hardware circuits and walk through MCU-based projects designed to help users work with the LaunchPad—the little red board that does so many big things, not the least of which is helping individuals gain knowledge and experience in MCU-based design. In a previous excerpt, the authors reviewed the basics of digital I/O and walked through examples of I/O design using the TI MSP430 MCU. This instalment continues the discussion on LaunchPad programming that started in Part 2.

Adapted from "Getting Started with the MSP430 Launchpad, 1st Edition" by Adrian Fernandez and Dung Dang (Newnes)

Translating Launchpad: Speak with ASCII
What we will notice, however, is that our LaunchPad is echoing back hexadecimal values, just like we asked it to in our LaunchPad sketch. The reason we passed back hexadecimal values is because this is a convenient way to show how our LaunchPad understands English characters and symbols. This is what is typically called ASCII or American Standard Code for Information Interchange. Because our LaunchPad brain can only understand 1s and 0s, ASCII is a way for the microcontroller to handle characters and symbols.

Here's the ASCII table.

 ASCII table

Using the table above, we can see that the letter "H" has an ASCII value of 0x48 in hexadecimal. This is the same hex value that we see in our Serial Monitor as the first echoed character.

Now that it's able to establish two-way communication to a computer, our LaunchPad is well on its way to become a social butterfly. Now that we've accomplished and exercised both the "R" and "T" of UART, let's take a closer look at what's happening at a hardware level.

As we mentioned in the beginning of this chapter, communication between LaunchPad and its digital friends can occur when we have standardised serial communication protocol and physical interface. UART provides both of those pieces.

The hardware behind UART
Let's first look at the physical interface required for UART communication. UART is a two-wire protocol and consists of a TXD (transmit) and an RXD (Receive) line. We know that the "A" in UART stands for asynchronous because the two systems trying to talk to each other do not share a clock line. In synchronous communication, a clock signal is shared between the systems that are trying to communicate with each other. However, UART is asynchronous so no clock signal is required. Instead, we have to configure the UART on all communicating systems at the same baud rate.

Full Duplex method
Also, our LaunchPad communicates to the computer using a method called, "Full Duplex." This means that we can transmit and receive at the same time. UART can also be implemented in a "Half Duplex" method, which means that a system can only send or receive at any given time. In the case of Half Duplex, the RX and TX line can be shared, meaning that it can be implemented with just a single wire. This is good for systems that do not have very many pins available.

However, in our LaunchPad we are using the Full Duplex method, which requires two wires and enables RX and TX to happen simultaneously. The image below shows the hardware implementation of a Full or Half Duplex setup.

 Hardware implementation

Now that we know how UART is set up physically between various systems, let's examine the serial communication protocol that UART follows. As we know, our LaunchPad and its digital friends speak a digital language made up of 1s and 0s. To make sense of the 1s and 0s that are being transmitted and received, UART specifies how these data bits can be sent between communicating systems.

System communication

First, we have a "Start" bit. This bit signifies the start of a UART transmission.

We follow the Start bit with a byte of data (or 8 bits). These 8 bits can be any series of 1s and 0s and this makes up your data "payload."

After the payload of 8 bits is sent, UART follows it up with a "Stop" bit signifying the end of the transmission. A payload can be of varying lengths; however, in our examples, we will use a payload of 8 bits.

The Start and Stop bits frame a single transaction of our UART transmission.

1 • 2 Next Page Last Page

Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.

Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming

News | Products | Design Features | Regional Roundup | Tech Impact