Lecture 5. AT91 - Memory Map, Timers, and AIC -

Slides:



Advertisements
Similar presentations
Computer Science Education
Advertisements

S04: MSP430 Microarchitecture
Computer Science & Engineering
Interrupts, Timer, and Interrupt Controller
MC68HC11 System Overview. System block diagram (A8 version)
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM553 Special Topics in Computer Science 1.
Processor System Architecture
CS-334: Computer Architecture
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
CSS 372 Oct 2 nd - Lecture 2 Review of CSS 371: Simple Computer Architecture Chapter 3 – Connecting Computer Components with Buses Typical Bus Structure.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
1 ECE 263 Embedded System Design Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System.
Architecture of the 8051 INTERNAL DATA BUS Oscillator & Timing Programmable I/O (32 Pins) 80C51 CPU 64K byte Expansion Control Serial I/O 4K Program Memory.
Software Development and Software Loading in Embedded Systems.
Microcontroller based system design
6. The CPU and Memory Chapt. 7.
NS Training Hardware. System Controller Module.
INPUT-OUTPUT ORGANIZATION
ECE/CS-352: Embedded Microcontroller Systems Embedded Microcontroller Systems.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Lecture 2. General-Purpose (GP) Computer Systems Prof. Taeweon Suh Computer Science Education Korea University COMP427 Embedded Systems.
Lecture 1. Number Systems Prof. Taeweon Suh Computer Science Education Korea University ECM585 Special Topics in Computer Design.
Lecture 2. General-Purpose (GP) Computer Systems Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
created by :Gaurav Shrivastava
Multiplexed External Bus Interface-MEBIV3 By: Prof. Mahendra B. Salunke Asst. Prof., Department of Computer Engg., SITS, Pune-41
Spring EE 437 Lillevik 437s06-l8 University of Portland School of Engineering Advanced Computer Architecture Lecture 8 Project 3: memory agent Programmed.
AT91 Embedded Peripherals
Lecture 4. Miscellaneous Addressing Mode, Memory Map, Pointer, and ASCII Prof. Taeweon Suh Computer Science Education Korea University ECM534 Advanced.
Lecture 3. Virtual Platform and ARM Intro. Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
ECP2036 Microprocessor and Interfacing Registers Control & Status Registers Program Counter User-Visible Registers Instruction Register... General-Purpose.
Lecture 7. Instructions and High-Level to Machine Code Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Lecture 3. APIC ID Prof. Taeweon Suh Computer Science Education Korea University COM509 Computer Systems.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Lecture 8. MIPS Instructions #2 – Memory Access (Load/Store) Instructions Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer.
Lecture 4. MIPS Instructions #2 Memory Access (Load/Store) Instructions Prof. Taeweon Suh Computer Science Education Korea University ECM534 Advanced Computer.
SOC Consortium Course Material Core Peripherals National Taiwan University Adopted from National Chiao-Tung University IP Core Design.
Microcontrollers Class : 4th Semister E&C and EEE Subject Code: 06ES42
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the Direct Memory.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University ECM583 Special Topics in Computer Systems.
Lecture 1. General-Purpose Computer Systems
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Lecture 7: Overview Microprocessors / microcontrollers.
I/O Interface. INTRO TO I/O INTERFACE I/O instructions (IN, INS, OUT, and OUTS) are explained. Also isolated (direct or I/O mapped I/O) and memory-mapped.
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
Execution Architecture MTT CPU08 Core M CPU08 INTRODUCTION.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
January 8, 2001 SPC Tutorial 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Agenda 9:00 SPC Hardware -- John DeHart 9:45 SPC Software -- John DeHart 10:30.
Lecture 2. General-Purpose Computer Systems Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
MICROPROCESSOR INTEL 8086/8088 BY: SERA SYARMILA SAMEON.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Introduction to Microcontroller Technology
Lecture 2. A Computer System for Labs
COURSE OUTCOMES OF Microprocessor and programming
Timer and Interrupts.
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
8085 Microprocessor Architecture
CS703 - Advanced Operating Systems
Introduction to Microprocessors and Microcontrollers
8085 Microprocessor Architecture
8085 Microprocessor Architecture
Computer Architecture Assembly Language
Presentation transcript:

Lecture 5. AT91 - Memory Map, Timers, and AIC - ECM586 Special Topics in Embedded Systems Lecture 5. AT91 - Memory Map, Timers, and AIC - Prof. Taeweon Suh Computer Science Education Korea University

Program Execution in CPU ARM (CPU) PC (R15) R0 R1 R2 R3 R14 R15 … 32 bits Registers 0x0000 0x0000 0x0004 0x0004 0x0008 0x0008 Memory Address Bus 0x00110011 0x00220022 0x00220022 0x00110011 0x0018 0x0014 0x0008 0x0004 0x0000 + 0x0018 0x0014 0x00110011 0x00220022 0x00330033 Data Bus add r2, r2, r3 ldr r3, [r5] ldr r2, [r4] add r2 ,r2, r3 ldr r3, [r5] ldr r2, [r4]

