CPE 323 Introduction to Embedded Computer Systems: The MSP430X Architecture Instructor: Dr Aleksandar Milenkovic.

Slides:



Advertisements
Similar presentations
Computing Systems Organization
Advertisements

UBI >> Contents Chapter 15 Advanced Laboratories MSP430 assembly language tutorial: MSP430X CPU MSP430 Teaching Materials Texas Instruments Incorporated.
CPU Review and Programming Models CT101 – Computing Systems.
S04: MSP430 Microarchitecture
There are two types of addressing schemes:
8051 Core Specification.
Computer Organization and Architecture
Execution of an instruction
State Machines Timing Computer Bus Computer Performance Instruction Set Architectures RISC / CISC Machines.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Unit -II CPU Organization By- Mr. S. S. Hire. CPU organization.
80x86 Processor Architecture
EET 2261 Unit 2 HCS12 Architecture
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
Chapter 4 The Von Neumann Model. BYU CS/ECEn 124Chapter 4 - The Von Neumann Model2 Concepts to Learn… Computer Architecture Von Neumann vs. Harvard MSP430.
Chapter 6 – MSP430 Micro-Architecture
The MSP430xxxx Department of Electrical and Computer Engineering
Architecture of the MSP430 Processor. Central Processing Unit Program Counter (PC) - Contains the address of the next instruction to be executed. The.
Part II: Addressing Modes
MSP430 Mixed Signal Microcontroller – Parte 1
Programming & Development of Mobile & Embedded Systems Lin Zhong ELEC424, Fall 2010.
ECE 447 Fall 2009 Lecture 5: TI MSP430 Software Development in C and Assembly pt. 2.
Module 10 Adapted By and Prepared James Tan © 2001.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
CPE 323 Introduction to Embedded Computer Systems: The MSP430 Introduction Instructor: Dr Aleksandar Milenkovic.
VAX-11/780 – A Virtual Address Extension to the DEC PDP-11 Family ( Author : W.D.Strecker ) By Padmaja chowti.
Computer Architecture Lecture 5: Addressing modes Piotr Bilski.
Machine Instruction Characteristics
Instruction Set Architecture
Directives, Memory, and Stack. Directives Special commands to the assembler May or may not generate machine code Categories by their function Programming.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the SH-2 32-bit RISC.
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the CPU architecture.
8051 Micro controller. Architecture of 8051 Features of 8051.
9/20/6Lecture 2 - Prog Model Architecture, Data Types and Addressing Modes.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Z80 Overview internal architecture and major elements of the Z80 CPU.
Addressing Modes MTT CPU08 Core Motorola CPU08 ADDRESSING MODES.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set.
Structure and Role of a Processor
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Internal Programming Architecture or Model
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides additional details about the.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
CHAPTER ADDRESSING MODES.
ECE 3430 – Intro to Microcomputer Systems
Classification of Instruction Set of 8051
Subroutines and the Stack
ECE 3430 – Intro to Microcomputer Systems
Microcomputer Programming
Computer Organization and Assembly Language (COAL)
SCHOOL OF ELECTRONICS ENGINEERING Electronics and Communication
EE Embedded Systems Fall 2015
CS170 Computer Organization and Architecture I
Introduction to Micro Controllers & Embedded System Design Addressing Mode Department of Electrical & Computer Engineering Missouri University of Science.
Architectural Overview
Chapter 8 Central Processing Unit
CPE 323 Introduction to Embedded Computer Systems: DMA Controller
Chapter 4 Instruction Set.
Introduction to Micro Controllers & Embedded System Design
Lecture 06 Programming language.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Subroutines and the Stack
Presentation transcript:

CPE 323 Introduction to Embedded Computer Systems: The MSP430X Architecture Instructor: Dr Aleksandar Milenkovic

