MSP430 Microcontroller Basics

Similar documents
Programming 8-bit PIC Microcontrollers in С

Embedded Systems Architecture

Computers as Components Principles of Embedded Computing System Design

MAKING PIC MICROCONTROLLER INSTRUMENTS AND CONTROLLERS

The Definitive Guide to the ARM Cortex-M3

2002 Mixed Signal Products SLAU056B

EMBEDDED SYSTEMS: Jonathan W. Valvano INTRODUCTION TO THE MSP432 MICROCONTROLLER. Volume 1 First Edition June 2015

THE AVR MICROCONTROLLER AND EMBEDDED SYSTEMS. Using Assembly and С

FPGAs: Instant Access

Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2.

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview

PROGRAMMING AND CUSTOMIZING

Microcontroller basics

Open-Source Robotics and Process Control Cookbook

Fredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт.

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Designing Embedded Systems with PIC Microcontrollers

An Introduction to Programming with IDL

Acknowledgments About the Author

M (~ Computer Organization and Design ELSEVIER. David A. Patterson. John L. Hennessy. University of California, Berkeley. Stanford University

Programming in the MAXQ environment

MECHATRONICS. William Bolton. Sixth Edition ELECTRONIC CONTROL SYSTEMS ENGINEERING IN MECHANICAL AND ELECTRICAL PEARSON

Complete PCB Design Using OrCad Capture and Layout

PTC Mathcad Prime 3.0

Digital Signal Processing System Design: LabVIEW-Based Hybrid Programming Nasser Kehtarnavaz

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

Coding for Penetration

Information Modeling and Relational Databases

Modern Embedded Computing Designing Connected, Pervasive, Media-Rich Systems

Android Forensics. Investigation, Analysis, Google Android. and Mobile Security for. Andrew Hoog. John McCash, Technical Editor SYNGRESS

Algorithmic Graph Theory and Perfect Graphs

ECE 480 Team 5 Introduction to MAVRK module

Coding for Penetration Testers Building Better Tools

Table of Contents COMPANY PROFILE 1-1 SECTION 1. INTRODUCTION 1-1

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

32 bit Micro Experimenter Board Description and Assembly manual

2-Oct-13. the world s most energy friendly microcontrollers and radios

Design of Embedded Systems Using 68HC12/11 Microcontrollers

WHICH MICRO? What does MCU needs to do in my system? What are the tasks? Dr. Adriana Becker-Gomez

ECE 511 Project Group 11: MP3 Boombox 12/03/2013. Carlos R Araujo Divya Chinthalapuri Leegia S Jacob Brian D Jarvis Shawn Wilkinson

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

Objective: Additional project details: Code: PSEMBP 100 Category:STEM Level: High School/Community C.

MSP430. More on MSP430

MPEG-l.MPEG-2, MPEG-4

ITT Technical Institute. ET2640 Microprocessors and Microcontrollers Onsite and Online Course SYLLABUS

MSP430FG4618 Programming Reference Revision 3

Future Technology Devices International

Renesas New Generation of R8C/Tiny Series MCUs Adds 1.8V Support and Coprocessing With Background Operation to Enable Low-cost Innovative Designs

Intro. MEB/ Texas Instruments Inc, Slide 1

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

Systems Programming. Lecture 4 Z16 Architecture and Programming

Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their

An Introduction to Parallel Programming

Z8 Encore! XP F1680 Series 8-Bit Flash Solution with Extended Peripherals

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

SEIKO EPSON CORPORATION

Maya Python. for Games and Film. and the Maya Python API. A Complete Reference for Maya Python. Ryan Trowbridge. Adam Mechtley ELSEVIER

MSP430 Teaching Materials

Timers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Lecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT

University Program Advance Material

Managed. Code Rootkits. Hooking. into Runtime. Environments. Erez Metula ELSEVIER. Syngress is an imprint of Elsevier SYNGRESS

Basics of UART Communication

TMS320C55x DSP Peripherals Overview Reference Guide. Preliminary Draft

Unlocking the Potential of Your Microcontroller

Homework 9: Software Design Considerations

2006 Mixed Signal Products SLAU144B

EE 354 Fall 2015 Lecture 1 Architecture and Introduction

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

ARM Microcontroller Interfacing - Warwick A. Smith ISBN Elektor. Table of Contents

ZKit-51, 8051 Development Kit

The Unified Modeling Language User Guide

Department of Electronics and Instrumentation Engineering Question Bank

Final Exam Study Guide

Computer Architecture A Quantitative Approach

PD215 Mechatronics. Week 3/4 Interfacing Hardware and Communication Systems

I Introduction to Real-time Applications By Prawat Nagvajara

Claus Kuhnel BASCOM. Programming of Microcontrollers with Ease. An Introduction by Program Examples

ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview

PIC Microcontroller Introduction

How to create your own peripheral modules for use with the ARC EMSK and embarc

Introduction to ARM LPC2148 Microcontroller

Engineering Real- Time Applications with Wild Magic

Diploma in Embedded Systems

PRODUCT PREVIEW TNETV1050 IP PHONE PROCESSOR. description

Prototyping Module Datasheet

SPI Universal Serial Communication Interface SPI Mode

Security for Microsoft Windows System Administrators

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

Various power connectors. 3.3V regulator. 64K Flash (Internal) 2K EEPROM (Internal) 4K SRAM (Internal) JA Mem Adr/ Data. Doc: page 1 of 9

3.3V regulator. JA H-bridge. Doc: page 1 of 7

FAE Summit Interfacing the ADS8361 to the MSP430F449 Low Power Micro Controller

USER GUIDE. ATWINC1500 Xplained Pro. Preface

TMS320C6000 DSP 32-Bit Timer Reference Guide

Alex Milenkovich 1. CPE/EE 421 Microcomputers: The MSP430 Introduction. Outline

Am186ER/Am188ER AMD continues 16-bit innovation

MICROPROCESSOR BASED SYSTEM DESIGN

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -1 1 UNIT 1

Transcription:

MSP430 Microcontroller Basics John H. Davies AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO Newnes is an imprint of Elsevier N WPIGS

Contents Preface xi Chapter 1: Embedded Electronic Systems and Microcontrollers 7 1.1 What (and Where) Are Embedded Systems? 1 1.2 Approaches to Embedded Systems 2 1.3 Small Microcontrollers 5 1.4 Anatomy of a Typical Small Microcontroller 8 1.5 Memory 11 1.6 Software 15 1.7 Where Does the MSP430 Fit? 16 Chapter 2: The Texas Instruments MSP430 21 2.1 The Outside View Pin-Out 21 2.2 The Inside View Functional Block Diagram 24 2.3 Memory 25 2.4 Central Processing Unit 30 2.5 Memory-Mapped Input and Output 32 2.6 Clock Generator 33 2.7 Exceptions: Interrupts and Resets 36 2.8 Where to Find Further Information 37 Chapter 3: Development 43 3.1 Development Environment 44 3.2 The С Programming Language 46 3.3 Assembly Language 55 3.4 Access to the Microcontroller for Programming and Debugging 57 3.5 Demonstration Boards 59 3.6 Hardware 64 3.7 Equipment 65

viii Contents Chapter 4: A Simple Tour of the MSP430 67 4.1 First Program on a Conventional Desktop Computer 68 4.2 Light LEDs in С 70 4.3 Light LEDs in Assembly Language 72 4.4 Read Input from a Switch 80 4.5 Automatic Control: Flashing Light by Software Delay 91 4.6 Automatic Control: Use of Subroutines 99 4.7 Automatic Control: Flashing Light by Polling Timer_A 105 4.8 Header Files and Issues Brushed under the Carpet 114 Chapter 5: Architecture of the MSP430 Processor 119 5.1 Central Processing Unit 119 5.2 Addressing Modes 125 5.3 Constant Generator and Emulated Instructions 131 5.4 Instruction Set 132 5.5 Examples 146 5.6 Reflections on the CPU and Instruction Set 153 5.7 Resets 157 5.8 Clock System 163 Chapter 6: Functions, Interrupts, and Low-Power Modes 7 77 6.1 Functions and Subroutines 178 6.2 What Happens when a Subroutine Is Called? 178 6.3 Storage for Local Variables 179 6.4 Passing Parameters to a Subroutine and Returning a Result 183 6.5 Mixing С and Assembly Language 185 6.6 Interrupts 186 6.7 What Happens when an Interrupt Is Requested? 188 6.8 Interrupt Service Routines 190 6.9 Issues Associated with Interrupts 196 6.10 Low-Power Modes of Operation 198 Chapter 7: Digital Input, Output, and Displays 207 7.1 Digital Input and Output: Parallel Ports 208 7.2 Digital Inputs 216 7.3 Switch Debounce 225 7.4 Digital Outputs 238 7.5 Interface between 3V and 5V Systems 243 7.6 Driving Heavier Loads 247 7.7 Liquid Crystal Displays 252 7.8 Driving an LCD from an MSP430x4xx 256 7.9 Simple Applications of the LCD 264

Contents ix Chapter 8: Timers 275 8.1 Watchdog Timer 276 8.2 Basic Timerl 281 8.3 Timer_A 287 8.4 Measurement in the Capture Mode 300 8.5 Output in the Continuous Mode 318 8.6 Output in the Up Mode: Edge-Aligned Pulse-Width Modulation 330 8.7 Output in the Up/Down Mode: Centered Pulse-Width Modulation 349 8.8 Operation of Timer_A in the Sampling Mode 352 8.9 Timer_B 353 8.10 What Timer Where? 356 8.11 Setting the Real-Time Clock: State Machines 357 Chapter 9: Mixed-Signal Systems: Analog Input and Output 369 9.1 Comparator_A 371 9.2 Analog-to-Digital Conversion: General Issues 393 9.3 Analog-to-Digital Conversion: Successive Approximation 402 9.4 The ADC10 Successive-Approximation ADC 407 9.5 Basic Operation of the ADC 10 412 9.6 More Advanced Operation of the ADC10 424 9.7 The ADC12 Successive-Approximation ADC 432 9.8 Analog-to-Digital Conversion: Sigma-Delta 438 9.9 The SD16_A Sigma-Delta ADC 446 9.10 Operation of SD16_A 459 9.11 Signal Conditioning and Operational Amplifiers 475 9.12 Digital-to-Analog Conversion 485 Chapter 10: Communication 493 10.1 Communication Peripherals in the MSP430 495 10.2 Serial Peripheral Interface 497 10.3 SPI with the USI 504 10.4 SPI with the USCI 513 10.5 A Thermometer Using SPI in Mode 3 with the F2013 as Master 520 10.6 A Thermometer Using SPI in Mode 0 with the FG4618 as Master 526 10.7 Inter-integrated Circuit Bus 534 10.8 ASimplePCMasterwiththeUSCI_B0onaFG4618 542 10.9 A Simple PC Slave with the USI on a F2013 549 10.10 State Machines for PC Communication 559 10.11 A Thermometer Using PC with the F2013 as Master 567 10.12 Asynchronous Serial Communication 574 10.13 Asynchronous Communication with the USCI_A 581

x Contents 10.14 A Software UART Using Timer_A 590 10.15 Other Types of Communication 599 Chapter 11: The Future: MSP430X 601 11.1 Architecture of the MSP430X 601 11.2 Instruction Set of the MSP430X 607 11.3 Where Next? 614 11.4 Conclusion 617 Appendix A: Kickstarting the MSP430 679 A. 1 Introduction to EW430 619 A.2 Developing a Project in С 621 A.3 Debugging with the Simulator 627 A.4 Debugging with the Emulator 630 A.5 Developing a Project in Assembly Language 633 A.6 Tips for Using EW430 636 A.7 Tips for Specific Development Kits 640 Appendix B: Further Reading 645 Books and Articles 645 Newsletters, Magazines, and Journals 651 Index 655