embedded systems using MSP430, Exercises of Embedded Systems

Architecture of MSP430, Memory IO

Typology: Exercises

2017/2018

Uploaded on 05/02/2018

sreekanth-babu
sreekanth-babu ๐Ÿ‡ฎ๐Ÿ‡ณ

5

(1)

1 document

1 / 36

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24

Partial preview of the text

Download embedded systems using MSP430 and more Exercises Embedded Systems in PDF only on Docsity!

Contents

๏‚ž (^) MSP430 architecture: ๏‚— (^) Main characteristics ๏‚— (^) Architecture topology ๏‚— (^) Address space ๏‚— (^) Interrupt vector table ๏‚— (^) Central Processing Unit (MSP430 CPU) ๏‚— (^) Central Processing Unit (MSP430X CPU) ๏‚— (^) Addressing modes ๏‚— (^) Instructions set ๏‚ž (^) Quiz

Microcontroller characteristics

๏‚ž (^) Integration: Able to implement a whole design onto a single chip. ๏‚ž (^) Cost: Are usually low-cost devices (a few $ each); ๏‚ž (^) Clock frequency: Compared with other devices (microprocessors and DSPs), MCUs use a low clock frequency: ๏‚— (^) MCUs today run up to 100 MHz/100 MIPS (Million Instructions Per Second). ๏‚ž (^) Power consumption: Low power (battery operation); ๏‚ž (^) Bits: 4 bits (older devices) to 32 bits devices; ๏‚ž (^) Memory: Limited available memory, usually less than 1 MByte; ๏‚ž (^) Input/Output (I/O): Low to high (8 to 150) pin-out count.

MSP430 main characteristics (1/3)

๏‚ž (^) Low power consumption: ๏‚— (^) 0.1 ๏ญA for RAM data retention; ๏‚— (^) 0.8 ๏ญA for real-time clock mode operation; ๏‚— (^250) ๏ญA/MIPS during active operation. ๏‚ž (^) Low operation voltage (from 1.8 V to 3.6 V); ๏‚ž (^) < 1 ๏ญs clock start-up; ๏‚ž (^) < 50 nA port leakage; ๏‚ž (^) Zero-power Brown-Out Reset (BOR).

MSP430 main characteristics (3/3)

๏‚ž (^) Flexibility: ๏‚— (^) Up to 256 kByte Flash; ๏‚— (^) Up to 100 pins; ๏‚— (^) USART, I2C, Timers; ๏‚— (^) LCD driver; ๏‚— (^) Embedded emulation; ๏‚— (^) And many more peripherals modulesโ€ฆ ๏‚ž (^) Microcontroller performance: ๏‚— (^) Instruction processing on either bits, bytes or words ๏‚— (^) Reduced instructions set; ๏‚— (^) Compiler efficient; ๏‚— (^) Wide range of peripherals; ๏‚— (^) Flexible clock system.

MSP430 Architecture

๏‚ž (^) Block diagram:

Interrupt vector table

๏‚ž (^) Mapped at the very end of memory space (upper 16 words of Flash/ROM): 0FFE0h - 0FFFEh (4xx devices); ๏‚ž (^) Priority of the interrupt vector increases with the word address.

Central Processing Unit (MSP430 CPU) (1/7)

๏‚ž (^) RISC (Reduced Instructions Set Computing) architecture: ๏‚— (^) Instructions are reduced to the basic ones (short set):

โ—‹ 27 physical instructions;

โ—‹ 24 emulated instructions.

๏‚— (^) This provides simpler and faster instruction decoding; ๏‚— (^) Interconnect by a using a common memory address bus (MAB) and memory data bus (MDB) - Von Neumann architecture:

โ—‹ Makes use of only one storage structure for data and

instructions sets.

โ—‹ The separation of the storage processing unit is

implicit;

โ—‹ Instructions are treated as data (programmable).

Central Processing Unit (MSP430 CPU) (3/7)

๏‚ž (^) Incorporates sixteen 16-bit registers:

โ—‹ 4 registers (R0, R1, R2 and R3) have dedicated

functions;

โ—‹ 12 register are working registers (R4 to R15) for

general use.

๏‚ž (^) R0: Program Counter (PC): ๏‚— (^) Points to the next instruction to be read from memory and executed by the CPU. ๏‚ž (^) R1: Stack Pointer (SP): ๏‚— (^) 1st: stack can be used by user to store data for later use (instructions: store by PUSH, retrieve by POP); ๏‚— (^) 2nd: stack can be used by user or by compiler for subroutine parameters (PUSH, POP in calling routine; addressed via offset calculation on stack pointer (SP) in called subroutine);

Central Processing Unit (MSP430 CPU) (4/7)

๏‚ž (^) R1: Stack Pointer (SP) (continued): ๏‚— (^) 3rd: used by subroutine calls to store the program counter value for return at subroutine's end (RET); ๏‚— (^) 4th: used by interrupt - system stores the actual PC value first, then the actual status register content (on top of stack) on return from interrupt (RETI) the system get the same status as just before the interrupt happened (as long as none has changed the value on TOS) and the same program counter value from stack.

Central Processing Unit (MSP430 CPU) (6/7)

๏‚ž (^) R2/R3: Constant Generator Registers (CG1/CG2): ๏‚— (^) Depending of the source-register addressing modes (As) value, six constants can be generated without code word or code memory access to retrieve them. ๏‚— (^) This is a very powerful feature which allows the implementation of emulated instructions, for example, instead of implement a core instruction for an increment the constant generator is used. 16 Register As Constant Remarks R2 00 - (^) Register mode R2 01 (0) (^) Absolute mode R2 10 00004h +4, bit processing R2 11 00008h (^) +8, bit processing R3 00 00000h (^) 0, word processing R3 01 00001h + R3 10 00002h +2, bit processing R3 11 0FFFFh -1, word processing

Central Processing Unit (MSP430 CPU) (7/7)

๏‚ž (^) R4 - R15: Generalโ€“Purpose Registers: ๏‚— (^) These general-purpose registers are adequate to store data registers, address pointers, or index values and can be accessed with byte or word instructions. 17

Central Processing Unit (MSP430X CPU) (2/10)

๏‚ž (^) Organization of the MSP430X CPU: ๏‚— (^) Although the MSP430X CPU structure is similar to that of the MSP430 CPU, there are some differences that will now be highlighted; ๏‚— (^) With the exception of the status register SR, all MSP430X registers are 20 bits; ๏‚— (^) The CPU can now process 20-bit or 16-bit data.

Central Processing Unit (MSP430X CPU) (3/10)

๏‚ž (^) The MSP430X CPU has 16 registers, some of which have special use: ๏‚ž (^) R0 (PC) Program Counter: ๏‚— (^) Has the same function as the MSP430 CPU, although now it has 20 bits. ๏‚ž (^) R1 (SP) Stack Pointer: ๏‚— (^) Has the same function as the MSP430 CPU, although now it has 20 bits. ๏‚ž (^) R2 (SR) Status Register: ๏‚— (^) Has the same function as the MSP430 CPU, but it still has 16 bits.