Professional Documents
Culture Documents
MSP 430 (Mixed Signal Processor)
MSP 430 (Mixed Signal Processor)
microcontroller
CISC Vs RISC
FEATURES
CISC
RISC
Architecture
Harvard/Von
neumann
Mostly
harvard
Instructions
Simpler
Variable length
Fixed length
Instruction set
Non orthogonal
Orthogonal
GPRs
Limited
Large
Operations
Reg/Mem
Only on reg
Pipeling
No
Yes
Silicon usage
More
less
Von Neumann
It is also called Princeton architecture
It is a single memory system
Only one set of address covers both
the volatile and non-volatile
memories
Less efficient ,several memory cycles
are needed
Simpler system no access difference
between constant and variables
Features of MSP430
The CPU is small and efficient, with a large
number of registers.
It is extremely easy to put the device into a
low-power mode. No special instruction is
needed: The mode is controlled by bits in
the status register. The MSP430 is
awakened by an interrupt and returns
automatically to its low-power mode after
handling the interrupt.
There are several low-power modes,
depending on how much of the device
should remain active and how quickly it
Contd..
There is a wide choice of clocks.
Typically, a low-frequency watch
crystal runs continuously at 32 KHz
and is used to wake the device
periodically. The CPU isclocked by an
internal, digitally controlled oscillator
(DCO), which restarts in less than 1s
in the latest devices. Therefore the
MSP430 can wake from a standby
mode rapidly, perform its tasks, and
Contd..
A wide range of peripherals is
available, many of which can run
autonomously without the CPU for
most of the time.
Many portable devices include liquid
crystal displays, which the MSP430
can drive directly.
Family of MSP430
MSP430x1xx: Provides a wide range of
general-purpose devices from simple
versions to complete systems for processing
signals. Packages have 2064 pins.
MSP430F2xx: A newer, general-purpose
family introduced in 2005. Its CPU can
run at 16 MHz, double the speed of earlier
devices, while consuming only half the
current the same speed. Some come in 14pin packages.
Contd..
MSP430x3xx: The original family,
which includes drivers for LCDs.
It is now obsolescent.
MSP430x4xx: Can drive LCDs
with up to 160 segments. Many
of them are ASSPs, but there are
general-purpose devices as well.
Their packages have 48113 pins,
many of which are needed for the
LCD.
Example
Memory Map
Stack operation
Status register
Constant Generators
Both R2 and R3 are used to provide
the 6 most commonly used constants
This saves storing the values in the
program and having to fetch them
each time
The operation depends on the
addressing modes
Addressing Modes
A key feature of any CPU is its range
of addressing modes
The MSP430 has four basic modes
These modes are made more useful
by the way in which they interact
with the CPUs registers
Addressing Modes
Double operand : Arithmetic and
logical operations with two operands
such as
add.w src, dst
Single operand : A mixture of
instructions
for
control
or
to
manipulate a single operand
Jumps: The jump to the destination
Register Mode
Register mode operations work
directly on the processor registers,R4
through R15, or on special function
registers, such as the
program counter or status register.
They are very efficient in terms of
both instruction speed and code
space
Register Mode
Example 1: Move (copy) the contents of source
(register R4) to destination (register R5). Register R4 is
not affected.
Indexed mode
The Indexed mode commands are
formatted as X(Rn), where X is a
constant and Rn is one of the CPU
registers.
The absolute memory location X+Rn
is addressed.
Indexed mode addressing is useful
for applications such as lookup
tables.
Indexed mode
Example 2: Move (copy) the contents at source
address (F000h +R5) to destination (register R4).
Symbolic mode
Symbolic mode allows the
assignment of labels to fixed memory
locations
so that those locations can be
addressed.
This is useful for the development of
embedded programs
Symbolic mode
Example 3: Move the content of source
address XPT (x pointer) to the destination address
YPT (y pointer).
Immediate mode
Immediate mode is used to assign
constant values to registers or
memory locations
Example 7: Move the immediate constant E2h
to the destination(register R5).
Before operation: R4=A002h R5=050Ah
Operation: MOV #E2h, R5
After operation: R4= A002h R5=00E2h
Absolute mode
Similar to Symbolic mode, with the
difference that the label is preceded by &.
Example 4: Move the content of source address XPT to the
destination address YPT.
Clock Generator
These are the internal clocks, which
are the same in all devices:
Master clock, MCLK, is used by
the CPU and a few peripherals.
Subsystem master clock, SMCLK,
is distributed to peripherals.
Auxiliary clock, ACLK, is also
distributed to peripherals.
Contd..
ACLK comes from a low-frequency
crystal oscillator, typically at 32 KHz.
MCLK and SMCLK are supplied from
the DCO, which is controlled by a
frequency-locked loop (FLL). This
locks the frequency at 32 times the
ACLK frequency, which is close to
1MHz for the usual watch crystal.
Exceptions: Interrupts
and Resets
Interrupts: Usually generated by
hardware (although they can be
initiated by software)
Resets: Again usually generated by
hardware, either when power is applied
or when something catastrophic has
happened and normal operation cannot
continue. A reset causes the device to
(re)start from a well-defined state.
MSP430 Architecture
Flash memory
Most common type of memory
Practical difference between EPROM
and Flash is individual bites of
EPROM can be erased.
Flash can be erased only blocks.
ADC
ADC to processes quantities of the
real world.
Example sound , pressure ,force
Sensors / Actuators
Tools
Simulator
Emulator
JTAG
Software
What is the difference between
writing a program in desktop and
small micro controller
Machine code
Assembly Language
C Language