SlideShare a Scribd company logo
1 of 53
CPE/EE 421 Microcomputers:
The MSP430 Introduction
Instructor: Dr Aleksandar Milenkovic
Lecture Notes
CPE/EE 421/521 Microcomputers 2
Outline
MSP430: An Introduction
 The MSP430 family
 Technology Roadmap
 Typical Applications
 The MSP430 Documentation
 MSP430 Architecture
 MSP430 Devices
 Getting Started with EasyWeb2
 MSP430 RISC core
CPE/EE 421/521 Microcomputers 3
The Family
 Broad family of TI’s 16-bit microcontrollers
 from 1Kbytes ROM, 128 bytes RAM (approx. $1 )
 to 60Kbytes ROM, 10Kbytes RAM ( $10)
 Three subfamilies
 MSP430x1xx: basic unit
 MSP430x3xx: more features
 MSP430x4xx: built-in LCD driver
CPE/EE 421/521 Microcomputers 4
Part numbering convention
 MSP430MtFaFbMc
 Mt : Memory type

C – ROM, F – Flash, P – OTP, E – EPROM
 Fa,Fb

10, 11 – basic

12, 13 – HW UART

14 – HW UART, HW multiplier

31, 32 – LCD Controller

33 – LCD controller, HW UART, HW multiplier

41 – LCD controller

43 - LCD controller, HW UART

44 - LCD controller, HW UART, HW multiplier
CPE/EE 421/521 Microcomputers 5
Part numbering convention
 MSP430MtFaFbMc
 Mc : Memory capacity

0: 1 Kb ROM, 128 b RAM

1: 2 KB ROM, 128 b RAM

2: 4 KB ROM, 256 b RAM

....

9: 60 KB ROM, 2 Kb RAM
CPE/EE 421/521 Microcomputers 6
MSP 430 Roadmap
CPE/EE 421/521 Microcomputers 7
Handheld Measurement
 Air Flow measurement
 Alcohol meter
 Barometer
 Data loggers
 Emission/Gas analyser
 Humidity measurement
 Temperature
measurement
 Weight scales
Medical Instruments
 Blood pressure meter
 Blood sugar meter
 Breath measurement
 EKG system
Home environment
 Air conditioning
 Control unit
 Thermostat
 Boiler control
 Shutter control
 Irrigation system
 White goods
(Washing machine,..)
Misc
 Smart card reader
 Taxi meter
 Smart Batteries
Utility Metering
 Gas Meter
 Water Meter
 Heat Volume Counter
 Heat Cost Allocation
 Electricity Meter
 Meter reading system (RF)
Sports equipment
 Altimeter
 Bike computer
 Diving watches
Security
 Glass break sensors
 Door control
 Smoke/fire/gas detectors
MSP430 Typical Applications
CPE/EE 421/521 Microcomputers 8An MSP430-Based System
LCD
Switches
RS232
controller
Thermistor
Analog I/O
RS232
2-axes
joystick
Adj. Vol. Regul.
LEDs
µC
Keypad
CPE/EE 421/521 Microcomputers 9
 Battery
 Microcontroller
 TI MSP430F149
 8-channel 12-bit AD conv.
 Accelerometer
 Movement detection
 Analog Device ADXL202
 Transceiver
 LINX 916 MHz
Basic WISE
Another MSP430-Based System
CPE/EE 421/521 Microcomputers 10
Tmote Sky Platform
 Texas Instruments 16-bit MSP430F149
microcontroller (2KB RAM, 60KB ROM)
 Chipcon 2420, 250kbps, 2.4GHz, IEEE 802.15.4
compliant wireless transceiver
with programmable output power
 Integrated onboard antenna with 50m range
indoors and 125m range outdoors
 Integrated humidity, temperature, and light
sensors
CPE/EE 421/521 Microcomputers 11
Tmote Sky Platform
http://www.moteiv.com
CPE/EE 421/521 Microcomputers 12
MSP430 Documentation
 MSP430 home page (TI)
 www.ti.com/msp430
 User’s manual (MSP430x1xx Family)
 http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp
 Datasheet
 http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp
 TI Workshop document
 http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp
 IAR Workbench Tutorial
 http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp
