O'Reilly logo

Microcontroller Programming and Interfacing Texas Instruments MSP430 by Daniel J. Pack, Steven F. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

310 9. COMMUNICATION SYSTEMS
9%86 86%3RZHU8QLW
3+<3//SRZHURU3+<SRZHU
7UDQVFHLYHU
3+<
86%&RQWUROOHU
6HULDO,QWHUIDFH(QJLQH
86%%XIIHU0DQDJHU
86%&RQWURO5HJLVWHUV
86%%XIIHU
5$0
86%7LPHU
7LPHU6WDPS
*HQHUDWRU
0+]3//
'
'
385
Figure 9.8: MSP430 USB Module.
MSP430 wireless applications is constantly growing. For any wireless application, as it is the case
for most other microcontrollers in the market, MSP430 needs an RF communication module. Texas
Instruments developed CC2500 series radio transceivers that can handsomely accomplish this work
in a short range. For programming such transceiver, see the reference section at the end of the chapter.
The transceiver is one of a large number of devices that are compatible to operate with the SPI unit
of MSP430.The SPI unit of the Universal Serial Communication Interface (USCIB0) on MSP430
controller communicates with a radio transceiver, and a pair or more of the transceivers use a pre-
designated communication protocol to send and receiver data among controllers that are wirelessly
connected. The reference article, “Creating a Zigbee Smart Energy Device with the MSP430F54xx
and the CC2530-ZNP” describes how one can put together a MSP430 based system that uses
a CC2530 transceiver to communicate with other devices equally equipped, including software
programs.
9.8 LABORATORY EXERCISE
Throughout this book, we showed how the MSP430 technologies can be used for a number of
embedded systems applications. For this chapters laboratory exercise, your task is to design and
program a smart home sensor network system.
Purpose: This lab provides opportunities to exercise your MSP430 controller programming
skills while constructing a simple sensor network. As you have learned in this chapter, MSP430
controllers have built-in communication modules which are used to send and receive data with
9.8. LABORATORY EXERCISE 311
other devices. In this laboratory exercise, you are tasked to build four sensor modules, each built
with a MSP430 controller along with the CC2530-ZNP transceiver: a power meter module, a
heater/ventilation/air-conditioning (HVAC) module,a refrigerator module,and a water heater mod-
ule.
Documentation: Users manual for your MSP430 controller board, Users manual for
CC2530-ZNP transceiver.
Pre-Laboratory Exercise: Prepare a flowchart or pseudo-code for your programs to run on
each of the four sensor modules.
Description: One of the main reasons researchers and engineers are looking to build smart
homes is its ability to make smart decisions without human intervention. In this exercise, we want
to imbue a level of intelligence to the four sensor module system such that the modules in the system
can coordinate their actions to minimize the overall power use of the house based on a set of desired
house conditions and the time of the day to avoid peak-time use of power. We assume that the power
meter of the house can provide both the rate of power use and a peak-time power use indication
to the other sensor modules in the network. We also assume that both the HVAC module and the
refrigerator module can measure the temperature and the actions of their controllers. Finally, we
assume that the water heater module can detect the water temperature of the water in the water
heater tank and turn on its heater when temperature falls below a pre-set level.
Your tasks are shown below.
1. Program the power meter module to broadcast the overall power use rate (Watts/second)
and a peak-time use indication (a binary value will suffice) to the other three sensor modules
once every minute - use the timer unit function of MSP430 to accomplish this broadcast rate
requirement.
2. Requirements for the HVAC module: Check the ambient temperature once every minute.
If the ambient temperature falls in the range of 67 to 82 Fahrenheit, do nothing. If it is
below 67 degrees and it is during the non-peak-power usage time, turn on the heater until
the temperature rises to 70 degrees. The heater should turn on when the temperature is below
64 degrees, during the peak-power usage time, and stays on until the temperature rises to
67 degrees. When the temperature rises above 82 degrees, during a non-peak-power usage
time, it should turn on the air conditioner until the temperature falls to 76 degrees. During the
peak-power usage time, turn on the fan only. If the temperature continues to rise to 85 degrees,
turn on the air conditioner until temperature falls to 79 degrees.
3. The only requirement for the refrigerator module is to monitor the ice cube level. If the ice
level is low, generate ice only if it is not during the peak-power usage time.
4. Requirements for the water heater: During the off peak-power usage time, operate normally.
During the peak-power usage time, turn on the water heater only if the water level inside the
water heater tank is below the level pre-specified (say, 1/4).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required