Professional Documents
Culture Documents
MSP430
3/27/12
Outline
MSP430: An Introduction The MSP430 family Technology Roadmap Typical Applications The MSP430 Documentation MSP430 Architecture MSP430 Devices Getting Started with EasyWeb2
The MSP430 is described as a RISC 3/27/12 processor. utilizing von Neumann architecture.
3/27/12
3/27/12
Superior
Development
Software
For
Students
3/27/12
Windows Style Visual Text Based Development Development Why Switch? Interface Interface
3/27/12
Features
The ability to use different addressing modes for both source and destination is referred to as instruction orthogonality. The MSP430 is considered to be fully orthogonal, since any instruction can effectively use any addressing mode for both source and destination operands. It allows the programmer to write very compact code.
3/27/12
Features
Ultralow-power architecture extends battery life 0.1-A RAM retention 0.8-A real-time clock mode 250-A / MIPS active analog ideal for precision measurement or 10-bit ADC 200 ksps,
High-performance 12-bit
3/27/12
Features
16-bit
RISC CPU enables new applications at a fraction of the code size. register file eliminates working file bottleneck Compact core design reduces power consumption and cost for modern high-level programming
Large
Optimized
3/27/12
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. 16-bit register file reduces fetches to memory. address bus allows direct access
Large
16-bit
3/27/12
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. and byte addressing and instruction formats.
Word
3/27/12
The Family
Broad family of TIs 16-bit microcontrollers from 1Kbytes ROM, 128 bytes RAM to 60Kbytes ROM, 10Kbytes RAM
MSP430x1xx: MSP430x3xx:
MSP430x4xx:built
3/27/12
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
3/27/12
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
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
High-bandwidth
CPU Registers
3/27/12
Registers: PC (R0)
3/27/12
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
3/27/12
Registers: SP (R1)
Stack and
pointer for return addresses of subroutines interrupts SP is word aligned (the LSB is 0)
MOV MOV
R7
3/27/12
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)
3/27/12
Constant Generators
3/27/12
3/27/12
3/27/12
3/27/12
Emulated Instructions
3/27/12
51 Total Instructions
3/27/12
3/27/12
3/27/12
Jump Instructions
3/27/12
3 Instruction Formats
3/27/12
Addressing Modes
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
Memory Organization
3/27/12
3/27/12
MSPx430x14x Architecture
3/27/12
3/27/12
Watchdog Timer
WDT
module performs a
Can serve as an interval timer (generates interrupts) WDT Control register is password protected
3/27/12
Timer_A
Timer_A
is a 16-bit
external
signals
3/27/12
3/27/12
ADC12
High-performance
hold
3/27/12
asynchronous receive/transmit
(USART)
3/27/12
3/27/12
3/27/12
interrupts
Topics to Cover
3/27/12
Interrupts
3/27/12
Execution of a program proceeds predictably, with interrupts being the exception Interrupts are usually generated by hardware Processor stops with it is doing, Stores enough information to later resume,
Interrupts
Interrupt code runs in the foreground
3/27/12
3/27/12
3/27/12
Infrequent tasks to save polling overhead Waking the CPU from sleep Call to an operating system (software
interrupt).
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
Well-written ISRs:
Should be short and fast Should affect the rest of the system as little as possible Require a balance between doing very little thereby leaving the background code
with lots of processing and doing a lot and leaving the background code with nothing to do
3/27/12
Interrupt-related runtime problems can be exceptionally hard to debug Common interrupt-related errors include:
3/27/12
3/27/12
3/27/12
3/27/12
3/27/12
Often, the most important factor for reducing power consumption is slowing the clock down
Faster clock = Higher performance,
3/27/12
3/27/12
3/27/12
3/27/12
timers
System timing is fundamental for real-time applications The MSP430F2274 has 3 timers, namely Watchdog, Timer_A, and Timer_B Timer_A and Timer_B may be triggered by internal or external clocks Timer_A and Timer_B also include multiple
3/27/12
Timer Applications
3/27/12
3/27/12
3/27/12
Pulse width modulation (PWM) is used to control analog circuits with a processor's digital outputs PWM is a technique of digitally encoding analog signal levels The duty cycle of a square wave is modulated to encode a specific analog signal level
3/27/12
Watchdog Timer
3/27/12
The primary function of the watchdog timer (WDT+) module is to perform a controlled system restart after a software problem occurs. After a power-up cycle (PUC), the WDT+ module is automatically configured in watchdog mode with an initial 32768 clock cycle reset interval using the DCOCLK.
Access to WDT+ control register is password protected Control of RST/NMI pin function Selectable clock source (SMCLK or ACLK) Four software-selectable time intervals SMCLK: 32, 8, 0.5, 0.064 ms (1 MHz) ACLK: 1000, 250, 16, 1.9 ms (32Khz) Can be stopped to conserve power