CPE 323 Introduction To Embedded Computer Systems 2 What is MSP430X? MSP430X – Extended Memory Architecture Can address a 1-MB address range without paging Implemented in all devices with address space that exceeds 64 KB Characteristics All MSP430 instructions work as before Instruction extensions reach > 64KB.A extension for address manipulation > 64KB Interrupt response improvement Instruction cycle count improvements

CPE 323 Introduction To Embedded Computer Systems 3 MSP bit RISC 20-bit address bus allows direct access and branching throughout the entire memory range without paging 16-bit data bus allows direct manipulation of word-wide arguments. Byte, word, and 20-bit address- word addressing

CPE 323 Introduction To Embedded Computer Systems 4 Interrupts Interrupt vectors are 16-bit addresses =>All interrupt handlers must start in the lower 64-KB memory During an interrupt, the program counter and the status register are pushed onto the stack as shown below

CPE 323 Introduction To Embedded Computer Systems 5 PC/R0 – Program Counter The 20-bit program counter (PC/R0) points to the next instruction to be executed Each instruction uses an even number of bytes (two, four, six, or eight), and the PC is incremented accordingly. Instruction accesses are performed on word boundaries, and the PC is aligned to even addresses PC can be addressed by all instructions and all addressing modes Examples MOV.W #LABEL,PC ; Branch to address LABEL (lower 64 KB) MOVA #LABEL,PC ; Branch to address LABEL (1MB memory) MOV.W LABEL,PC ; Branch to address in word LABEL ; (lower 64 KB) ; Branch indirect to address in ; R14 (lower 64 KB) ADDA #4,PC ; Skip two words (1 MB memory)

CPE 323 Introduction To Embedded Computer Systems 6 PC/R0 – Program Counter The BR and CALL instructions reset the upper four PC bits to 0 => can access only the lower 64KB To branch beyond the lower 64-KB range use BRA or CALLA instructions Be careful: MOV.W #value,PC ; what is PC[19:16]? CALLA & RETA

CPE 323 Introduction To Embedded Computer Systems 7 SP/R1 – Stack Pointer PUSHX.A Examples MOV 2(SP),R6 ; Item I2 −> R6 MOV R7,0(SP) ; Overwrite TOS with R7 PUSH #0123h ; Put 0123h onto TOS POP R8 ; R8 = 0123h Question: Illustrate the stack contents after PUSH SP and POP SP instructions are executed?

CPE 323 Introduction To Embedded Computer Systems 8 SR/R2 – Status Register The status register (SR/R2), used as a source or destination register, can be used in the register mode only addressed with word instructions. The remaining combinations of addressing modes are used to support the constant generator.

CPE 323 Introduction To Embedded Computer Systems 9 Constant Generation Six commonly-used constants are generated with the constant generator registers R2 and R3, Adv.: No special instructions, no special code, no extra memory access Assembler uses the constant generator automatically if one of the six constants is used as an immediate source operand. Registers R2 and R3, used in the constant mode, cannot be addressed explicitly; they act as source-only registers. The constants are selected with the source-register addressing modes (As), as described below.

CPE 323 Introduction To Embedded Computer Systems 10 Constant Generation Constant generator allows for additional 24 instructions that are emulated Examples CLR dstMOV R3,dst INC dstADD 0(R3),dst

CPE 323 Introduction To Embedded Computer Systems 11 Register-Byte/Byte-Register Operation

CPE 323 Introduction To Embedded Computer Systems 12 Register-Word/Word-Register Operation

CPE 323 Introduction To Embedded Computer Systems 13 Register-Address.Word/ Address.Word-Register Operation

CPE 323 Introduction To Embedded Computer Systems 14 Addressing Modes Seven addressing modes for the source operand and four addressing modes for the destination operand can address the complete address space with no exceptions.

CPE 323 Introduction To Embedded Computer Systems 15 Addressing Modes The bit numbers in the table below describe the contents of the As (source) and Ad (destination) mode bits.

