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

10.6. SUMMARY 359
else if(robot_action==straight_ahead)
{
TBCCR0 = 255; //CCR0 PWM duty cycle - half speed
TBCCR1 = 255; //CCR1 PWM duty cycle - half speed
}
else if(robot_action==reverse)
{
TBCCR0 = 0; //CCR0 PWM duty cycle - stop
TBCCR1 = 511; //CCR1 PWM duty cycle - full speed
}
else
{
TBCCR0 = 255; //CCR0 PWM duty cycle - half speed
TBCCR1 = 255; //CCR1 PWM duty cycle - half speed
}
TBCTL=TBSSEL_2+MC_1+TBCLR; //SMCLK, upmode, clear TBR
}
//***********************************************************************
10.6 SUMMARY
In this chapter, we provided the designs for four different embedded systems to illustrate concepts
presented throughout the text. The four systems use the input/output, analog-to-digital converter,
communication and timer capabilities of the MSP430 controller to meet their system requirements.
By following the steps shown in this chapter to design the four embedded systems, we hope that
you will be able to construct your microcontroller-based systems.
10.7 REFERENCES
H. Bohm and V. Jensen, “Build Your Own Underwater Robot and Other Wet Projects,”
Westcoast Words, Vancouver, B.C. 1997.
seaperch, www.seaperch.org
SparkFun, www.sparkfun.com
S. Schauer, C. Speck, “Interfacing the MSP430 with MMC/SD flash memory cards,”
SLAA281B, March 2008.

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