TI MSP430

The MSP430 is a 16 -bit RISC microcontroller from Texas Instruments. It is being developed in Freising, Germany. The microcontroller is optimized for applications with lowest power consumption. The processor core is programmable in the programming language C and / or assembly. The controller is available in different versions. Texas Instruments expands the range continuously, indicating a great success of this controller line. Typical applications include devices with long-life battery, such as heat meters, heat cost allocators, dive computer or even blood pressure monitors in the medical field.

  • 4.1 clock generation
  • 4.2 SVS
  • 4.3 hardware multiplier
  • 4.4 DMA
  • 4.5 ports
  • 4.6 watchdog
  • 4.7 timer
  • 4.8 Serial Interfaces
  • 4.9 comparators
  • 4:10 ADCs
  • 4:11 CRC16
  • 4:12 DACs
  • 4:13 operational amplifier
  • 4:14 LCD driver
  • 4:15 real time clock
  • 4:16 USB
  • 4:17 Other peripheral modules
  • 5.1 List of available C compiler ( incomplete selection )
  • 5.2 List of FLASH Emulation Tool ( FET)

Memory Layout

The MSP430 has a classical Von Neumann architecture. The size of the addressable memory is limited in most derivatives to 64 Kbytes. Memory sizes are up to 256 kB flash and up to 16 KB of RAM ( currently [Nov 2008] also in the same block). For all derivatives about 2 Kbytes of addressable lower 64 Kbytes of internal functions ( eg as a boot loader ) reserved, so with the two largest 16-bit memory configurations 60 kByte FLASH with 2 KB of RAM and 48 Kbytes FLASH with 10 Kbytes of RAM are ready.

Since November 2006, TI also offers a family with a so-called MSP430X CPU. This is based on a storage model that can address up to 1 MB of memory. The address bus is 20 bits in this case, all registers (except the status register R2/SR ) are therefore no longer 16 bits wide, but 20 bits. Thus, the available in the "normal" CPUs commands are still available without modification. The internal processing but had to be adjusted to the larger address width, for example, a word more on the stack must be written with the CALL command, since 4 more bits must be stored as a return address. Available are blocks with up to 120 Kbytes Flash / 4 Kbytes RAM and 116 KB flash / 8 KB of RAM, all with LCD drivers.

Are in the lowest 16 bytes ( address 0000 h to 000F h) special register ( SFR Special Function Register ) is shown for the interrupt and " module " control. The registers of the 8 -bit peripherals occupy the next 240 bytes ( address 0010 h to 00FF h). So far, a memory access is byte-wise necessary. In the next 255 bytes ( address 0100 h to 01FF h ) are reserved for the 16 -bit peripheral. From here uses a word access to the memory.

From the 513 byte ( address 0200 h to 09FF h) is the RAM. With the larger RAM expansions (more than 2 Kbytes ) is this actually in memory above ( address 1100 h to h 38ff ), but is mirrored to some extent in the lower address range. In between boot and information storage ( address 0C00 h to 0FFF h, respectively. 1000h to 10FF h).

The information memory as the code memory, a flash memory, whose special feature is the split into two 128 -byte segments, which can be used as a " buffer" for data which are to be changed from time to time. The remaining flash memory ( for the program code and constants ) has segments of 512 bytes. It is roughly in the storage area 1100 h to FFFF h, but depending on the memory configuration ( more RAM or a smaller FLASH) are first address FC00 h (for 1 kByte FLASH). In addition, the top 32 bytes ( address FFE0 h to FFFF h) of memory reserved for interrupt vectors, however, are used only when necessary. No interrupts used, and the memory for the vectors may be used as program memory.

Lately also FRAM based MSP430 offered. This type of memory can be compared to Flash, describe faster and with much less energy. A further advantage of these devices is that there is no fixed boundary between code and data ( and flash RRAM ), but these can be selected as required. The manufacturing process used the FRAM devices co-developed by Ramtron and TI.

Interrupt

The MSP430 knows basically 16 interrupt sources are prioritized according to their location in the interrupt vectors. Not every block occupies all sources. This is from the expansion of the "internal" peripheral dependent.

It can occupy the same vector multiple interrupts. If this is the case, it must be decided by the software of corresponding bits determine which interrupt is'. Also, have several interrupts "own" vector registers, through which it (expandable up to 128 ) can give each back up to 10 different sources. As an example may be mentioned the timer interrupts.

The MSP430 speaks several power-down modes in which stopped the command processing or the clock is turned off. In the lowest mode is the power consumption, depending on the type, at 0.4 uA. If you want to realize a real-time clock, about 2 uA are required. The CPU can be woken again by various interrupts.

Processor

