You are previewing Getting Started with the MSP430 Launchpad.
O'Reilly logo
Getting Started with the MSP430 Launchpad

Book Description

This book explores the world of microcontroller development through friendly lessons and progressively challenging projects, which will have you blink LEDs, make music with buzzers & interact with different sensors like accelerometers and temperature sensors. This book is focused on the MSP-EXP430G2 LaunchPad Evaluation Kit, which is a complete microcontroller development platform that includes everything you need to start creating microcontroller-based projects. Many of the 25+ projects will also leverage external components, such as the highly-integrated Educational BoosterPack, which is a modular extension to the LaunchPad and includes many components such as an RGB LED, character LCD & potentiometer.

This book provides helpful guides that break down hardware circuits through visual diagrams and includes fully-commented code examples. Concepts are broken down and explained in an easy to follow language and analogies to help you understand the principles behind each project/system. The projects will encourage you to use and even combine the fundamental concepts to develop your ideas in creating new microcontroller solutions.

Coverage includes:

  • Digital Input/Output: buttons, LEDs, turning anything into a button
  • Analog Input/Output: sensors, temperature, accelerometer, potentiometer, etc.
  • Programming fundamentals: conditional branches & loops, flow, logic, number systems
  • Pulse-Width Modulation (PWM): square wave, buzzer, analog signal simulation
  • Serial Communication: UART, SPI & I2C
  • Code development using Energia, a free, open-source code editor and compiler
  • Debugging through serial communication with a computer
  • Interfacing with external components such as LEDs, buzzers, potentiometers, sensors & more.

With the help of this book, you will be challenged to think about developing your own unique microcontroller-based application, and you will be equipped to start solving various problems, adding intelligence to existing products, or even developing your own innovative creations with a LaunchPad development kit.



  • Includes over 25 projects which focuses on a learn by doing approach
  • Contains easy to follow diagrams and code examples
  • Covers Programming fundamentals, such as conditional branches and loops, flow, logic, number systems