CPE 323 Introduction To Embedded Computer Systems 16 Register Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 17 Register-Indexed Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 18 Register-Indexed Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 19 Register-Indexed Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 20 Symbolic Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 21 Symbolic Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 22 Symbolic Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 23 Symbolic Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 24 Absolute Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 25 Absolute Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 26 Register Indirect Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 27 Register Indirect Autoincrement Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 28 Immediate Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 29 Immediate Addressing Mode

CPE 323 Introduction To Embedded Computer Systems 30 Instruction Set

CPE 323 Introduction To Embedded Computer Systems 31 Extended Instructions

CPE 323 Introduction To Embedded Computer Systems Core RISC Instructions

CPE 323 Introduction To Embedded Computer Systems 33 Emulated Instructions

CPE 323 Introduction To Embedded Computer Systems Total Instructions

CPE 323 Introduction To Embedded Computer Systems 35 Double operand instructions

CPE 323 Introduction To Embedded Computer Systems 36 Single Operand Instruction

CPE 323 Introduction To Embedded Computer Systems 37 Jump Instructions

CPE 323 Introduction To Embedded Computer Systems 38 3 Instruction Formats

CPE 323 Introduction To Embedded Computer Systems 39 Instruction Cycles and Lengths The number of CPU clock cycles required for an instruction depends on the instruction format and the addressing modes used - not the instruction itself The number of clock cycles refers to the MCLK

CPE 323 Introduction To Embedded Computer Systems 40 Format I: Instruction Cycles and Length

CPE 323 Introduction To Embedded Computer Systems 41 Format II and Format III: Instruction Cycles and Length Format III: all jump instructions take 2 clock cycles to execute and are 1 word long Interrupt and reset cycles

CPE 323 Introduction To Embedded Computer Systems 42 Instruction Encoding

CPE 323 Introduction To Embedded Computer Systems 43 Address Space The MSP430x1xx von-Neumann architecture has one address space shared with special function registers (SFRs), peripherals, RAM, and Flash/ROM memory as shown Memory maps are device specific Code access are always performed on even addresses. Data can be accessed as bytes or words. The addressable memory space is 64 KB with future expansion planned.

CPE 323 Introduction To Embedded Computer Systems 44 Address Space (cont’d) Special Function Registers (SFRs) Some peripheral functions are configured in the SFRs The SFRs are located in the lower 16 bytes of the address space, and are organized by byte SFRs must be accessed using byte instructions only. See the device-specific data sheets for applicable SFR bits Peripheral modules (PM) Peripheral modules are mapped into the address space Address space FFh is reserved for 16-bit PMs Should be accessed with word instructions. If byte instructions are used, only even addresses are permissible, and the high byte of the result is always 0. Address space 010h-0FFh is reserved for 8-bit PMs Should be accessed with byte instructions. Read access of byte modules using word instructions results in unpredictable data in the high byte. If word data is written to a byte module only the low byte is written into the peripheral register, ignoring the high byte.

CPE 323 Introduction To Embedded Computer Systems 45 Address Space (cont’d) RAM RAM starts at 0200h. End address of RAM depends on the amount of RAM present and varies by device. RAM can be used for both code and data Flash/ROM Start address of Flash/ROM depends on the amount of Flash/ROM present and varies by device. End address for Flash/ROM is 0FFFFh Flash can be used for both code and data. Word or byte tables can be stored and used in Flash/ROM without the need to copy the tables to RAM before using them. Interrupt vector table Is mapped into the upper 16 words of Flash/ROM address space, with the highest priority interrupt vector at the highest Flash/ROM word address (0FFFEh).

CPE 323 Introduction To Embedded Computer Systems 46 Memory Organization Word alignment Bytes are located at even or odd addresses Words are only located at even addresses Endianess (little-endian) When using word instructions, only even addresses may be used. The low byte of a word is always an even address. The high byte is at the next odd address. For example, if a data word is located at address xxx4h, then the low byte of that data word is located at address xxx4h, and the high byte of that word is located at address xxx5h.