The instruction set includes only 27 " basic instructions " and 24 " emulated " instructions, which are composed of the basic instructions. The term " RISC " is this appropriate.

The duration of the instruction execution depending on the command 1 to 6 cycles are possible. At clock frequencies up to 25 MHz as step times can be achieved down to 40 ns. The maximum clock frequency is of the type and the supply voltage dependent, such as:

  • MSP430x1xx: 4.15 MHz at 1.8 V .. 8 MHz at 3.6 V ( linear)
  • MSP430x2xx: 4.15 MHz at 1.8 V, 16 MHz at 3.3 .. 3.6 V ( non-linear)
  • MSP430x5xx: 8 MHz at 1.8 V, 25 MHz at 2.4 .. 3.6 V ( stepped)

MSP430 microcontrollers include an MSP430 core or a MSP430X - core as a processor. Latter processing additional commands to operate the 20-bit register and widened to more than 64 KiByte to address (the limit of 16 bits), and is, for MSP430 core (excluding "X") compatible. From the perspective of MSP430X instruction set extended bit width is " limited " to 32 bits, the 20-bit register width is selected as the current compromise between Adressierumfang (1 MiByte ), complexity and power consumption. Suffice 20 bit for certain arithmetic operations, also commonly used (currently only possible in assembler ) can these extended registers.

Architecture

The MSP430 has 16 registers. Register 0 is the Program Counter (PC), section 1 of the stack pointer (SP, stack pointer ) register 2 and the processor status register ( PS). Register 3 (Constant generator, CG) is a pseudo register that provides the required constants frequently -1, 0, 1 and 2. These four registers have special functions, but are as the other twelve registers also use freely. The possibility of the Program Counter or the stack pointer to use as a "free" registry has been used in the PDP -11. The registers are not addressable; They are not available as a copy in the address space of the MSP430.

Possible addressing modes are addressing registers (Rn), indexed addressing (X ( Rn) ), symbolic addressing, absolute addressing, indirect addressing ( @ Rn), indirect addressing with auto-increment ( @ Rn ) and direct addressing of constants. These addressing modes are available for the source operands are available. For instructions with two operands are available only register addressing, symbolic addressing, absolute addressing and indexed addressing for the destination operand.

Internal peripherals ( "modules")

The registers of the "internal" peripherals ( clock generation, SVS ( supply voltage monitoring ), hardware multiplier, DMA, ports, watchdog timer, serial ports, comparators, ADCs and DACs) are ( as mentioned above) in the address area involved. These peripherals are integrated depending on the model on the chip. It distinguishes between 8-bit and 16-bit peripheral peripherals.

Clock generation

The clock generation TI relies on three different sources, depending on the needs very low power consumption ( 32.768 kHz in the form of a watch crystal ), very fast waking up after an interrupt (internal RC oscillator, 6 microseconds time to reach the nominal RC clock frequency ) or high frequency (up to 16 MHz) allow. The MSP430 is very well suited for overclocking: The low frequency oscillator can be operated with a 100 - kHz crystal ( around 200 % overclock ), and the RF oscillator can be overclocked to 100 %, at least at room temperature and at the maximum operating voltage.

SVS

The Supply Voltage Supervisor, also called Brown Out Reset or Brown Out Detector monitors the supply voltage and also allows for a short-term drop below the minimum voltage a regulated new startup (reset ) of the system. If the minimum voltage below, unpredictable results might occur in the system, which may lead to unwanted program executions remain hanging or standing. With the SVS such errors are avoided and a controlled reboot, even without switching off the supply voltage, completed.

Hardware multiplier

The hardware multiplier controls the multiplication of unsigned and signed 8- bit and 16 -bit numbers, as a result a large number up to 32 bits is produced. The youngest child of the MSP430 family dominated even 32 bit big numbers and a 64 bit great result. He ruled as unsigned and signed fraught multiplying and summing (MAC, a domain of DSPs). The first operand of these four operations is stored in each case in a special register, the second operand is always the same register. The result is always in the same two output registers are available. It is automatically three (!) Clocks after the deposition of the second operand is available.

DMA

With the help of the DMA controller can be quickly transferred data from one memory location to another without the intervention of the CPU. During this time, the CPU can not access the bus, so they must of course be stopped. The DMA transfer is approved but also in the low- power modes, the CPU clock but needs to be ramped up. Another advantage of the DMA module is that it can be used in principle "tandem". So that means Alternating between CPU and DMA clock cycles are divided. This is useful, for example, excellent to a video image build without, the CPU can be used muss.Durch the possibility of the series connection of the DMA (usually 3), as well as a digital filter can be realized, which with the help of the AD and DA converters, for example, audio applications can be used. Another very Helpful function with the DMA is to move memory, this saves a lot of time and programming effort, but is very interesting, for example, in the MSP430F16XX series, as these more memory ( RAM) Possess. Even copying from RAM to FLASH can be done more easily with the DMA than with software.