CPE/EE 421/521 Microcomputers 13
MSP 430 Modular Architecture
CPE/EE 421/521 Microcomputers 14
CPU Introduction
 RISC architecture with 27 instructions and 7 addressing modes.
 Orthogonal architecture with every instruction usable with every
 addressing mode.
 Full register access including program counter, status registers,
and stack pointer.
 Single-cycle register operations.
 Large 16-bit register file reduces fetches to memory.
 16-bit address bus allows direct access and branching throughout
entire memory range.
 16-bit data bus allows direct manipulation of word-wide arguments.
 Constant generator provides six most used immediate values and
reduces code size.
 Direct memory-to-memory transfers without intermediate register
holding.
 Word and byte addressing and instruction formats.
CPE/EE 421/521 Microcomputers 15
MSP430 16-bit RISC
 Large 16-bit register file
eliminates single
accumulator bottleneck
 High-bandwidth 16-bit data
and address bus with no
paging
 RISC architecture with 27
instructions and 7
addressing modes
 Single-cycle register
operations with full-access
 Direct memory-memory
transfer designed for
modern programming
 Compact silicon 30%
smaller than an ‘8051 saves
power and cost
CPE/EE 421/521 Microcomputers 16
CPU Registers
CPE/EE 421/521 Microcomputers 17
Registers: PC (R0)
 Each instruction uses
an even number of bytes (2, 4, or 6)
 PC is word aligned (the LSB is 0)
MOV #LABEL,PC ; Branch to address LABEL
MOV LABEL,PC ; Branch to address contained in LABEL
MOV @R14,PC ; Branch indirect, indirect R14
CPE/EE 421/521 Microcomputers 18
Registers: SP (R1)
 Stack pointer for return addresses of
subroutines and interrupts
 SP is word aligned (the LSB is 0)
 Pre-decrement/post-increment scheme
MOV 2(SP),R6 ; Item I2 –> R6
MOV R7,0(SP) ; Overwrite TOS with R7
PUSH #0123h ; Put 0123h onto TOS
POP R8 ; R8 = 0123h
CPE/EE 421/521 Microcomputers 19
Registers: SR (R2)
 C: SR(0)
 Z: SR(1)
 N: SR(2)
 GIE (Global interrupt enable): SR(3)
 CPUOff: SR(4)
 OSCOff: SR(5)
 SCG1, SCG0: SR(7), SR(6)
 V: SR(8)
CPE/EE 421/521 Microcomputers 20
Status bits
CPE/EE 421/521 Microcomputers 21
Constant Generators
 As – source register addressing mode in
