MSP430 Microcontroller Essentials
Architecture, Programming and Applications
By Miroslav Cina
Publisher Information
This is an Elektor Publication. Elektor is the media brand of Elektor International Media B.V.
78 York Street, London W1H 1DP, UK
Phone: (+44) (0)20 7692 8344
© Elektor International Media BV 2022
First published in the United Kingdom 2022
All rights reserved. No part of this book may be reproduced in any material form, including photocopying, or storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication, without the written permission of the copyright holder except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London, England W1P 9HE. Applications for the copyright holder's written permission to reproduce any part of this publication should be addressed to the publishers. The publishers have used their best efforts in ensuring the correctness of the information contained in this book. They do not assume, and hereby disclaim, any liability to any party for any loss or damage caused by errors or omissions in this book, whether such errors or omissions result from negligence, accident or any other cause.
British Library Cataloguing in Publication Data: Catalogue record for this book is available from the British Library.
ISBNs: 978-3-89576-492-9, 978-3-89576-493-6 (E-book)
Prepress production: DMC | dave@daverid.com
Printed in the Netherlands by Ipskamp
Elektor is part of EIM, the world's leading source of essential technical information and electronics products for pro engineers, electronics designers, and the companies seeking to engage them. Each day, our international team develops and delivers high-quality content - via a variety of media channels (e.g., magazines, video, digital media, and social media) in several languages - relating to electronics design and DIY electronics. Visit www.elektor.com.
Table of Contents
- Chapter 1: Introduction
- 1.1 MSP430
- 1.1.1 Family Overview
- 1.1.2 Part Numbers
- 1.1.3 Flash, EEPROM, RAM, FRAM, or even ROM?
- 1.1.3.1 ROM
- 1.1.3.2 RAM
- 1.1.3.3 PROM and EPROM
- 1.1.3.4 EEPROM
- 1.1.3.5 Flash
- 1.1.3.6 FRAM
- 1.1.4 MSP430x2xx architecture
- 1.1.5 POR vs. PUC
- 1.1.6 MSP430G2553
- 1.1.6.1 Digital Ports
- 1.1.6.2 ADC
- 1.1.6.3 WDT+
- 1.1.6.4 Comparator A
- 1.1.6.5 Timer A
- 1.1.6.6 USCI
- 1.1.7 MSP430F2001
- 1.1.8 MSP430F2012
- 1.2 Texas Instruments LaunchPads
- 1.2.1 LP-MSP430FR2476
- 1.2.2 MSP-EXP430FR4133
- 1.2.3 MSP-EXP430FR2355
- 1.2.4 MSP-EXP432P401R
- 1.2.5 MSP-EXP430G2ET
- 1.2.6 BOOSTXL-EDUMKII
- 1.1 MSP430
- Chapter 2: Integrated Development Environment (IDE)
- 2.1 Code Composer Studio (CCS)
- 2.2 Energia (MSP430 Arduino)
- Chapter 3: Simple Examples for MSP430G2553
- 3.1 GPIO
- 3.1.1 Hello World
- 3.1.1.1 Hardware
- 3.1.1.2 Energia Firmware
- 3.1.1.3 CCS Firmware
- 3.1.2 Hello World 2
- 3.1.2.1 Hardware
- 3.1.2.2 Energia Firmware
- 3.1.2.3 CCS Firmware
- 3.1.3 Game Cube
- 3.1.3.1 Hardware
- 3.1.3.2 Energia Firmware
- 3.1.3.3 CCS Firmware
- 3.1.4 Connecting an LCD
- 3.1.4.1 Hardware
- 3.1.4.2 Energia Firmware
- 3.1.4.3 CCS Firmware
- 3.1.4.4 CCS Firmware - The Library
- 3.1.1 Hello World
- 3.2 ADC10
- 3.2.1 First simple exercise: reading the ADC10 control registers
- 3.2.1.1 Hardware
- 3.2.1.2 Energia Firmware
- 3.2.2 Internal Temperature Sensor
- 3.2.2.1 Hardware
- 3.2.2.2 CCS Firmware
- 3.2.3 Own Voltage
- 3.2.3.1 Hardware
- 3.2.3.2 Energia Firmware / Serial Monitor
- 3.2.3.3 Energia Firmware / LCD
- 3.2.3.4 CCS Firmware
- 3.2.4 Potentiometer
- 3.2.4.1 Hardware
- 3.2.4.2 Energia Firmware - Version 1
- 3.2.4.3 Energia Firmware - Version 2
- 3.2.1 First simple exercise: reading the ADC10 control registers
- 3.3 WDT+
- 3.3.1 WatchDog Reset
- 3.3.1.1 Specification
- 3.3.1.2 Hardware
- 3.3.1.3 Energia Firmware
- 3.3.2 WatchDog Interrupt Flag
- 3.3.2.1 Hardware
- 3.3.2.2 Energia Firmware
- 3.3.2.3 CCS Firmware
- 3.3.1 WatchDog Reset
- 3.4 Timer_A module
- 3.4.1 Simple 16-bit counter
- 3.4.1.1 Hardware
- 3.4.1.2 CCS Firmware
- 3.4.1 Simple 16-bit counter
- 3.5 USCI
- 3.5.1 I²C communication by software / CCS
- 3.5.1.1 Hardware
- 3.5.1.2 CCS Firmware
- 3.5.2 I²C communication by software / Energia
- 3.5.2.1 Hardware
- 3.5.2.2 Energia Firmware
- 3.5.3 OneWire Thermometer
- 3.5.3.1 Hardware
- 3.5.3.2 Energia Firmware
- 3.5.1 I²C communication by software / CCS
- 3.6 Comparator_A+
- 3.6.1 Hit the reference
- 3.6.1.1 Hardware
- 3.6.1.2 Energia Firmware
- 3.6.1 Hit the reference
- 3.1 GPIO
- Chapter 4: MSP430F2001 / MSP430F2012
- 4.1 Flashing Heart
- 4.1.1 Hardware
- 4.1.2 CCS Firmware
- 4.2 Traffic Light
- 4.2.1 Hardware
- 4.2.2 CCS Firmware
- 4.3 Game Cube
- 4.3.1 Hardware
- 4.3.2 CCS Firmware
- 4.4 Game Cube / Demo
- 4.4.1 Hardware
- 4.4.2 CCS Firmware
- 4.5 Temperature measurement
- 4.5.1 Specification
- 4.5.2 Hardware
- 4.5.2.1 Temperature Sensor TMP37
- 4.5.2.2 Schematic
- 4.5.3 Firmware
- 4.5.3.1 Temperature Calculation
- 4.5.3.2 ADC10 settings
- 4.5.3.3 Firmware
- 4.1 Flashing Heart
- Chapter 5: The Application
- 5.1 Specification
- 5.1.1 Behaviour
- 5.1.2 Operation
- 5.1.2.1 Main Application / Main Menu
- 5.1.2.2 AT30TSE754
- 5.1.2.3 Real Time Clock
- 5.1.2.4 Humidity Sensor
- 5.2 Used Components
- 5.2.1 GPIO - PCF8574A
- 5.2.2 RTC - DS1307
- 5.2.3 Temperature Sensor: AT30TSE754
- 5.2.3.1 Registers of the AT30TSE754
- 5.2.3.2 I2C communication - Configuration Register
- 5.2.3.3 I2C communication - Temperature Register
- 5.2.4 Humidity Sensor: HYT939
- 5.2.4.1 I2C communication - Measurement Request
- 5.2.4.2 I2C communication - Data Fetch
- 5.2.4.3 Calculation of humidity and temperature
- 5.3 Hardware
- 5.3.1 Main Module
- 5.3.2 RTC I2C Module
- 5.3.3 Temperature I2C Module
- 5.3.4 Humidity I2C Module
- 5.4 Test-Firmware
- 5.4.1 What we can see?
- 5.4.2 Firmware for keyboard test
- 5.5 Firmware
- 5.5.1 Libraries
- 5.5.2 Setup function
- 5.5.3 Main Loop
- 5.5.4 Function Selection
- 5.5.5 The main application
- 5.5.6 RTC
- 5.5.6.1 RTC LCD-only related functions
- 5.5.6.2 RTC main functions
- 5.5.6.3 RTC I2C communication
- 5.5.7 Calculation of a weekday
- 5.5.8 AT30TSE754
- 5.5.8.1 Changing the I2C address of the temperature sensor
- 5.5.8.2 Search I2C temperature sensor
- 5.5.8.3 Configuration register of the I2C temperature sensor
- 5.5.9 HYT939
- 5.5.10 Keyboard
- 5.5.10.1 I2C communication routine
- 5.5.10.2 Main keyboard driver
- 5.1 Specification
- Index