Ports

The ports are partially interrupt- capable, which means that the MSP430 can be woken about them from a low-power mode. In such a state of the MSP430 consumes the least energy ( about 0.4 uA ). The ports themselves can drive very little power and record (about 6 mA, the total power is in the block, depending on the type far from being a multiple of the number of pins of this value). The names of the ports run as follows: P1.0 - P2.5, so there are eg two register at MSP430G2xxxx (P1, P2), which then each have individual outputs ( P1.0 ). The individual outputs can be used both as input and as output. Thus, for all outputs / inputs at once on Defining port, or one defines each output / input individually.

Watchdog

The watchdog timer is used when after a deadlock without the user want the system to be operable again. To this end, the watchdog timer counts one up, which must be set by the application again and again to zero. If the application because of a deadlock not in a position (generally say, they got lost ), a reset is triggered by the watchdog. The system starts from the front and is operational again (even if the user does not necessarily like it when he has to start from scratch ). This will ensure that, even after an intense disturbance from outside, for example, ESD discharge of the processor, the program returns to a defined operating state. Also very rarely occurring, not found in testing, program execution error so can be intercepted.

However, the function of the watchdog timer can also be switched off when the above-mentioned feature is not desired or is inconvenient. One can use the watchdog timer as additional counter, for example, to realize therefore a real -time clock. This is done by configuring the counter so that it triggers an interrupt every second, and then counts in the interrupt, the second high. Disadvantage of this " software clock " against an external clock circuit: If the MSP430 is switched off completely, so it has no way to trigger the interrupt, the time can not be counted naturally and must be reinitialized on next boot.

Timer

The timers are generally 16-bit timer. They can be addressed by different measures, including external events. This means that (fast 16- MHz clock ) up to arbitrarily long timer periods ( many months and years by a very slow external signals) are possible from very short timer times in the range of a few hundred nanoseconds. Themselves through the second own time base timer at 32 kHz nor direct times of up to two seconds when using an additional register of up to 1.5 days realized. Also timer to wake up the CPU from a low-power mode. But that they run - they need a clock - can the power saving functionality can not be driven as high as in the ports where virtually no internal peripheral support is necessary.

Serial Interfaces

The serial interfaces are currently the protocol UART, SPI, USB ( slave) and I ² C implemented in hardware. More like LIN to follow. CAN will not be supported for the foreseeable future by the MSP430 because the manufacturing process by which the controllers are made ​​, is not suitable for the temperature range in the automotive sector. The baud rate could theoretically be set to up to 16 Mbit / s. Asynchronous communication is safe up to 115.2 kbit / s, SPI operates at 1 Mbit / s and I ² C in the supported modes to 400 kbit / s

Comparators

To the comparators analog voltages to different reference voltages can be compared. The reference voltage can be generated internally externally (0.5 · VCC VCC or about 0.25 x 0.55 V) or. With the result Interrupts can be triggered triggered or timer. With the triggered timer so PWM signals are generated which are of a pulse-width modulated input signal dependent.

One can also compare directly to a port, CAOUT, ​​turn. If the two input ports of the comparator and are designated, then CAOUT high when the voltage is larger, which is applied to. Which of the two ports and that is, registers can be set by means of bits CARSEL and CAEX in the Comparator Control.

ADCs

The AD converter has a resolution of 10, 12, 14 or 16 bits, which used depending on the type of MSP430 as a conversion process, the SAR ( successive approximation ), slope (ramp method ) or sigma-delta method. As with the comparators are required for the AD converter also has a reference voltage which can be generated internally or externally. The sampling rate can be nominally up to 5 MHz, which signals to 2.5 MHz would theoretically be scanned. The data obtained with such a high sampling rate could be processed by the CPU but hardly since this only 3.2 per sample clock cycles (16 MHz clock ) were available.

CRC16

The CRC16 module generates a CRC code based on a sequence of data values, and can be used for the checking and correction of the data. The CRC16 module - code is based on the CRC - CCITT standard. Ideally, this module can be used for data transfer via TCP / IP or coupled wireless modules. However, it is also suitable as the checking code writing on magnetic media such as floppy disks and hard disks.

DACs

The DACs have a resolution of 8 or 12 bits. The analog output signal can thus be varied in steps of 256 or 4096. The reference voltage can be used here as comparators and ADCs, the internal or external references. When "Output Format ", the binary data is output directly or as a complement. The output amplifier can be automatically calibrated so that the output voltage follows the correct digital values ​​. The DAC itself can be clocked at up to 550 kHz, which allows according to a theoretical output frequency up to 275 kHz.

