Programmable Microcontrollers with Applications
Programmable Microcontrollers with Applications
MSP430 LaunchPad with CCS and Grace
Cem nsalan
H. Deniz Grhan
New York Chicago San Francisco
Athens London Madrid Mexico City Milan
New Delhi Singapore Sydney Toronto
Copyright 2014 by McGraw-Hill Education. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
ISBN: 978-0-07-183004-1
MHID: 0-07-183004-9
e-Book conversion by Cenveo Publisher Services
Version 1.0
The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-183003-4, MHID: 0-07-183003-0.
McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com.
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
Information has been obtained by McGraw-Hill Education from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, McGraw-Hill Education, or others, McGraw-Hill Education does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of such information.
TERMS OF USE
This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Educations prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS. McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
About the Authors
Cem nsalan, Ph.D., has worked in signal and image processing for 15 years. After getting a Ph.D. from The Ohio State University in 2003, he started working at Yeditepe University, Istanbul, Turkey, where he established the DSP Laboratory and has been teaching microprocessor and digital signal processing courses for 7 years. Dr. nsalan has published 16 journal articles and 4 international books. He holds one patent.
H. Deniz Grhan received his B.Sc. from Yeditepe University. He is pursuing a Ph.D. in digital signal processing and embedded systems at the same university and works in the DSP Laboratory.
Contents
Preface
Smart systems have become inevitable parts of our lives. Every smart system needs an information processing unit. A microcontroller is a good candidate for such an operation. Therefore, a professional engineer or a fresh graduate should know how a microcontroller works. This book aims to introduce the working principles of a current-model microcontroller through applications. To do this, we need a specific microcontroller platform. The recently introduced Texas Instruments MSP430 LaunchPad is an excellent choice for this purpose. It is a compact platform with an MSP430 microcontroller on it.
The first step in understanding a microcontroller is to examine its construction. We devote three chapters to this issue. In , we focus on the hardware of the MSP430 microcontroller. Therefore, we look at the central processing unit, memory, input and output ports, clocks and the timer modules, ADC and comparator modules, and the digital communication module. This chapter summarizes the properties of the MSP430 microcontroller to be considered throughout the book.
The second step in understanding a microcontroller is learning how to program it. To do so, we introduce Code Composer Studio (CCS) in . We also look at the addressing modes and the usage of the stack in this chapter.
The third step in understanding a microcontroller is using it through different applications. To do so, we should know its properties in detail. In , we provide sample applications on all topics considered. We picked these applications from real-life problems to show how a microcontroller can be used to solve them. In this final chapter, we provide the problem statement, equipment list, and circuit layout of each application. We expect the reader to implement these applications to master his or her knowledge in microcontroller-based system design.
In this book, we try to make all of these microcontroller concepts understandable to an undergraduate engineering student. Therefore, a professional engineer may also benefit from the book. Since we pick the MSP430 LaunchPad with the MSP430 microcontroller, the reader may find a wide variety of applications besides the ones considered in this book. However, the ones mentioned here will be the benchmark applications for the future. As a result, we expect the reader to become familiar with the microcontroller concepts in action.
Cem nsalan
H. Deniz Grhan
Acknowledgments
The authors gratefully acknowledge the support of Texas Instruments in the framing and execution of this work through the European University Program. Most of the figures used in this book are the property of TI. They are used here with TIs permission.