Memory in Graphics card Memory Map Memory map indicates how memory space is laid out Examples: Where the main memory is located in the memory space Where I/O devices are located in the memory space Memory-mapped I/Os: To access registers in I/O devices, CPU should access a memory space allocated for the I/O devices Memory map depends on the size of the address bus If address bus is 32-bit wide, memory space is 4GB If address bus is 48-bit wide, memory space is 256TB Suppose that the address bus is 32-bit wide 0xFFFF_FFFF Memory Space BIOS ROM CPU North Bridge South Bridge Main Memory (DDR) FSB (Front-Side Bus) DMI (Direct Media I/F) 0xE000_0000 0x7FFF_FFFF Memory in Graphics card 0x7000_0000 Main memory (1GB) 0x3FFF_FFFF Byte address 0x00000000

Memory Map in AT91 Memory Map is mostly defined by hardware provider Like you need a map to find places, CPU needs “map” to access memory or hardware devices Depending on CPU, the size of the memory map is determined For example: if your CPU is 32-bit CPU, it would have 4GB (232) memory space (memory map) If your CPU is 64-bit CPU, it would have 16EB (264)? Yeah, but it depends on how many physical address lines come out of CPU..

On-chip Peripheral Map in AT91

AT91 Block Diagram CPU provide ISA (Instruction Set Architecture) ISA means instructions CPU provides If you are programming directly with instructions, you are doing assembly programming After compiling your assembly program, the linker combines objects and library files, relocates their code and data and tie up symbol references

Linker Script Example Open “Makefile” in lab 2 “make” utility makes your life easier Default input file for “make “is “Makefile” Type “man make” to see the detailed info in Linux or Google-search it with, for example, “make linux” “ld” is the GNU linker and “arm-linux-ld” is the GNU linker for ARM cross-compilation The final binary (=executable) “timerirq” in the following case contains information about where (which address) your code and data are located

Example Linker Script Check out the Lab source code Hello.lds This script locates your program (text) from address 0x0000_0000, where ROM is located Data section in your program is located, aligned at 8KB (8192) boundary

Program Execution Path in H/W ARM CPU core Address Bus EAX R15 …. ALU R1 R0 32-bit 0x003F_FFFC 0x003F_FFF8 0x0000_0020 ….. 0x0000_0004 0x0000_0000 ROM 32-bit ldr sp, irq_stack (=E59F_D08C) msr CPSR, … (=E321_F0D2) Data Bus B . (=EAFF_FFFE) B reset (=EA00_0006)

Interrupt Enable Register (0x24) Timers in AT91 There are 3 counter channels in AT91 2 modes of operation: Capture mode and Waveform mode clock 16-bit counter (incrementing) ? Register A (RA) (0x14) ? Register B (RB) (0x18) Reset 1. SWTRG: TC_CCR (0x00) 2. SYNC: external signal 3. RC: if RC == counter value ? Register C (RC) (0x1C) Counter Value (0x10) Status Register (0x20) Interrupt Enable Register (0x24) Base Address: 0xFFFE_0000 Status Register: RA, RB, RC compare status etc

Capture Mode in Timers (AT91) TIOA Capture the counter value at which edge of TIOA (LDRA in TC_CMR) clock 16-bit counter (incrementing) ? Register A (RA) (0x14) Capture the counter value at which edge of TIO (LDRB in TC_CMR) Register B (RB) (0x18) reset ? Register C (RC) (0x1C) WAVE = 0 in TC_CMR (0x04) Counter Value (0x10) Status Register (0x20) Interrupt Enable Register (0x24) RC Compare Interrupt

Waveform Mode in Timers (AT91) TIOA clock 16-bit counter (incrementing) ? Register A (RA) (0x14) TIOB Register B (RB) (0x18) Waveform (PWM: Pulse Width Modulation) reset ? Register C (RC) (0x1C) WAVE = 1 in TC_CMR (0x04) Counter Value (0x10) Status Register (0x20) Interrupt Enable Register (0x24) RA, RB, RC Compare Interrupts

Interrupt Controller (INTC) Typically, a computer system (including embedded systems) has an interrupt controller x86-based computer system (general-purpose computer system) has 3 interrupt controllers! Local APIC (Advanced Programmable Interrupt Controller) I/O APIC 8259 Interrupt controller receives interrupt requests from I/O devices and sends a interrupt signal to CPU x86 allocates 2 input pins for interrupt: INTR, NMI ARM provides 2 input pins as well: nIRQ, nFIQ Interrupt controller provides registers with which programmers can Assign priority to each interrupt source Mask specific interrupt inputs

INTC in a System … … … nIRQ Priority Control ARM Interrupt Masking SoC (System-on-a-Chip) External Inputs (Keyboard) Serial Port (UART) Interrupt Controller nIRQ nFIQ Timers ARM Priority Control Interrupt Masking … Watchdog Timer … … Wireless NIC (Network I/F Card)

AIC (Advanced Interrupt Controller) in AT91 Base Address: 0xFFFF_F000 Set Priority US0_IRQ nIRQ SMR 0 (0x000) Source Vector Register 0 (0x080) US1_IRQ nFIQ SMR 1 (0x004) Source Vector Register 1 (0x084) TC0_IRQ SMR 2 (0x008) Source Vector Register 2 (0x088) TC1_IRQ IRQ Vector Reg (0x100) ….. ….. TC2_IRQ FIQ Vector Reg (0x104) SMR 29 (0x074) Source Vector Register 29 (0x0F0) IRQ0_IRQ SMR 30 (0x078) Source Vector Register 30 (0x0F8) IRQ1_IRQ SMR 31 (0x07C) Source Vector Register 31 (0x0FC) IRQ2_IRQ Interrupt Enable Reg (0x120) End of Interrupt Reg (0x130)