Operational amplifier

Modules with integrated operational amplifiers make it possible to strengthen analog voltages (which benefits the use in measurement systems ). The operational amplifiers are like the rest of the block power saving and are supplied from a single voltage source (single supply, low current ). The output as the input voltage to the supply voltage range ( rail to rail ). The settling time ( settling time ) can be programmed shorter at higher power consumption. A programmable gain for different resistances of the feedback are incorporated.

LCD driver

The built- in modules of the 4xx series LCD driver can control static and multiplexed LCDs. Here, up to 40 segments and 4 common terminals ( backplanes ) are possible. For the display memory with 20 bytes is sufficient, which is displayed in the address range 0091h to 00A4h. Via external resistors, the contrast can be adjusted.

Real-time clock

The real time clock (RTC, English Real Time Clock) can be used as a clock with calendar function ( calendar mode) as a multi-purpose 32- bit counter ( counter mode ) or. In the counting mode, the RTC module comprises two independent eight -bit timers that may be combined on as a 16-bit timer. Both counters are then timer and can be read and written by software. The calendar function observed months with less than 31 days and even leap years. The RTC alarm register has to wake-up and support hardware interrupts. In contrast to the timers "survived" the real-time clock reset.

USB

MSP430F55XX integrated Universal Serial Bus (USB) are available.

  • Full-speed Universal Serial Bus (USB) device with integrated physical transfer unit and YOU
  • Integrated 3.3V / 1.8V USB power supply system suitable for self-powered and bus-powered USB devices without additional voltage regulator
  • Integrated frequency generator ( PLL) for USB - Quartz required
  • Eight input and eight output USB endpoints ( non- isochronous transfer mode ) available
  • USB bootloader is running with a whole range of different crystals (not only a certain quartz)

With the USB interface can be for example, a HID, a serial USB device or a USB stick realized but not drive. Its associated dual-port RAM ( 2 Kbytes ) can be added when not using the USB module as additional memory to the internal memory anyway somewhat scarce. Isochronous data transmission is not provided, therefore, the video and audio devices This class can not be implemented.

Other peripheral modules

Since Shrinking the end of 2008, there are some types of the series MSP430X5xx with integrated RF transceiver, LDO voltage regulator and an AES crypto engine.

Programming

The programming language is C offers. The architecture is designed. Pointers, arrays, and stack can be implemented easily. Although the MSP430 has a RISC instruction set, it leaves it to the part that a C expression is due to the different addressing modes translated into a single machine instruction. Various commercial and free C compiler available.

List of available C compiler ( incomplete selection )

However, there are also users who program the MSP430 in assembler. Since the C compiler can usually be set up and optimizing it are actually per se already, this is really only necessary for time-critical application parts. In addition, C code and assembler can be mixed with most C compilers.

A rather odd but very efficient programming and test system is FORTH. In addition to some open source projects FORTH there is a very good professional FORTH development system " Swift - X". Forth uses the Reverse Polish Notation (RPN ).

Chip programming and debugging is also possible via a JTAG interface. To this end, TI offers one as FLASH Emulation Tool ( FET) designated on hardware that accesses the JTAG port via the parallel port or the USB port of the PC. In the latest versions ( MSP430F20xx ) of the JTAG port is ( actually at least four signal lines and reset features ) through an interface that TI " Spy -Bi - Wire" is called, has been reduced to two signal lines, so that only four ports on a target system for debugging are required: Two for the Spy Bi -Wire, ground and supply voltage.

The modern FET tool is provided as a USB stick. If the target system adequately requires little supply current, sufficient for USB and an external power supply is not necessary.

The MSP430 LaunchPad (MSP - EXP430G2 ), actually a evaluation board makes, also officially used for programming with Spy Bi-Wire. The needing connections can be found on the terminal block J3 and J4 terminal block has not been installed.

List of FLASH Emulation Tool ( FET)

In addition, each contains programmable MSP 430 a bootstrap loader that allows you to program the modules through an RS- 232 interface. Details are listed in a TI application note.

Using the boot-strap loader ( BSL) but the program can be reloaded via a serial interface.

Our offered HiTex Tool " DProbe430 " with its Aufrüstmodul " DBox16 " is so far the only emulator for the MSP430. It supports real-time debugging in assembler ( TI ) and high (with IAR C compiler), displaying all processor resources. Unfortunately, few derivatives of the MSP430 series are supported.

Overclocking

Involuntary admission by TI for overclocking shows the eZ430 development tool: it includes a host computer for the USB bridge a MSP430F169. According to the datasheet it has a maximum clock frequency of 8 MHz. However, the quartz for this block is a 12 - MHz type. Thus TI is here a different product with a overclock of 50 % in the market.

585947
de