the instruction word
CPE/EE 421/521 Microcomputers 22
CISC / RISC Instruction Set
CPE/EE 421/521 Microcomputers 23
27 Core RISC Instructions
CPE/EE 421/521 Microcomputers 24
Emulated Instructions
CPE/EE 421/521 Microcomputers 25
51 Total Instructions
CPE/EE 421/521 Microcomputers 26
Double operand instructions
CPE/EE 421/521 Microcomputers 27
Single Operand Instruction
CPE/EE 421/521 Microcomputers 28
Jump Instructions
CPE/EE 421/521 Microcomputers 29
3 Instruction Formats
CPE/EE 421/521 Microcomputers 30
Addressing Modes
CPE/EE 421/521 Microcomputers 31
Register Addressing Mode
CPE/EE 421/521 Microcomputers 32
Register-Indexed
Addressing Mode
CPE/EE 421/521 Microcomputers 33
Symbolic Addressing Mode
CPE/EE 421/521 Microcomputers 34
Absolute Addressing Mode
CPE/EE 421/521 Microcomputers 35
Register Indirect
Addressing Mode
CPE/EE 421/521 Microcomputers 36
Register Indirect
Autoincrement Addressing Mode
CPE/EE 421/521 Microcomputers 37
Immediate Addressing Mode
CPE/EE 421/521 Microcomputers 38
Code Reduction Effect of
Constant Generator
CPE/EE 421/521 Microcomputers 39
Machine Cycles for Format I
Instructions
CPE/EE 421/521 Microcomputers 40
Machine Cycles for
Format II/III Instructions
CPE/EE 421/521 Microcomputers 41
MSP430 Memory Model
CPE/EE 421/521 Microcomputers 42
Memory Organization
CPE/EE 421/521 Microcomputers 43
MSP 430 Architecture: A Closer Look
CPE/EE 421/521 Microcomputers 44
MSPx430x14x Architecture
64 TQFP (The The Thin Quad Flat Pack package
CPE/EE 421/521 Microcomputers 45
Basic Clock System
Basic Clock Module
provides the clocks
for the MSP430
devices
CPE/EE 421/521 Microcomputers 46
Watchdog Timer
WDT module performs a
controlled system restart
after a software problem
occurs
• Can serve as an interval timer
(generates interrupts)
• WDT Control register is
password protected
• Note: Powers-up active
CPE/EE 421/521 Microcomputers 47
Timer_A
Timer_A is a 16-bit
timer/counter with three
capture/compare registers
• Capture external signals
• Compare PWM mode
• SCCI latch for
asynchronous
communication
CPE/EE 421/521 Microcomputers 48
Comparator_A
Comparator_A is an analog
voltage comparator
• Supports precision slope
analog-to-digital
conversions
• Supply voltage
supervision, and
• Monitoring of external
analog signals.
CPE/EE 421/521 Microcomputers 49
Digital I/O
Independently programmable
individual I/Os
• Up to 6 ports (P1 – P6)
• Each has 8 I/O pins
• Each pin can be
configured as input or
output
• P1 and P2 pins can be
configured to assert an
interrupt request
01234567
P1.
P6.
P2.
Input Register PxIN
Output Register PxOUT
Direction Register PxDIR
Interrupt Flag Register PxIFG
Interrupt Enable Register PxIE
Interrupt Edge Select Register PxIES
Function Select Register PxSEL
P3.
P5.
Port1
Port2
Port3
Port6
yes yes
yes no
yes no
yes no
yesyes
yesyes
yesyes
P4.
…
CPE/EE 421/521 Microcomputers 50
ADC12
High-performance 12-bit
analog-to-digital converter
• More than 200 Ksamples/sec
• Programmable sample&
hold
• 8 external input channels
• Internal storage
CPE/EE 421/521 Microcomputers 51
USART Serial Port
The universal synchronous/
asynchronous receive/transmit
(USART) peripheral interface
supports two serial modes with
one hardware module
• UART or SPI (Synchronous
Peripheral Interface) modes
• Double-buffered
• Baud-rate generator
CPE/EE 421/521 Microcomputers 52
Getting Started with EasyWeb2
CPE/EE 421/521 Microcomputers 53
Getting Started with EasyWeb2
//********************************************
// MSP-FET430P140 Demo - Software Toggle P2.1
//
// Description; Toggle P2.1 by xor'ing P2.1
// inside of a software loop.
// ACLK = n/a, MCLK = SMCLK = default DCO ~
800k
//
// MSP430F149
// -----------------
// /|| XIN|-
// | | |
// --|RST XOUT|-
// | |
// | P2.1|-->LED
//
// M. Buccini
// Texas Instruments, Inc
// January 2002
// Built with IAR Embedded Workbench Version:
1.25A
//
// @Alex Milenkovich, milenkovic@computer.org
// The University of Alabama in Huntsville
// February 2005
// Modified for easyWeb2 board to blink
// the Status led (port P2.1)
//********************************************
#include <msp430x14x.h>
void main(void)
{
// Stop watchdog timer
WDTCTL = WDTPW + WDTHOLD;
P2DIR |= 0x02; // Set P2.1 to output direction
for (;;)
{
unsigned int i;
// Toggle P2.1 using exclusive-OR
P2OUT ^= 0x02;
i = 50000; // Delay
do (i--);
while (i != 0);
}
}

More Related Content

What's hot

Block diagram of msp430x5xx
Block diagram of msp430x5xxBlock diagram of msp430x5xx
Block diagram of msp430x5xxRAMYASREEKUPPALA
 
Features of ATMEL microcontrollers
Features of ATMEL microcontrollersFeatures of ATMEL microcontrollers
Features of ATMEL microcontrollersSuraj Shandilya
 
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS ToolsCodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Toolsdjerrybellott
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERsravannunna24
 
Introduction to microcontrollers
Introduction to microcontrollersIntroduction to microcontrollers
Introduction to microcontrollersCorrado Santoro
 
Atmel and pic microcontroller
Atmel and pic microcontrollerAtmel and pic microcontroller
Atmel and pic microcontrollerTearsome Llantada
 
The 8051 Microcontroller and Embedded Systems
The 8051 Microcontroller and Embedded SystemsThe 8051 Microcontroller and Embedded Systems
The 8051 Microcontroller and Embedded SystemsAvijeet Negel
 
AVR Microcontroller
AVR MicrocontrollerAVR Microcontroller
AVR MicrocontrollerÖzcan Acar
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller featuresTech_MX
 

What's hot (20)

Block diagram of msp430x5xx
Block diagram of msp430x5xxBlock diagram of msp430x5xx
Block diagram of msp430x5xx
 
Features of ATMEL microcontrollers
Features of ATMEL microcontrollersFeatures of ATMEL microcontrollers
Features of ATMEL microcontrollers
 
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS ToolsCodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
CodeWarrior, Linux; OrCad and Hyperlynx; QMS Tools
 
Seminar
SeminarSeminar
Seminar
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
8 bit microcontrollers
8 bit microcontrollers8 bit microcontrollers
8 bit microcontrollers
 
Introduction to microcontrollers
Introduction to microcontrollersIntroduction to microcontrollers
Introduction to microcontrollers
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
 
89s52 2
89s52 289s52 2
89s52 2
 
Avr and arm
Avr and armAvr and arm
Avr and arm
 
STM32 MCU Family
STM32 MCU FamilySTM32 MCU Family
STM32 MCU Family
 
Doc32059
Doc32059Doc32059
Doc32059
 
32059 sistem
32059 sistem32059 sistem
32059 sistem
 
Atmel and pic microcontroller
Atmel and pic microcontrollerAtmel and pic microcontroller
Atmel and pic microcontroller
 
The 8051 Microcontroller and Embedded Systems
The 8051 Microcontroller and Embedded SystemsThe 8051 Microcontroller and Embedded Systems
The 8051 Microcontroller and Embedded Systems
 
AVR Microcontroller
AVR MicrocontrollerAVR Microcontroller
AVR Microcontroller
 
AVR introduction
AVR introduction AVR introduction
AVR introduction
 
Xmega d4 microcontroller
Xmega d4 microcontrollerXmega d4 microcontroller
Xmega d4 microcontroller
 
1 Day Arm 2007
1 Day Arm 20071 Day Arm 2007
1 Day Arm 2007
 
8051 microcontroller features
8051 microcontroller features8051 microcontroller features
8051 microcontroller features
 

Similar to 3 embedded gr_ppapag_msp430_arch

03 Mcu Day 2009 (C2000) 8 13 Editado
03   Mcu Day 2009 (C2000) 8 13   Editado03   Mcu Day 2009 (C2000) 8 13   Editado
03 Mcu Day 2009 (C2000) 8 13 EditadoTexas Instruments
 
VJITSk 6713 user manual
VJITSk 6713 user manualVJITSk 6713 user manual
VJITSk 6713 user manualkot seelam
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080Vivek Venugopal
 
An Overview of LPC2101/02/03
An Overview of LPC2101/02/03An Overview of LPC2101/02/03
An Overview of LPC2101/02/03Premier Farnell
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.pptAakashRawat35
 
PIC32MX Microcontroller Family
PIC32MX Microcontroller FamilyPIC32MX Microcontroller Family
PIC32MX Microcontroller FamilyPremier Farnell
 
Overview of LPC213x MCUs
Overview of LPC213x MCUsOverview of LPC213x MCUs
Overview of LPC213x MCUsPremier Farnell
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advancedImran Sheikh
 
Overview of ST7 8-bit Microcontrollers
Overview of ST7 8-bit MicrocontrollersOverview of ST7 8-bit Microcontrollers
Overview of ST7 8-bit MicrocontrollersPremier Farnell
 
embedded system introduction to microcontrollers
embedded system introduction to microcontrollersembedded system introduction to microcontrollers
embedded system introduction to microcontrollersBarER4
 
esp32_datasheet_en.pdf
esp32_datasheet_en.pdfesp32_datasheet_en.pdf
esp32_datasheet_en.pdfNguynTun714731
 
Introduction of 16-Bit Automotive Microcontrollers S12XE
Introduction of 16-Bit Automotive Microcontrollers S12XEIntroduction of 16-Bit Automotive Microcontrollers S12XE
Introduction of 16-Bit Automotive Microcontrollers S12XEPremier Farnell
 
PIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash Microcontrollers
PIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash MicrocontrollersPIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash Microcontrollers
PIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash MicrocontrollersPremier Farnell
 
PIC18F2XK20/4XK20 8-Bit Microcontroller Family
PIC18F2XK20/4XK20 8-Bit Microcontroller FamilyPIC18F2XK20/4XK20 8-Bit Microcontroller Family
PIC18F2XK20/4XK20 8-Bit Microcontroller FamilyPremier Farnell
 
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyScaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyShivaprasad Tilekar
 

Similar to 3 embedded gr_ppapag_msp430_arch (20)

03 Mcu Day 2009 (C2000) 8 13 Editado
03   Mcu Day 2009 (C2000) 8 13   Editado03   Mcu Day 2009 (C2000) 8 13   Editado
03 Mcu Day 2009 (C2000) 8 13 Editado
 
VJITSk 6713 user manual
VJITSk 6713 user manualVJITSk 6713 user manual
VJITSk 6713 user manual
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
 
An Overview of LPC2101/02/03
An Overview of LPC2101/02/03An Overview of LPC2101/02/03
An Overview of LPC2101/02/03
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
 
PIC32MX Microcontroller Family
PIC32MX Microcontroller FamilyPIC32MX Microcontroller Family
PIC32MX Microcontroller Family
 
2 unit-es-printed
2 unit-es-printed2 unit-es-printed
2 unit-es-printed
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 
XMC4000 Brochure | Infineon Technologies
XMC4000 Brochure | Infineon TechnologiesXMC4000 Brochure | Infineon Technologies
XMC4000 Brochure | Infineon Technologies
 
Overview of LPC213x MCUs
Overview of LPC213x MCUsOverview of LPC213x MCUs
Overview of LPC213x MCUs
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
Overview of ST7 8-bit Microcontrollers
Overview of ST7 8-bit MicrocontrollersOverview of ST7 8-bit Microcontrollers
Overview of ST7 8-bit Microcontrollers
 
embedded system introduction to microcontrollers
embedded system introduction to microcontrollersembedded system introduction to microcontrollers
embedded system introduction to microcontrollers
 
esp32_datasheet_en.pdf
esp32_datasheet_en.pdfesp32_datasheet_en.pdf
esp32_datasheet_en.pdf
 
Introduction of 16-Bit Automotive Microcontrollers S12XE
Introduction of 16-Bit Automotive Microcontrollers S12XEIntroduction of 16-Bit Automotive Microcontrollers S12XE
Introduction of 16-Bit Automotive Microcontrollers S12XE
 
PIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash Microcontrollers
PIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash MicrocontrollersPIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash Microcontrollers
PIC32MX5XX/6XX/7XX USB, CAN and Ethernet 32-Bit Flash Microcontrollers
 
Assignment
AssignmentAssignment
Assignment
 
PIC18F2XK20/4XK20 8-Bit Microcontroller Family
PIC18F2XK20/4XK20 8-Bit Microcontroller FamilyPIC18F2XK20/4XK20 8-Bit Microcontroller Family
PIC18F2XK20/4XK20 8-Bit Microcontroller Family
 
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyScaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
 
Practica 2
Practica 2Practica 2
Practica 2
 

3 embedded gr_ppapag_msp430_arch

  • 1. CPE/EE 421 Microcomputers: The MSP430 Introduction Instructor: Dr Aleksandar Milenkovic Lecture Notes
  • 2. CPE/EE 421/521 Microcomputers 2 Outline MSP430: An Introduction  The MSP430 family  Technology Roadmap  Typical Applications  The MSP430 Documentation  MSP430 Architecture  MSP430 Devices  Getting Started with EasyWeb2  MSP430 RISC core
  • 3. CPE/EE 421/521 Microcomputers 3 The Family  Broad family of TI’s 16-bit microcontrollers  from 1Kbytes ROM, 128 bytes RAM (approx. $1 )  to 60Kbytes ROM, 10Kbytes RAM ( $10)  Three subfamilies  MSP430x1xx: basic unit  MSP430x3xx: more features  MSP430x4xx: built-in LCD driver
  • 4. CPE/EE 421/521 Microcomputers 4 Part numbering convention  MSP430MtFaFbMc  Mt : Memory type  C – ROM, F – Flash, P – OTP, E – EPROM  Fa,Fb  10, 11 – basic  12, 13 – HW UART  14 – HW UART, HW multiplier  31, 32 – LCD Controller  33 – LCD controller, HW UART, HW multiplier  41 – LCD controller  43 - LCD controller, HW UART  44 - LCD controller, HW UART, HW multiplier
  • 5. CPE/EE 421/521 Microcomputers 5 Part numbering convention  MSP430MtFaFbMc  Mc : Memory capacity  0: 1 Kb ROM, 128 b RAM  1: 2 KB ROM, 128 b RAM  2: 4 KB ROM, 256 b RAM  ....  9: 60 KB ROM, 2 Kb RAM
  • 6. CPE/EE 421/521 Microcomputers 6 MSP 430 Roadmap
  • 7. CPE/EE 421/521 Microcomputers 7 Handheld Measurement  Air Flow measurement  Alcohol meter  Barometer  Data loggers  Emission/Gas analyser  Humidity measurement  Temperature measurement  Weight scales Medical Instruments  Blood pressure meter  Blood sugar meter  Breath measurement  EKG system Home environment  Air conditioning  Control unit  Thermostat  Boiler control  Shutter control  Irrigation system  White goods (Washing machine,..) Misc  Smart card reader  Taxi meter  Smart Batteries Utility Metering  Gas Meter  Water Meter  Heat Volume Counter  Heat Cost Allocation  Electricity Meter  Meter reading system (RF) Sports equipment  Altimeter  Bike computer  Diving watches Security  Glass break sensors  Door control  Smoke/fire/gas detectors MSP430 Typical Applications
  • 8. CPE/EE 421/521 Microcomputers 8An MSP430-Based System LCD Switches RS232 controller Thermistor Analog I/O RS232 2-axes joystick Adj. Vol. Regul. LEDs µC Keypad
  • 9. CPE/EE 421/521 Microcomputers 9  Battery  Microcontroller  TI MSP430F149  8-channel 12-bit AD conv.  Accelerometer  Movement detection  Analog Device ADXL202  Transceiver  LINX 916 MHz Basic WISE Another MSP430-Based System
  • 10. CPE/EE 421/521 Microcomputers 10 Tmote Sky Platform  Texas Instruments 16-bit MSP430F149 microcontroller (2KB RAM, 60KB ROM)  Chipcon 2420, 250kbps, 2.4GHz, IEEE 802.15.4 compliant wireless transceiver with programmable output power  Integrated onboard antenna with 50m range indoors and 125m range outdoors  Integrated humidity, temperature, and light sensors
  • 11. CPE/EE 421/521 Microcomputers 11 Tmote Sky Platform http://www.moteiv.com
  • 12. CPE/EE 421/521 Microcomputers 12 MSP430 Documentation  MSP430 home page (TI)  www.ti.com/msp430  User’s manual (MSP430x1xx Family)  http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp  Datasheet  http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp  TI Workshop document  http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp  IAR Workbench Tutorial  http://www.ece.uah.edu/~milenka/cpe421-06S/docs/msp
  • 13. CPE/EE 421/521 Microcomputers 13 MSP 430 Modular Architecture
  • 14. CPE/EE 421/521 Microcomputers 14 CPU Introduction  RISC architecture with 27 instructions and 7 addressing modes.  Orthogonal architecture with every instruction usable with every  addressing mode.  Full register access including program counter, status registers, and stack pointer.  Single-cycle register operations.  Large 16-bit register file reduces fetches to memory.  16-bit address bus allows direct access and branching throughout entire memory range.  16-bit data bus allows direct manipulation of word-wide arguments.  Constant generator provides six most used immediate values and reduces code size.  Direct memory-to-memory transfers without intermediate register holding.  Word and byte addressing and instruction formats.
  • 15. CPE/EE 421/521 Microcomputers 15 MSP430 16-bit RISC  Large 16-bit register file eliminates single accumulator bottleneck  High-bandwidth 16-bit data and address bus with no paging  RISC architecture with 27 instructions and 7 addressing modes  Single-cycle register operations with full-access  Direct memory-memory transfer designed for modern programming  Compact silicon 30% smaller than an ‘8051 saves power and cost
  • 16. CPE/EE 421/521 Microcomputers 16 CPU Registers
  • 17. CPE/EE 421/521 Microcomputers 17 Registers: PC (R0)  Each instruction uses an even number of bytes (2, 4, or 6)  PC is word aligned (the LSB is 0) MOV #LABEL,PC ; Branch to address LABEL MOV LABEL,PC ; Branch to address contained in LABEL MOV @R14,PC ; Branch indirect, indirect R14
  • 18. CPE/EE 421/521 Microcomputers 18 Registers: SP (R1)  Stack pointer for return addresses of subroutines and interrupts  SP is word aligned (the LSB is 0)  Pre-decrement/post-increment scheme MOV 2(SP),R6 ; Item I2 –> R6 MOV R7,0(SP) ; Overwrite TOS with R7 PUSH #0123h ; Put 0123h onto TOS POP R8 ; R8 = 0123h
  • 19. CPE/EE 421/521 Microcomputers 19 Registers: SR (R2)  C: SR(0)  Z: SR(1)  N: SR(2)  GIE (Global interrupt enable): SR(3)  CPUOff: SR(4)  OSCOff: SR(5)  SCG1, SCG0: SR(7), SR(6)  V: SR(8)
  • 21. CPE/EE 421/521 Microcomputers 21 Constant Generators  As – source register addressing mode in the instruction word
  • 22. CPE/EE 421/521 Microcomputers 22 CISC / RISC Instruction Set
  • 23. CPE/EE 421/521 Microcomputers 23 27 Core RISC Instructions
  • 24. CPE/EE 421/521 Microcomputers 24 Emulated Instructions
  • 25. CPE/EE 421/521 Microcomputers 25 51 Total Instructions
  • 26. CPE/EE 421/521 Microcomputers 26 Double operand instructions
  • 27. CPE/EE 421/521 Microcomputers 27 Single Operand Instruction
  • 28. CPE/EE 421/521 Microcomputers 28 Jump Instructions
  • 29. CPE/EE 421/521 Microcomputers 29 3 Instruction Formats
  • 30. CPE/EE 421/521 Microcomputers 30 Addressing Modes
  • 31. CPE/EE 421/521 Microcomputers 31 Register Addressing Mode
  • 32. CPE/EE 421/521 Microcomputers 32 Register-Indexed Addressing Mode
  • 33. CPE/EE 421/521 Microcomputers 33 Symbolic Addressing Mode
  • 34. CPE/EE 421/521 Microcomputers 34 Absolute Addressing Mode
  • 35. CPE/EE 421/521 Microcomputers 35 Register Indirect Addressing Mode
  • 36. CPE/EE 421/521 Microcomputers 36 Register Indirect Autoincrement Addressing Mode
  • 37. CPE/EE 421/521 Microcomputers 37 Immediate Addressing Mode
  • 38. CPE/EE 421/521 Microcomputers 38 Code Reduction Effect of Constant Generator
  • 39. CPE/EE 421/521 Microcomputers 39 Machine Cycles for Format I Instructions
  • 40. CPE/EE 421/521 Microcomputers 40 Machine Cycles for Format II/III Instructions
  • 41. CPE/EE 421/521 Microcomputers 41 MSP430 Memory Model
  • 42. CPE/EE 421/521 Microcomputers 42 Memory Organization
  • 43. CPE/EE 421/521 Microcomputers 43 MSP 430 Architecture: A Closer Look
  • 44. CPE/EE 421/521 Microcomputers 44 MSPx430x14x Architecture 64 TQFP (The The Thin Quad Flat Pack package
  • 45. CPE/EE 421/521 Microcomputers 45 Basic Clock System Basic Clock Module provides the clocks for the MSP430 devices
  • 46. CPE/EE 421/521 Microcomputers 46 Watchdog Timer WDT module performs a controlled system restart after a software problem occurs • Can serve as an interval timer (generates interrupts) • WDT Control register is password protected • Note: Powers-up active
  • 47. CPE/EE 421/521 Microcomputers 47 Timer_A Timer_A is a 16-bit timer/counter with three capture/compare registers • Capture external signals • Compare PWM mode • SCCI latch for asynchronous communication
  • 48. CPE/EE 421/521 Microcomputers 48 Comparator_A Comparator_A is an analog voltage comparator • Supports precision slope analog-to-digital conversions • Supply voltage supervision, and • Monitoring of external analog signals.
  • 49. CPE/EE 421/521 Microcomputers 49 Digital I/O Independently programmable individual I/Os • Up to 6 ports (P1 – P6) • Each has 8 I/O pins • Each pin can be configured as input or output • P1 and P2 pins can be configured to assert an interrupt request 01234567 P1. P6. P2. Input Register PxIN Output Register PxOUT Direction Register PxDIR Interrupt Flag Register PxIFG Interrupt Enable Register PxIE Interrupt Edge Select Register PxIES Function Select Register PxSEL P3. P5. Port1 Port2 Port3 Port6 yes yes yes no yes no yes no yesyes yesyes yesyes P4. …
  • 50. CPE/EE 421/521 Microcomputers 50 ADC12 High-performance 12-bit analog-to-digital converter • More than 200 Ksamples/sec • Programmable sample& hold • 8 external input channels • Internal storage
  • 51. CPE/EE 421/521 Microcomputers 51 USART Serial Port The universal synchronous/ asynchronous receive/transmit (USART) peripheral interface supports two serial modes with one hardware module • UART or SPI (Synchronous Peripheral Interface) modes • Double-buffered • Baud-rate generator
  • 52. CPE/EE 421/521 Microcomputers 52 Getting Started with EasyWeb2
  • 53. CPE/EE 421/521 Microcomputers 53 Getting Started with EasyWeb2 //******************************************** // MSP-FET430P140 Demo - Software Toggle P2.1 // // Description; Toggle P2.1 by xor'ing P2.1 // inside of a software loop. // ACLK = n/a, MCLK = SMCLK = default DCO ~ 800k // // MSP430F149 // ----------------- // /|| XIN|- // | | | // --|RST XOUT|- // | | // | P2.1|-->LED // // M. Buccini // Texas Instruments, Inc // January 2002 // Built with IAR Embedded Workbench Version: 1.25A // // @Alex Milenkovich, milenkovic@computer.org // The University of Alabama in Huntsville // February 2005 // Modified for easyWeb2 board to blink // the Status led (port P2.1) //******************************************** #include <msp430x14x.h> void main(void) { // Stop watchdog timer WDTCTL = WDTPW + WDTHOLD; P2DIR |= 0x02; // Set P2.1 to output direction for (;;) { unsigned int i; // Toggle P2.1 using exclusive-OR P2OUT ^= 0x02; i = 50000; // Delay do (i--); while (i != 0); } }