VIDEO SERIES
Getting started with the MSP430G2553 value-line LaunchPad™ development kit workshop
This series will walk you through the MSP430G2553 value-line microcontroller LaunchPad development kit and its peripherals.
Getting Started with the MSP430G2553 LaunchPad - Part 1
Presenter(s)
Resources
[MUSIC PLAYING]
Hi, welcome to the Getting Started with the MSP430 Launchpad Workshop. My name is Scott Bland, and I'm an instructor with the technical training organization at Texas Instruments. I'm also the author of the material in this workshop.
This workshop has been architected to be extensively hands on. And the majority of your time will be spent actually working with the tools. You should already have some experience with micro controllers and using the C programming language to get the most benefit from your time spent here. If you don't, there are many resources online that you can use to obtain that knowledge.
In case you didn't know it already, all of this material is available at www.ti.com/launchpad-workshop, as shown in the link below. That site has links to all of the material that you'll need to get started. Let's go ahead and get started.
Section one is an introduction to the MSP430 series micro controller and its peripherals and tools. You'll see how the MSP430 value line series fits into the MSP430 product line and the wider Texas Instruments microprocessor portfolio.
TIs embedded processing portfolio stretches from the low end of 16-bit ultra low power microprocessors with the MSP430 all the way up to high performance DSP and R microprocessors at the top with a c6000, Integra, and DaVinci parts. In the center, you'll notice the 32 bits Stellaris parts, the 32-bit Hercules parts, which are a Cortex M3 and cortex R4 parts running together, and 32-bit high end A8 and A9 Sitara parts.
Today, we'll be working with the Stellaris parts. We're looking at devices up to 80 megahertz, flash from 8k to 512k, a variety of connectivity peripherals on the devices, USB, Ethernet MAC and PHY, CAN, A-to-D converters, pulse width modulators, SPI ports.
We see these being used in things like motion control, human interface, industrial automation, and smart grid with prices anywhere between $1 and $8. The course today that we're going over is the M3. But there are new parts that are just being announced. The Cortex M4f with a floating point processor on board. We'll go over these a little bit later.
There are over 300 ultra low power MSP430 devices that have been released starting at about $0.25 US. These feature up to 256k of flash, 18k of RAM, more than 25 different package options with up to 113 pins on the devices with very high integration. The different subfamilies are FRAM, the new technology memory ferroelectric random access memory with speeds to 24 megahertz.
We have the ultra low power LO 92 series with voltage down to 0.9 volts. In the typical flash parts, we have the 1x, 2x, 4x, and 5x families with speeds from 8 megahertz all the way to 25 megahertz. At the far right, you'll see the CC430 with speeds to 20 megahertz. These parts have up to 32k of flash, 4k of RAM.
They also have an integrated RF transceiver inside them. So you can do remote control. You can send information from part to part. You could build networks with them using simplicity, 6LoWPAN, and different kinds of protocols. But the parts that we're going to be working with today are the G2xx series.
The value line series of parts. Those have speeds to 16 megahertz. And the slide here is a little bit wrong. Flash size goes as high as 16k and the RAM as high as 512 bytes. With a good number of GPIO, the main thing is these are set to be very low cost.
There are more than 40 parts currently available in the MSP430 value line. The differences between the parts you can see are mainly the flash sizes and the SRAM sizes. You can see that the flash goes between half a k all the way up to 16k kilobytes. The SRAM is 128 bytes all the way to 512 bytes.
The GPIO stretches from 10 to 24, depending on the part type and the package type. The number of timers, anywhere between 1 and 2. Those timers can also be either the A2 or A3 versions, A2 having 2 capture compare registers, the having A3 having 3.
All of the parts have the watchdog timer on them. Some of the parts have the USCIA, the Universal Syria Communications Interface that has I squared C SPI and Ewert hardware inside of it. The USI, the universal serial interface, has I squared C and SPI in it.
About half the parts have the comparator inside of them. About half the parts have the temperature sensor inside of them. On the ADC side, you can see that most of the parts have ADCs or ADD converters. Most of them are the 10-bit ADCs. Some of them are the slope ADCs. The 10-bit ADCs are successive approximation.
Many of the parts of have now been equipped with the cap touch IO. This is capacitive touch. The pinosc, P-I-N-O-S-C, feature that allows you to easily and with just a little bit of overhead implement capacitive touch on your design. You'll notice I have a blue next to the 2x 31.
The 22 31 was on the launch pad devices that were 1.4 and below. Version 1.5 came out and has the 22 53 version. The 22 53 has the peripheral shown on the chart their. Power consumption on these devices.
You'll notice that we're quoting this at 2.2 volts. All of the value line parts will go down to 1.8 volts. But at 2.2 volts, you still have in-system programmability of the flash. So we're going to quote at 2.2 volts were all of the features are there.
If you're not using in-system programmability of the flash, you could slide down to 1.8 volts and have a significant power savings. But at 2.2 volts, we're looking at point 1 micro amp RAM retention, being able to keep the RAM available when you start back up.
At 0.4 microamps, that's in standby mode. That's with the very low frequency oscillator running. At 0.7 microamps, we have the VLO or, excuse me, we would have the crystal clock running and be able to run in real time clock mode with a little bit of software running to keep the real time clock available for your system.
At fully active, we're talking about 220 microamp per MIP. So if you're running it at 8 MIPs, you're talking about somewhere around 1,700 microamps to run that application. That's pretty low.
If you're going to make use of a lot of low power modes and a lot of low power modes involve going to sleep-- turning the clocks on the part off and turning the CPU off-- then you're going to need ultra fast wake up when an interrupt occurs. So we can wake up from standby in less than one microsecond. In most cases, substantially less than one microsecond.
The central processing unit inside the MSP430 is 100% co-compatible with all the earlier versions. It has a full size, 1 megabyte, unified memory map. So there's no paging required across the entire memory of the device. The extended addressing modes have page free, 20-bit reach, improving the code density and causing faster execution when you have to access things outside of 16 bits.
Of course, on the G series parts, we will not be outside those 16 bits. Full tool support for the CPU. All of the versions of the CPU through IAR tools and through Code Composer Studio. The memory map of the MSP430 G2553 looks like the diagram on the right.
You can see that the interrupt vector table is pushed up at the top of memory. This is flash starting at FFFF going to FFE0. The rest of flash memory then starts right below that. And on the 2553, that's 16k bytes of flash. So that stretches all the way down to C000.
There's a section of information memory. Information memory is broken up into 64 byte segments. Most of the parts have four of these, A through D. You can store things in there like calibration constants, Mac, Mac addresses, IEEE addresses, and any other specific information that you want.
Section A of that contains device specific calibration data that's been factory programmed. And that's lockable, as well, so you don't inadvertently go in there and erase that. On the 2553, the RAM starts at 3FF and goes down to 200. Then, below that you can see the 16-bit peripherals, the 8-bit peripherals, and then some special function registers.
Programming the flash on this device is available either through the JTAG port or by doing it in system programming it inside your code. And like I said earlier, the in-system programmability works down to 2.2 volts. If you go down below that, the charge pump can't provide enough voltage to the flash to make it program.
That programming is single byte or word. It's interruptible either on the programming side or the array side. That flash is broken up into 512 byte segments. 0 to however large your space is. Those are erasable individually, or you can go in and erase all of them.
And if you're going to be changing the speed of the part, if you're going to be moving it between 1 megahertz and 16 megahertz, you're going to want to change the timing of the flash memory timing generator so it matches the speed that you have so you're writing to the flash as quickly as you can without it being too quick. So the flash memory timing generator in this device is completely programmable.
Taking a closer look at the value line peripherals, let's look first at the general purpose IO, the GPIO. The GPIO on the value line parts are independently programmable. You can write to any single pin or port if you like. Any combination of input, output, and edge selectable interrupt, either going high or going low, is possible on every single pin.
Read/write access to the port control registers, the data register, the selection register, and the direction register is supported by all instructions. Meaning that you don't have to go and read the port, and then read the pin, and then act on the pin. You can create a if statement that will read the port control register or the data register, and act on it in the same instruction. It saves you a lot of time and effort.
Each I/O has an individually programmable pull up or pull down resistor that can save you some on the bill of materials. Some parts and pins are touch sense enabled, meaning they have the pin OSC capability for capacitive touch. If you'd like to implement that in your design, that makes it very simple to do so.
All of the parts have, at least, one 16-bit timer in them. Some of them have two. And the timer versions go between the A2 and A3 version. The only difference between those two versions is the A2 has two CCR capture and compare registers. The A3 has three.
There are extensive interrupt capabilities on these things. You can interrupt when the timer rolls over. You can interrupt when it reaches one of the counter compare registers. You could do things like simple PWM. You can count events. You can monitor times. You can have the comparator reach in and start the timer, so you time the difference between the time when the voltage reaches a point and it reaches some other point.
So there are extensive interrupt capabilities on here. All of the parts have a watchdog timer. In this case, they're all the WDT plus. Did not only implement a 16-bit watchdog mode-- and we'll talk about the different timer capabilities it has later-- but it's also available to be used, if you're not using it as a watchdog, you can use it as an interval timer.
All of the devices have brownout reset circuitry on them. This will provide the correct reset signal during power up and power down. So when the parts coming up, it's possible for the ramp of the power to be slightly noisy and to be a little slow. The brownout reset circuitry will keep you in reset for a certain period of time after the resets or after the power reaches a certain point in order to make sure you start up well and don't have unreliable execution.
Also, on the way down, you want to make sure that when you reach a point where the processor can't operate any more that the brownout reset circuitry reaches back in and resets the processor for you. So again, you don't have unintended execution. Now some manufacturers don't include the power consumption of the brownout reset circuitry. Even though it's running all the time in their baseline current draw-- the TI specifications do-- the power consumption of the brownout requisite circuitry is included in the baseline current draw of all the MSP430s.
All of the value line parts have some kind of serial communication. The USI or universal serial interface have I squared c and spy support. The parts that have us CIA or universal serial communications interface have I squared c SPI. And they also include hardware UART support.
One of our modules that we're going to go over in the workshop is on a part that does not have UART. We can implement a software UART for a small amount of code space. We'll see how we can do that and have the possibility of saving some money.
About half the parts have a analog comparator, the comparator A plus. These comparators have inverting and non-inverting inputs. They have a selectable RC output filter on them. They also have an output to the timer capture input.
So when you cross past a certain point on the comparator, you could time from there to a certain event. The comparator also has interrupt capability. You can set an interrupt on this. Comparators are a underutilized resource on most processors.
They monitor the voltages continually and allow you to have interrupt capability without drawing hardly any current and needing no processor overhead to keep them doing their job. A very important capability when you're doing very low power types of designs.
Most of the parts have a 8 channel, 10-bit, 200 kilo sample per second, successive approximation ADC, ADD converter. Depending on the device, there may be as many as eight external channels, and voltage, and internal temperature sensors, depending on the device.
The reference voltage is programmable. They are all interrupt capable. And they also have a direct transfer controller. Sort of a low end DMA that sends results of the conversion to conversion memory without any CPU intervention. So you can take a series of readings, and then wake up the processor, and go about working on them.
Some of the parts have a slope converter, in case that's important in your design instead of a successive approximation. The development tool that we're using in the class is the LaunchPad development board. This is a low cost tool to give you access to working with the value line parts from MSP430 and Texas Instruments.
This board has a on-board USB emulation capability. You can see in the upper left the USB emulator connection that could connect directly to your PC. This emulator is a composite emulation. It has multiple JTAG accesses, multiple emulator accesses to talk to the part, as well as it implements a virtual comport so we can send data from the device back to your PC and from your PC back to the device.
The emulator is joined to your part through the six pin easy 430 connector. You can see that you can pull those pins and completely isolate the target board from the emulator if you want to. We also bring those pins on the emulator out to a series of pins there. If you wanted to put a flat cable and connect them directly into your target design, you're certainly welcome to do that.
We bring out all of the pins. The chip pin outs to the sides of the development board so you can plug on booster packs, for example. You can also put third party design tools on the top of the development board. There's room here for the crystal pads. And included in the LaunchPad development kit is the a 32 kilohertz micro crystal.
I have the steps in the lab that show you how to solder that in place and, when you've done that, how to check that to make sure that you soldered it into place correctly. The part in the socket there, the current 1.5 version comes with the 2553. Earlier versions came with the 2231.
So this socket takes up to the maximum size that the value line has currently, which is 20 pins in a dip socket. If you want to run your board on a battery, the power connector is down on the lower right. Two grounds and a VCC down there for you. The reset line is connected to the reset button down in the lower right.
We also have two of the lines, two of the GPIOs, connected to LEDs. A red and a green LED. Those are connected to port 1 pin 0 and port 1 pin 6. If you want to use those GPIO for something else, you can remove those jumpers. And that will take those LEDs out of there.
Port 1, pin 3 is also connected as a button. So when you press the button, right, that's connected where it says S2 up where the connections are there. You'll also notice port 1, pin 1, and port 1, pin 2 are the UART pins. That's the transmit and receive UART pins.
The 2553 device has the USCI, which has the hardware UART inside of it. You'll also notice up on the 6 pin easy 430 connector you'll see TXD and RXD. The UART pins are routed up there so that we can transmit information from the part directly up to your PC.
So the part that we're using on here is the MSP430 G2553. That part has 16 kilobytes of Flash and 512 bytes of RAM. There is two timer A3s on board. There's an 8 channel comparator A plus, an 8 channel ADC 10, and the USCI is on that part.
In lab 1, you will obtain and install all the needed hardware and software, as well as test the pre-installed application software. Since the installation steps are pretty straightforward, let's start with the hardware setup on step 18 of page 1-15 of the workbook.
Starting with the hardware setup section on page 1-15 of the workbook, the launchpad experimenter board includes a preprogrammed MSP430 device, which is already in the target socket. When the LaunchPad is connected to your PC, the demo software starts with an LED toggle sequence. The on-board emulator generates the supply voltage and all of the signals necessary to start the demo.
In step 18, connect the MSP430 launch pad to your PC using the included USB cable. Any driver installation needed will start automatically. If you're prompted for software, allow windows to install the software automatically.
In step 19, at this point, the on-board red and green LED's should toggle back and forth. This lets us know that the hardware is working and has been set up correctly. Press button P 1.3 in the lower left to switch the application to the temperature measurement mode.
A temperature reference is taken at the beginning of this mode. And the LED's on the launchpad signal a rise or fall in temperature by varying the brightness of the on-board LED's. Red for warmer and green for colder. Rub your fingertip on your pants to warm it up. And place it on the top of the MSP430 device on the LaunchPad board.
After a few seconds, the red LED should start to light, indicating a temperature rise. Once the red LED is solidly lit, remove your finger, and press the button again. This will set the temperature reference at the higher temperature.
As the part cools, the green LED will light, indicating the decreasing temperature. Bear in mind that ambient conditions in your room will affect this exercise.
Next, we'll be using the GUI to display the temperature readings on the PC. Be sure that you've installed the downloaded GUI source files, which is called launchpad under temp under GUI.zip.
In step 22, determine the comport used for the board by clicking in Windows XP. Start, Run, and then type in dev. D-E-V-M-G-M-T in the box, and select OK. In Windows 7, you could just type that same thing into the search program and files box.
When the Device Manager comes up, left-click on the symbol left of ports. It's a plus sign left the ports that says common LPT. And record the comport number for the MSP430 applications UART. It will be in the form com XXX. In our case, that's com 24. Go ahead and close the Device Manager.
In step 23, start the GUI by clicking on launchpad under temp under GUI.exe. This file is found in your install directory in the Launchpad Temp GUI application window. You may have to select Run in the open file security warning window if that comes up.
In step 24, it will take a few seconds for the GUI to start. Ours is already up. Be sure that your MSP430 application is running, that you've already pressed button P 1.3. That means we're not sitting there with the LED's toggling. In the GUI, select the comport that we found in the earlier step, and press Enter.
Now remember, this is a Dos window. Your mouse is not going to work. The current temperature should be displayed on the screen. Try increasing and decreasing the temperature on the device by putting your finger on it. I'm going to go ahead and put my finger on the device right now. And you can see the temperature going up in the capture.
Note that the internal temperature sensor is not calibrated. So the reading displayed may or may not be accurate. We're just looking for temperature changes right here. Step 25, go ahead and close the temperature GUI.
[MUSIC PLAYING]