This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these messages)
|
Designer | Texas Instruments |
---|---|
Bits | 16-bit |
Introduced | 14 February 1992 |
Type | Memory-Memory |
Endianness | little endian |
Extensions | MSP430X |
Registers | |
16 registers, R0 – Program Counter, R1 – Stack Pointer, R2 – Status Register, R2/R3 – Constant Generator, R4 through R15 are general purpose |
The MSP430 is a mixed-signal microcontroller family from Texas Instruments, first introduced on 14 February 1992. [1] Built around a 16-bit CPU, the MSP430 was designed for low power consumption, [2] embedded applications and low cost.
The fundamental feature of the MSP430 is low power consumption. The first MSP430s (MSP430C3xx) had a consumption around 400 uA/MHz and less than 2 uA in low-power mode with active basic timer and LCD driver. The more recent MSPs (MSP430FR5xx) have active mode consumption around 100-120 uA/MHz and 500 nA in low-power mode with active RTC. The consumption of the CPU itself is less than 32 uA/MHz. [3] The MSP430FR series, which use FRAM instead of a flash, also allow fast writing to a non-volatile memory without additional power requirements.
The MSP430s use up to seven different low-power modes. The wake-up times differ on the mode and MSP430 generation. The fastest MSP430-family processors have wake-up times under 1 microsecond.
The MSP430s can run up to 25 MHz, while register-to-register operations take 1 cycle per instruction. The MSP430 family has more than 550 types, [4] not counted package variants. There are microcontrollers with 0.5-512 kB flash or 0.5-256 kB FRAM and up to 66 kB RAM.
The device comes in a variety of generations featuring the usual peripherals:
Some less usual peripheral options include on-chip operational amplifiers (op-amp) for signal conditioning, 12-bit digital-to-analog converter (DAC), liquid crystal display (LCD) driver, hardware multiplier, USB, and direct memory access (DMA) for ADC results. Apart from some older erasable programmable read-only memory (EPROM, such as MSP430E3xx) and high volume mask ROM (MSP430Cxxx) versions, all of the devices are in-system programming enabled via Joint Test Action Group (JTAG), full four-wire or Spy-Bi-Wire), a built in bootstrapping loader (BSL) using UART such as RS-232, or USB on devices with USB support. No BSL is included in F20xx, G2xx0, G2xx1, G2xx2, or I20xx family devices.
There are, however, limits that preclude its use in more complex embedded systems. The MSP430 does not have an external memory bus, so it is limited to on-chip memory, up to 512 KB flash memory and 66 KB random-access memory (RAM), which may be too small for applications needing large buffers or data tables. Also, although it has a DMA controller, it is very difficult to use it to move data off the chip due to a lack of a DMA output strobe. [6]
Six general generations of MSP430 processors exist. In order of development, they are: '3xx generation, '1xx generation, '4xx generation, '2xx generation, '5xx generation, and '6xx generation. The digit after the generation identifies the model (generally higher model numbers are larger and more capable), the third digit identifies the amount of memory included, and the fourth, if present, identifies a minor model variant. The most common variation is a different on-chip analog-to-digital converter.
The 3xx and 1xx generations are limited to a 16-bit address space. In the later generations this was expanded to include '430X' instructions that allow a 20-bit address space. As happened with other processor architectures (e.g. the processor of the PDP-11), extending the addressing range beyond the 16-bit word size introduced some peculiarities and inefficiencies for programs larger than 64 KB.
In the following list, it helps to think of the typical 200 mA·Hr capacity of a CR2032 lithium coin cell as 200,000 μA·Hr, or 22.8 μA·year. Thus, considering only the CPU draw, such a battery could supply a 0.7 μA current draw for 32 years. (In reality, battery self-discharge would reduce this number.)
The significance of the RAM retention vs the real-time clock mode is that in real time clock mode the CPU can go to sleep with a clock running which will wake it up at a specified future time. In RAM retention mode, some external signal is required to wake it, e.g., input/output (I/O) pin signal or SPI slave receive interrupt.
The MSP430x1xx Series is the first generation with flash memory. They are generally more capable than the '3xx generation, but without an embedded LCD controller. These flash- or ROM-based ultra-low-power MCUs offer 8 MIPS, 1.8–3.6 V operation, up to 60 KB flash, and a wide range of analog and digital peripherals.
The MSP430F2xx Series are similar to the '1xx generation, but operate at even lower power, support up to 16 MHz operation, and have a more accurate (±2%) on-chip clock that makes it easier to operate without an external crystal. These flash-based ultra-low power devices offer 1.8–3.6 V operations. It includes the very-low power oscillator (VLO), internal pull-up/pull-down resistors, and low-pin count options.
The MSP430G2xx Value Series features flash-based Ultra-Low Power MCUs up to 16 MIPS with 1.8–3.6 V operation. It includes the Very-Low power Oscillator (VLO), internal pull-up/pull-down resistors, and low-pin count options at lower prices than the MSP430F2xx series.
The MSP430x3xx Series is the oldest generation, released between 1995 and 1998. [7] The MSP430 was designed as a successor to TSS400 for battery-powered metering instruments. [8] All MSP430x3xx had an embedded LCD controller and also a digital controlled oscillator (DCO) with frequency-locked loop (FLL) which provided a stable system clock (1 to 4 MHz) using a low-frequency crystal (32 kHz). [9] This generation does not support EEPROM memory, only mask ROM and UV-eraseable and one-time programmable EPROM. Later generations provide only flash memory and mask ROM options. These devices offer 2.5–5.5 V operation, up to 32 KB ROM.
The MSP430x4xx Series are similar to the '1xx generation, but include an integrated LCD controller, and are larger and often more capable. These flash or ROM based devices offers 8–16 MIPS at 1.8–3.6 V operation, with FLL, and SVS. Ideal for low power metering and medical applications.
The MSP430x5xx Series are able to run up to 25 MHz, have up to 512 KB flash memory and up to 66 KB RAM. This flash-based family features low active power consumption with up to 25 MIPS at 1.8–3.6 V operation (165 uA/MIPS). Includes an innovative power management module for optimal power consumption and integrated USB. [10]
The MSP430x6xx Series are able to run up to 25 MHz, have up to 512 KB flash memory and up to 66 KB RAM. This flash-based family features low active power consumption with up to 25 MIPS at 1.8–3.6 V operation (165 uA/MIPS). Includes an innovative power management module for optimal power consumption and integrated USB. Many 6xx series devices are pin-compatible with an analogous 5xx series device except that the 6xx device adds USB support.
The RF SoC (CC430) Series provides tight integration between the microcontroller core, peripherals, software, and RF transceiver. Features <1 GHz RF transceiver, with 1.8 V–3.6 V operation. Programming using Arduino integrated development environment (IDE) is possible via the panStamp API.
The FRAM Series from Texas Instruments provides unified memory with dynamic partitioning and memory write speeds 100 times faster than flash. FRAM is also capable of zero power state retention in all power modes, which means that writes are guaranteed, even in the event of a power loss. With a write endurance of over 100 trillion cycles, EEPROM is no longer required. Active power consumption at less than 100 μA/MHz.
The Low Voltage Series include the MSP430C09x and MSP430L092 parts, capable of running at 0.9 V. These 2 series of low voltage 16-bit microcontrollers have configurations with two 16-bit timers, an 8-bit analog-to-digital (A/D) converter, an 8-bit digital-to-analog (D/A) converter, and up to 11 I/O pins.
More families within MSP430 include Fixed Function, Automotive, and Extended Temp parts.
Fixed Function: The MSP430BQ1010 16-bit microcontroller is an advanced fixed-function device that forms the control and communications unit on the receiver side for wireless power transfer in portable applications. MSP430BQ1010 complies with the Wireless Power Consortium (WPC) specification. For more information, see Contactless Power [ permanent dead link ].
Automotive: Automotive MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-based, mixed-signal processors that are AEC-Q100 qualified and suitable for automotive applications in environments up to 105 °C ambient temperature. LIN compliant drivers for the MSP430 MCU provided by IHR GmbH.
Extended Temp: MSP430 devices are very popular in harsh environments such as industrial sensing for their low power consumption and innovative analog integration. Some harsh environment applications include transportation/automotive, renewable energy, military/space/avionics, mineral exploration, industrial, and safety & security.
Note that when the flash size is over 64K words (128 KBytes), instruction addresses can no longer be encoded in just two bytes. This change in pointer size causes some incompatibilities with previous parts.
The MSP430 peripherals are generally easy to use, with (mostly) consistent addresses between models, and no write-only registers (except for the hardware multiplier).
If the peripheral is not needed, the pin may be used for general purpose I/O. The pins are divided into 8-bit groups called "ports", each of which is controlled by a number of 8-bit registers. In some cases, the ports are arranged in pairs which can be accessed as 16-bit registers.
The MSP430 family defines 11 I/O ports, P0 through P10, although no chip implements more than 10 of them. P0 is only implemented on the '3xx family. P7 through P10 are only implemented on the largest members (and highest pin count versions) of the '4xx and '2xx families. The newest '5xx and '6xx families has P1 through P11, and the control registers are reassigned to provide more port pairs. Each port is controlled by the following registers. Ports which do not implement particular features (such as interrupt on state change) do not implement the corresponding registers.
Ports 0–2 can produce interrupts when inputs change. Further registers configure this ability:
Some pins have special purposes either as inputs or outputs. (For example, timer pins can be configured as capture inputs or PWM outputs.) In this case, the PxDIR bit controls which of the two functions the pin performs when the PxSEL bit is set. If there is only one special function, then PxDIR is generally ignored. The PxIN register is still readable if the PxSEL bit is set, but interrupt generation is disabled. If PxSEL is clear, the special function's input is frozen and disconnected from the external pin. Also, configuring a pin for general purpose output does not disable interrupt generation.
|
|
Address | Name | Function |
---|---|---|
0x130 | MPY | Operand1 for unsigned multiply |
0x132 | MPYS | Operand1 for signed multiply |
0x134 | MAC | Operand1 for unsigned multiply-accumulate |
0x136 | MACS | Operand1 for signed multiply-accumulate |
0x138 | OP2 | Second operand for multiply operation |
0x13A | ResLo | Low word of multiply result |
0x13C | ResHi | High word of multiply result |
0x13E | SumExt | Carry out of multiply-accumulate |
ResLo
and ResHi
registers must also be initialized.OP2
register, a multiply is performed and the result stored or added to the result registers. The SumExt
register is a read-only register that contains the carry out of the addition (0 or 1) in case of an unsigned multiply), or the sign extension of the 32-bit sum (0 or -1) in case of a signed multiply. In the case of a signed multiply-accumulate, the SumExt
value must be combined with the most significant bit of the prior SumHi
contents to determine the true carry out result (-1, 0, or +1).Texas Instruments provides various hardware experimenter boards that support large (approximately two centimeters square) and small (approximately one millimeter square) MSP430 chips. TI also provides software development tools, both directly, and in conjunction with partners (see the full list of compilers, assemblers, and IDEs). One such toolchain is the IAR C/C++ compiler and Integrated development environment , or IDE. A Kickstart edition can be downloaded for free from TI or IAR; it is limited to 8 KB of C/C++ code in the compiler and debugger (assembly language programs of any size can be developed and debugged with this free toolchain).
TI also combines a version of its own compiler and tools with its Eclipse-based Code Composer Studio IDE (CCS). It sells full-featured versions, and offers a free version for download which has a code size limit of 16 KB. CCS supports in-circuit emulators, and includes a simulator and other tools; it can also work with other processors sold by TI.
For those who are more comfortable with the Arduino, there is also another software Energia, an open source electronics prototyping platform with the goal to bring the Wiring and Arduino framework to the Texas Instruments MSP430 based LaunchPad where Arduino code can be exported for programming MSP430 chips. The latest release of Energia supports the MSP-EXP430G2xxx, MSP-EXP430FR5739, MSP-EXP430FR5969, MSP-EXP430FR5994, MSP-EXP430F5529LP, Stellaris EK-LM4F120XL, Tiva-C EK-TM4C123GXL, Tiva-C EK-TM4C1294XL, CC3200 Wi-Fi LaunchPad. [12]
The open source community produces a freely available software development toolset based on the GNU toolset. The GNU compiler is currently declined in three versions:
(MSPGCC)
TI consulted with RedHat to provide official support for the MSP430 architecture to the GNU Compiler Collection C/C++ compiler. This msp430-elf-gcc compiler is supported by TI's Code Composer Studio version 6.0 and higher.
There is a very early llvm-msp430 project, which may eventually provide better support for MSP430 in LLVM.
Other commercial development tool sets, which include editor, compiler, linker, assembler, debugger and in some cases code wizards, are available. VisSim, a block diagram language for model based development, generates efficient fixed point C-Code directly from the diagram. [13] VisSim generated code for a closed loop ADC+PWM based PID control on the F2013 compiles to less than 1 KB flash and 100 bytes RAM. [14] VisSim has on-chip peripheral blocks for the entire MSP430 family I²C, ADC, SD16, PWM.
The MSP430F2013 and its siblings are set apart by the fact that (except for the MSP430G2 Value Line) it is the only MSP430 part that is available in a dual in-line package (DIP). Other variants in this family are only available in various surface-mount packages. TI has gone to some trouble to support the eZ430 development platform by making the raw chips easy for hobbyists to use in prototypes.
TI has tackled the low-budget problem by offering a very small experimenter board, the eZ430-F2013, on a USB stick (now obsolete). This made it easy for designers to choose the MSP430 chip for inexpensive development platforms that can be used with a computer. The eZ430-F2013 contains an MSP430F2013 microcontroller on a detachable prototyping board, and accompanying CD with development software. It is helpful[ citation needed ] for schools, hobbyists and garage inventors. It is also welcomed[ citation needed ] by engineers in large companies prototyping projects with capital budget problems.
Texas Instruments released the MSP430 LaunchPad in July 2010 at a cost of $4.30. The MSP430 LaunchPad has an onboard flash emulator, USB, 2 programmable LEDs, and 1 programmable push button. [15] As an addition to experimentation with the LaunchPad a shield board is available.
TI has since provided several new LaunchPads based on the MSP430 platform:
All three of these LaunchPads include an eZ-FET JTAG debugger with backchannel UART capable of 1 Mbit/s speeds. The FRAM LaunchPads (e.g. MSP-EXP430FR5969, MSP-EXP430FR4133) include EnergyTrace, a feature supported by TI's Code Composer Studio IDE for monitoring and analyzing power consumption.
In common with other microcontroller vendors, TI has developed a two-wire debugging interface found on some of their MSP430 parts that can replace the larger JTAG interface. The eZ430 Development Tool contains a full USB-connected flash emulation tool (FET) for this new two-wire protocol, named Spy-Bi-Wire by TI. Spy-Bi-Wire was initially introduced on only the smallest devices in the 'F2xx family with limited number of I/O pins, such as the MSP430F20xx, MSP430F21x2, and MSP430F22x2. The support for Spy-Bi-Wire has been expanded with the introduction of the latest '5xx family, where all devices have support Spy-Bi-Wire interface in addition to JTAG.
The advantage of the Spy-Bi-Wire protocol is that it uses only two communication lines, one of which is the dedicated _RESET line. The JTAG interface on the lower pin count MSP430 parts is multiplexed with general purpose I/O lines. This makes it relatively difficult to debug circuits built around the small, low-I/O-budget chips, since the full 4-pin JTAG hardware will conflict with anything else connected to those I/O lines. This problem is alleviated with the Spy-Bi-Wire-capable chips, which are still compatible with the normal JTAG interface for backwards compatibility with the old development tools.
JTAG debugging and flash programming tools based on OpenOCD and widely used in the ARM architecture community are not available for the MSP430. Programming tools specially designed for the MSP430 are marginally less expensive than JTAG interfaces that use OpenOCD. However, should it be discovered mid-project that more MIPS, more memory, and more I/O peripherals are needed, those tools will not transfer to a processor from another vendor.
The MSP430 CPU uses a von Neumann architecture, with a single address space for instructions and data. Memory is byte-addressed, and pairs of bytes are combined little-endian to make 16-bit words.
The processor contains 16 16-bit registers, [16] of which four are dedicated to special purposes: R0 is the program counter, R1 is the stack pointer, R2 is the status register, and R3 is a "constant generator" which reads as zero and ignores writes. Added address mode encodings using R3 and R2 allow a total of six commonly used constant values (0, 1, 2, 4, 8 and −1) without needing an immediate operand word. R4 through R15 are available for general use.
The instruction set is very simple: 27 instructions exist in three families. Most instructions occur in .B (8-bit byte) and .W (16-bit word) suffixed versions, depending on the value of a B/W bit: the bit is set to 1 for 8-bit and 0 for 16-bit. A missing suffix is equivalent to .W. Byte operations to memory affect only the addressed byte, while byte operations to registers clear the most significant byte.
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Instruction |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 0 | 0 | opcode | B/W | As | register | Single-operand arithmetic | ||||||
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | B/W | As | register | RRC Rotate right (1 bit) through carry | ||||
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | As | register | SWPB Swap bytes | ||||
0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | B/W | As | register | RRA Rotate right (1 bit) arithmetic | ||||
0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | As | register | SXT Sign extend byte to word | ||||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | B/W | As | register | PUSH Push value onto stack | ||||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | As | register | CALL Subroutine call; push PC and move source to PC | ||||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | RETI Return from interrupt; pop SR then pop PC |
0 | 0 | 1 | condition | 10-bit signed offset | Conditional jump; PC = PC + 2×offset + 2 | |||||||||||
0 | 0 | 1 | 0 | 0 | 0 | 10-bit signed offset | JNE/JNZ Jump if not equal/zero | |||||||||
0 | 0 | 1 | 0 | 0 | 1 | 10-bit signed offset | JEQ/JZ Jump if equal/zero | |||||||||
0 | 0 | 1 | 0 | 1 | 0 | 10-bit signed offset | JNC/JLO Jump if no carry/lower | |||||||||
0 | 0 | 1 | 0 | 1 | 1 | 10-bit signed offset | JC/JHS Jump if carry/higher or same | |||||||||
0 | 0 | 1 | 1 | 0 | 0 | 10-bit signed offset | JN Jump if negative | |||||||||
0 | 0 | 1 | 1 | 0 | 1 | 10-bit signed offset | JGE Jump if greater or equal | |||||||||
0 | 0 | 1 | 1 | 1 | 0 | 10-bit signed offset | JL Jump if less | |||||||||
0 | 0 | 1 | 1 | 1 | 1 | 10-bit signed offset | JMP Jump (unconditionally) | |||||||||
opcode | source | Ad | B/W | As | destination | Two-operand arithmetic | ||||||||||
0 | 1 | 0 | 0 | source | Ad | B/W | As | destination | MOV Move source to destination | |||||||
0 | 1 | 0 | 1 | source | Ad | B/W | As | destination | ADD Add source to destination | |||||||
0 | 1 | 1 | 0 | source | Ad | B/W | As | destination | ADDC Add source and carry to destination | |||||||
0 | 1 | 1 | 1 | source | Ad | B/W | As | destination | SUBC Subtract source from destination (with carry) | |||||||
1 | 0 | 0 | 0 | source | Ad | B/W | As | destination | SUB Subtract source from destination | |||||||
1 | 0 | 0 | 1 | source | Ad | B/W | As | destination | CMP Compare (pretend to subtract) source from destination | |||||||
1 | 0 | 1 | 0 | source | Ad | B/W | As | destination | DADD Decimal add source to destination (with carry) | |||||||
1 | 0 | 1 | 1 | source | Ad | B/W | As | destination | BIT Test bits of source AND destination | |||||||
1 | 1 | 0 | 0 | source | Ad | B/W | As | destination | BIC Bit clear (dest &= ~src) | |||||||
1 | 1 | 0 | 1 | source | Ad | B/W | As | destination | BIS Bit set (logical OR) | |||||||
1 | 1 | 1 | 0 | source | Ad | B/W | As | destination | XOR Exclusive or source with destination | |||||||
1 | 1 | 1 | 1 | source | Ad | B/W | As | destination | AND Logical AND source with destination (dest &= src) |
Instructions are 16 bits, followed by up to two 16-bit extension words. Addressing modes are specified by the 2-bit As field and the 1-bit Ad field. Some special versions can be constructed using R0, and modes other than register direct using R2 (the status register) and R3 (the constant generator) are interpreted specially. Ad can use only a subset of the addressing modes for As.
Indexed addressing modes add a 16-bit extension word to the instruction. If both source and destination are indexed, the source extension word comes first. x refers to the next extension word in the instruction stream in the table below.
As | Ad | Register | Syntax | Description |
---|---|---|---|---|
00 | 0 | n | Rn | Register direct. The operand is the contents of Rn. |
01 | 1 | n | x(Rn) | Indexed. The operand is in memory at address Rn+x. |
10 | — | n | @Rn | Register indirect. The operand is in memory at the address held in Rn. |
11 | — | n | @Rn+ | Indirect autoincrement. As above, then the register is incremented by 1 or 2. |
Addressing modes using R0 (PC) | ||||
01 | 1 | 0 (PC) | ADDR | Symbolic. Equivalent to x(PC). The operand is in memory at address PC+x. |
11 | — | 0 (PC) | #x | Immediate. Equivalent to @PC+. The operand is the next word in the instruction stream. |
Addressing modes using R2 (SR) and R3 (CG), special-case decoding | ||||
01 | 1 | 2 (SR) | &ADDR | Absolute. The operand is in memory at address x. |
10 | — | 2 (SR) | #4 | Constant. The operand is the constant 4. |
11 | — | 2 (SR) | #8 | Constant. The operand is the constant 8. |
00 | — | 3 (CG) | #0 | Constant. The operand is the constant 0. |
01 | — | 3 (CG) | #1 | Constant. The operand is the constant 1. There is no index word. |
10 | — | 3 (CG) | #2 | Constant. The operand is the constant 2. |
11 | — | 3 (CG) | #−1 | Constant. The operand is the constant −1. |
Instructions generally take 1 cycle per word fetched or stored, so instruction times range from 1 cycle for a simple register-register instruction to 6 cycles for an instruction with both source and destination indexed.
The MSP430X extension with 20-bit addressing adds added instructions that can require up to 10 clock cycles. Setting or clearing a peripheral bit takes two clocks. A jump, taken or not takes two clocks. With the 2xx series 2 MCLKs is 125 ns at 16 MHz.
Moves to the program counter are allowed and perform jumps. Return from subroutine, for example, is implemented as MOV @SP+,PC.
When R0 (PC) or R1 (SP) are used with the autoincrement addressing mode, they are always incremented by two. Other registers (R4 through R15) are incremented by the operand size, either 1 or 2 bytes.
The status register contains 4 arithmetic status bits, a global interrupt enable, and 4 bits that disable various clocks to enter low-power mode. When handling an interrupt, the processor saves the status register on the stack and clears the low-power bits. If the interrupt handler does not modify the saved status register, returning from the interrupt will then resume the original low-power mode.
Many added instructions are implemented as aliases for forms of the above. For example, there is no specific "return from subroutine" instruction, but it is implemented as "MOV @SP+,PC". Emulated instructions are:
Emulated | Actual | Description |
---|---|---|
ADC.xdst | ADDC.x #0,dst | Add carry to destination |
BRdst | MOV dst,PC | Branch to destination |
CLR.xdst | MOV.x #0,dst | Clear destination |
CLRC | BIC #1,SR | Clear carry bit |
CLRN | BIC #4,SR | Clear negative bit |
CLRZ | BIC #2,SR | Clear zero bit |
DADC.xdst | DADD.x #0,dst | Decimal add carry to destination |
DEC.xdst | SUB.x #1,dst | Decrement |
DECD.xdst | SUB.x #2,dst | Double decrement |
DINT | BIC #8,SR | Disable interrupts |
EINT | BIS #8,SR | Enable interrupts |
INC.xdst | ADD.x #1,dst | Increment |
INCD.xdst | ADD.x #2,dst | Double increment |
INV.xdst | XOR.x #−1,dst | Invert |
NOP | MOV #0,R3 | No operation |
POPdst | MOV @SP+,dst | Pop from stack |
RET | MOV @SP+,PC | Return from subroutine |
RLA.xdst | ADD.xdst,dst | Rotate left arithmetic (shift left 1 bit) |
RLC.xdst | ADDC.xdst,dst | Rotate left through carry |
SBC.xdst | SUBC.x #0,dst | Subtract borrow (1−carry) from destination |
SETC | BIS #1,SR | Set carry bit |
SETN | BIS #4,SR | Set negative bit |
SETZ | BIS #2,SR | Set zero bit |
TST.xdst | CMP.x #0,dst | Test destination |
Note that the immediate constants −1 (0xffff), 0, 1, 2, 4 and 8 can be specified in a single-word instruction without needing a separate immediate operand.
The basic MSP430 cannot support more memory (ROM + RAM + peripherals) than its 64K address space. In order to support this, an extended form of the MSP430 uses 20-bit registers and a 20-bit address space, allowing up to 1 MB of memory. This uses the same instruction set as the basic form, but with two extensions:
The extended instructions include some added abilities, notably multibit shifts and multiregister load/store operations.
20-bit operations use the length suffix "A" (for address) instead of .B or .W. .W is still the default. In general, shorter operations clear the high-order bits of the destination register.
The new instructions are as follows:
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Second word | Instruction |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | source | 0 | 0 | opcode | destination | Extended memory-register moves | ||||||||
0 | 0 | 0 | 0 | src | 0 | 0 | 0 | 0 | dst | — | MOVA @Rsrc,Rdst | ||||||
0 | 0 | 0 | 0 | src | 0 | 0 | 0 | 1 | dst | — | MOVA @Rsrc+,Rdst | ||||||
0 | 0 | 0 | 0 | addr[19:16] | 0 | 0 | 1 | 0 | dst | addr[15:0] | MOVA &abs20,Rdst | ||||||
0 | 0 | 0 | 0 | src | 0 | 0 | 1 | 1 | dst | x[15:0] | MOVA x(Rsrc),Rdst | ||||||
0 | 0 | 0 | 0 | n−1 | op. | 0 | 1 | 0 | W/A | destination | Bit shifts (1–4 bit positions) | ||||||
0 | 0 | 0 | 0 | n−1 | 0 | 0 | 0 | 1 | 0 | W/A | dst | — | RRCM.x #n,Rdst (Rotate right through carry.) | ||||
0 | 0 | 0 | 0 | n−1 | 0 | 1 | 0 | 1 | 0 | W/A | dst | — | RRAM.x #n,Rdst (Rotate right arithmetic, a.k.a. shift right signed.) | ||||
0 | 0 | 0 | 0 | n−1 | 1 | 0 | 0 | 1 | 0 | W/A | dst | — | RLAM.x #n,Rdst (Rotate left arithmetic, a.k.a. shift left.) | ||||
0 | 0 | 0 | 0 | n−1 | 1 | 1 | 0 | 1 | 0 | W/A | dst | — | RRUM.x #n,Rdst (Rotate right unsigned, a.k.a. shift right logical.) | ||||
0 | 0 | 0 | 0 | source | 0 | 1 | 1 | op. | destination | Extended register-memory moves | |||||||
0 | 0 | 0 | 0 | src | 0 | 1 | 1 | 0 | addr[19:16] | addr[15:0] | MOVA Rsrc,&abs20 | ||||||
0 | 0 | 0 | 0 | src | 0 | 1 | 1 | 1 | dst | x[15:0] | MOVA Rsrc,x(Rdst) | ||||||
0 | 0 | 0 | 0 | source | 1 | opcode | destination | Extended ALU operations | |||||||||
0 | 0 | 0 | 0 | imm[19:16] | 1 | 0 | 0 | 0 | dst | imm[15:0] | MOVA #imm20,Rdst | ||||||
0 | 0 | 0 | 0 | imm[19:16] | 1 | 0 | 0 | 1 | dst | imm[15:0] | CMPA #imm20,Rdst | ||||||
0 | 0 | 0 | 0 | imm[19:16] | 1 | 0 | 1 | 0 | dst | imm[15:0] | ADDA #imm20,Rdst | ||||||
0 | 0 | 0 | 0 | imm[19:16] | 1 | 0 | 1 | 1 | dst | imm[15:0] | SUBA #imm20,Rdst | ||||||
0 | 0 | 0 | 0 | src | 1 | 1 | 0 | 0 | dst | — | MOVA Rsrc,Rdst | ||||||
0 | 0 | 0 | 0 | src | 1 | 1 | 0 | 1 | dst | — | CMPA Rsrc,Rdst | ||||||
0 | 0 | 0 | 0 | src | 1 | 1 | 1 | 0 | dst | — | ADDA Rsrc,Rdst | ||||||
0 | 0 | 0 | 0 | src | 1 | 1 | 1 | 1 | dst | — | SUBA Rsrc,Rdst | ||||||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | op. | mode | varies | CALLA | ||||||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | — | RETI(Same as MSP430) |
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | As | register | CALLAsource | |||||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | abs[19:16] | abs[15:0] | CALLA &abs20 | |||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | x[19:16] | x[15:0] | CALLA x(PC) | |||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | — | — | (reserved) | |||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | imm[19:16] | imm[15:0] | CALLA #imm20 | |||
0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | — | — | (reserved) | |||||
0 | 0 | 0 | 1 | 0 | 1 | dir | W/A | n−1 | register | Push/pop n registers ending with specified | |||||||
0 | 0 | 0 | 1 | 0 | 1 | 0 | W/A | n−1 | src | — | PUSHM.x #n,Rsrc Push Rsrc, R(src−1), ... R(src−n+1) | ||||||
0 | 0 | 0 | 1 | 0 | 1 | 1 | W/A | n−1 | dst−n+1 | — | POPM.x #n,Rdst Pop R(dst−n+1), R(dst−n+2), ... Rdst |
All other instructions can have a prefix word added which extends them to 20 bits. The prefix word contains an added operand size bit, which is combined with the existing B/W bit to specify the operand size. One unused size combination exists; indications suggest that it may be used in future for a 32-bit operand size. [17]
The prefix word comes in two formats, and the choice between them depends on the instruction which follows. If the instruction has any non-register operands, then the simple form is used, which provides 2 4-bit fields to extend any offset or immediate constant in the instruction stream to 20 bits.
If the instruction is register-to-register, a different extension word is used. This includes a "ZC" flag which suppresses carry-in (useful for instructions like DADD which always use the carry bit), and a repeat count. A 4-bit field in the extension word encodes either a repeat count (0–15 repetitions in addition to the initial execution), or a register number which contains a 4-bit repeat count.
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Instruction |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 1 | — | A/L | 0 | 0 | — | Extension word | ||||||
0 | 0 | 0 | 1 | 1 | src[19:16] | A/L | 0 | 0 | dst[19:16] | Memory operand extension | ||||||
0 | 0 | 0 | 1 | 1 | 0 | 0 | ZC | 0 | A/L | 0 | 0 | n−1 | Register operand extension (immediate repeat count) | |||
0 | 0 | 0 | 1 | 1 | 0 | 0 | ZC | 1 | A/L | 0 | 0 | Rn | Register operand extension (register repeat count) |
The general layout of the MSP430 address space is:
A few models include more than 2048 bytes of RAM; in that case RAM begins at 0x1100. The first 2048 bytes (0x1100–0x18FF) is mirrored at 0x0200–0x09FF for compatibility. Also, some recent models bend the 8-bit and 16-bit peripheral rules, allowing 16-bit access to peripherals in the 8-bit peripheral address range.
There is a new extended version of the architecture (named MSP430X) which allows a 20-bit address space. It allows added program ROM beginning at 0x10000.
The '5xx series has a greatly redesigned address space, with the first 4K devoted to peripherals, and up to 16K of RAM.
A microcontroller or microcontroller unit (MCU) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs along with memory and programmable input/output peripherals. Program memory in the form of NOR flash, OTP ROM, or ferroelectric RAM is also often included on the chip, as well as a small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general-purpose applications consisting of various discrete chips.
The Intel MCS-51 is a single chip microcontroller (MCU) series developed by Intel in 1980 for use in embedded systems. The architect of the Intel MCS-51 instruction set was John H. Wharton. Intel's original versions were popular in the 1980s and early 1990s, and enhanced binary compatible derivatives remain popular today. It is a complex instruction set computer, but also has some of the features of RISC architectures, such as a large register set and register windows, and has separate memory spaces for program instructions and data.
The Intel 8085 ("eighty-eighty-five") is an 8-bit microprocessor produced by Intel and introduced in March 1976. It is the last 8-bit microprocessor developed by Intel.
AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. These are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.
SuperH is a 32-bit reduced instruction set computing (RISC) instruction set architecture (ISA) developed by Hitachi and currently produced by Renesas. It is implemented by microcontrollers and microprocessors for embedded systems.
PIC is a family of microcontrollers made by Microchip Technology, derived from the PIC1640 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to Peripheral Interface Controller, and is currently expanded as Programmable Intelligent Computer. The first parts of the family were available in 1976; by 2013 the company had shipped more than twelve billion individual parts, used in a wide variety of embedded systems.
The Blackfin is a family of 16-/32-bit microprocessors developed, manufactured and marketed by Analog Devices. The processors have built-in, fixed-point digital signal processor (DSP) functionality performed by 16-bit multiply–accumulates (MACs), accompanied on-chip by a microcontroller. It was designed for a unified low-power processor architecture that can run operating systems while simultaneously handling complex numeric tasks such as real-time H.264 video encoding.
Alchemy is a family of ultra low power embedded microprocessors originally designed by Alchemy Semiconductor for communication and media devices. Alchemy processors are SoCs integrating a CPU core, a memory controller, and a varying set of peripherals. All members of the family use the Au1 CPU core implementing the MIPS32 instruction set by MIPS Technologies.
Atmel ARM-based processors are microcontrollers and microprocessors integrated circuits, by Microchip Technology, that are based on various 32-bit ARM processor cores, with in-house designed peripherals and tool support.
AVR32 is a 32-bit RISC microcontroller architecture produced by Atmel. The microcontroller architecture was designed by a handful of people educated at the Norwegian University of Science and Technology, including lead designer Øyvind Strøm and CPU architect Erik Renno in Atmel's Norwegian design center.
TLCS is a prefix applied to microcontrollers made by Toshiba. The product line includes multiple families of CISC and RISC architectures. Individual components generally have a part number beginning with "TMP". E.g. the TMP8048AP is a member of the TLCS-48 family.
The Mitsubishi 740, also known as MELPS 740, is a series of 8-bit CMOS microcontrollers and microprocessors with an enhanced MOS Technology 6502 compatible core based on the expanded WDC 65C02. The ICs were manufactured by Mitsubishi Electric during the 1980s and 1990s.
EFM32 Gecko MCUs are a family of mixed-signal 32-bit microcontroller integrated circuits from Energy Micro based on ARM Cortex-M CPUs, including the Cortex-M0+, Cortex-M3, and Cortex-M4.
STM32 is a family of 32-bit microcontroller integrated circuits by STMicroelectronics. The STM32 chips are grouped into related series that are based around the same 32-bit ARM processor core: Cortex-M0, Cortex-M0+, Cortex-M3, Cortex-M4, Cortex-M7, Cortex-M33. Internally, each microcontroller consists of ARM processor core(s), flash memory, static RAM, debugging interface, and various peripherals.
LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals. The earliest LPC series were based on the Intel 8-bit 80C51 core. As of February 2011, NXP had shipped over one billion ARM processor-based chips.
The ATmega328 is a single-chip microcontroller created by Atmel in the megaAVR family. It has a modified Harvard architecture 8-bit RISC processor core.
RL78 Family is a 16-bit CPU core for embedded microcontrollers of Renesas Electronics introduced in 2010.
The MSP432 is a mixed-signal microcontroller family from Texas Instruments. It is based on a 32-bit ARM Cortex-M4F CPU, and extends their 16-bit MSP430 line, with a larger address space for code and data, and faster integer and floating point calculation than the MSP430. Like the MSP430, it has a number of built-in peripheral devices, and is designed for low power requirements. In 2021, TI confirmed that the MSP432 has been discontinued and "there will be no new MSP432 products".
The NEC μCOM series is a series of microprocessors and microcontrollers manufactured by NEC in the 1970s and 1980s. The initial entries in the series were custom-designed 4 and 16-bit designs, but later models in the series were mostly based on the Intel 8080 and Zilog Z80 8-bit designs, and later, the Intel 8086 16-bit design. Most of the line was replaced in 1984 by the NEC V20, an Intel 8088 clone.
A/L
, where L
(long) is used by other processors to indicate 32-bit operands. Also the description of the SXTX instruction (MSP430F5xx Family User's Guide alau208f page 237) describes the effect of the instruction in register bits 20–31.Name | Manufacturer | Interface | Protocol(s) | Status |
---|---|---|---|---|
MSP-FET430PIF | TI | Parallel-Port | JTAG | |
MSP-FET430UIF | TI | USB-Interface | JTAG, Spy-Bi-Wire | |
MSP-FET | TI | USB-Interface | JTAG, Spy-Bi-Wire | |
MSP-430 LaunchPad | TI | USB-Interface | Spy-Bi-Wire | |
MSP-430 LaunchPad eZ-FET | TI | USB-Interface | Spy-Bi-Wire | |
eZ430-F2013 | TI | USB-Interface | Spy-Bi-Wire | obsolete |
eZ430-RF2500 | TI | USB-Interface | Spy-Bi-Wire | |
FETP | SoftBaugh | Parallel-Port | JTAG | |
USBP | SoftBaugh | USB-Interface | JTAG, Spy-Bi-Wire | discontinued |
MSP430-JTAG | Olimex | Parallel-Port | JTAG | |
MSP430-JTAG-ISO | Olimex | USB-Interface | JTAG, Spy-Bi-Wire | obsolete |
MSP430-JTAG-ISO-MK2 | Olimex | USB-Interface | JTAG, Spy-Bi-Wire | |
MSP430-JTAG-Tiny | Olimex | USB-Interface | JTAG, Spy-Bi-Wire | not found |
MSP430-JTAG-TINY-V2 | Olimex | USB-Interface | JTAG?, Spy-Bi-Wire | |
MSP430-JTAG-RF | Olimex | USB-Interface | JTAG, Spy-Bi-Wire | |
FlashPro-CC | Elprotronic | USB-Interface | JTAG, Spy-Bi-Wire, BSL | |
VisSim/ECD | Visual Solutions | USB-Interface | JTAG, Spy-Bi-Wire | |
LA-3713 | Lauterbach | USB-Interface / Ethernet | JTAG, Spy-bi-Wire | |