Table of Contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Preface
  6. Acknowledgments
  7. Chapter 1. Prepare for Liftoff!
    1. 1.1 Who Should Read This Book?
    2. 1.2 What to Expect Out of This Book
    3. 1.3 What Is Possible?
  8. Chapter 2. Meet the LaunchPad
    1. 2.1 The Brain, the Senses, and the Actions
    2. 2.2 Teach the LaunchPad
    3. 2.3 Inside the Box
    4. 2.4 Project 1: The First Encounter of the LaunchPad Kind
  9. Chapter 3. The Fellowship of the LaunchPad
    1. 3.1 Your Journey’s Companion
    2. 3.2 The Educational BoosterPack
    3. 3.3 The Breadboard
    4. 3.4 Breakout Board
    5. 3.5 Soldering
    6. 3.6 Electrical Etiquette
    7. 3.7 Recreating the Educational BoosterPack
    8. 3.8 So I’ve Got the Hardware, What About the Software?
  10. Chapter 4. Meet Energia—a Software Development Environment
    1. 4.1 How to Teach Your LaunchPad New Tricks
    2. 4.2 Get Energia
    3. 4.3 Project 2: LaunchPad’s First Trick—Blink
    4. 4.4 Looking at Our First Code Example
    5. 4.5 Modifying Our First Code Example
    6. 4.6 Breaking a Problem Down
  11. Chapter 5. Day in the Life of a Microcontroller
    1. 5.1 The Logical LaunchPad
    2. 5.2 If (hungry) {eat}
    3. 5.3 Conditionals
    4. 5.4 If (hungry) {eat} else {sleep}:
    5. 5.5 Multiple Choices with the Switch
    6. 5.6 Repetition+Condition=Loop
    7. 5.7 Project 3: LED Blink Counter
    8. 5.8 Your LaunchPad Just Got Educated!
  12. Chapter 6. Think Digitally
    1. 6.1 Binary: 0+1=65,536
    2. 6.2 Hexadecimal—Binary’s Big Brother
    3. 6.3 What’s with the Math Class?
    4. 6.4 Dissecting the LaunchPad’s Brain
    5. 6.5 Project 4: Controlling the LEDs the Hard Way!
    6. 6.6 Diving Deep to the Register Level
  13. Chapter 7. The Ins and Outs of Digital I/O
    1. 7.1 Project 5: Reading a Button Input
    2. 7.2 Configuring I/O
    3. 7.3 How a Button Works
    4. 7.4 Digitizing Voltage
    5. 7.5 Beyond LEDs and Buttons
    6. 7.6 Project 6: Turn Anything into an Input
    7. 7.7 EE101—Ohm’s Law
    8. 7.8 Your Resistance Is Futile
  14. Chapter 8. Analog: The Infinite Shades of Gray
    1. 8.1 Beyond Black and White
    2. 8.2 Project 7: Our First Analog Experiment—The Potentiometer
    3. 8.3 Reading Analog Signals with Energia
    4. 8.4 Project 8: Analog-to-Digital Signal Chain
    5. 8.5 Project 9: Our First Debug Session—A Look Inside Our LaunchPad Brain
    6. 8.6 Digitizing an Analog Signal
    7. 8.7 Project 10: Battery-Life Tester
    8. 8.8 Types of Analog Signals
    9. 8.9 Project 11: Is It Hot in Here?
    10. 8.10 Project 12: Fun with Forces
    11. 8.11 Analog Output
    12. 8.12 Project 13: Analogwrite() with One LED
    13. 8.13 Project 14: House Cleaning and Coding Best Practices
    14. 8.14 Project 15: Heart Beat
    15. 8.15 Project 16: Mixing Colors with an RGB LED
    16. 8.16 Analog-to-Analog Signal Chain
    17. 8.17 Project 17: Analog-to-Analog Signal Chain: Potentiometer→White LED
    18. 8.18 Project 17: Analog-to-Analog Signal Chain: Accelerometer→RGB
    19. 8.19 Analog Wrap Up
  15. Chapter 9. 1s and 0s Revisited: The Digital Stream
    1. 9.1 The Flexible Digital World
    2. 9.2 Pulse-Width Modulation
    3. 9.3 What? Analogwrite() Is a Lie
    4. 9.4 Project 17: Square Wave and a Buzzer
    5. 9.5 Project 18: Doe, a Deer, a Female Deer (Music with LaunchPad)
    6. 9.6 Project 19: Musical Instrument—Potentiometer to Buzzer
    7. 9.7 Project 20: Musical Instrument Part 2—Accelerometer to Buzzer
    8. 9.8 Wrapping Up the Digital Stream
  16. Chapter 10. The Languages of LaunchPad
    1. 10.1 LaunchPad—A Social Butterfly
    2. 10.2 A Multilingual LaunchPad
    3. 10.3 Project 21: LaunchPad, Meet Computer, Computer, Meet LaunchPad (with UART)
    4. 10.4 “What Is You-Art?”
    5. 10.5 Project 22: Echo! Echo! Echo! Echo!
    6. 10.6 Translating LaunchPad—Speak with ASCII
    7. 10.7 The Hardware Behind UART
    8. 10.8 Project 23: Controlling LaunchPad with Commands from Computer
    9. 10.9 Project 24: The Color Picker
    10. 10.10 Serial Peripheral Interface
    11. 10.11 Project 25: Hello World with LCD
    12. 10.12 Project 26: A Magic Eight Ball LaunchPad
    13. 10.13 Other Languages
    14. 10.14 Wrapping Up the Languages of LaunchPad
  17. Chapter 11. LaunchPad is Just the Beginning
    1. 11.1 We Did It
    2. 11.2 Looking Back
  18. Appendix. Quick References
    1. Energia Pin Mapping
    2. Using the Educational BoosterPack