Memory Expansion. Lecture Embedded Systems

Similar documents
8051 INTERFACING TO EXTERNAL MEMORY

Chapter 2: Fundamentals of a microprocessor based system

Chapter TEN. Memory and Memory Interfacing

ECEN 449 Microprocessor System Design. Memories. Texas A&M University

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

Introduction read-only memory random access memory

Embedded Systems Design: A Unified Hardware/Software Introduction. Outline. Chapter 5 Memory. Introduction. Memory: basic concepts

Embedded Systems Design: A Unified Hardware/Software Introduction. Chapter 5 Memory. Outline. Introduction

EE251: Thursday November 15

Chapter 5 Internal Memory

ECEN 449 Microprocessor System Design. Memories

Computer Organization. 8th Edition. Chapter 5 Internal Memory

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

Summer 2003 Lecture 18 07/09/03

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

Allmost all systems contain two main types of memory :


Address connections Data connections Selection connections

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

UMBC. Select. Read. Write. Output/Input-output connection. 1 (Feb. 25, 2002) Four commonly used memories: Address connection ... Dynamic RAM (DRAM)

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

4-Megabit (512K x 8) 5-volt Only CMOS Flash Memory AT49F040 AT49F040T AT49F040/040T AT49F040/040T. Features. Description. Pin Configurations

Grundlagen Microcontroller Memory. Günther Gridling Bettina Weiss

Computer Organization and Assembly Language (CS-506)

Read Only Memory ROM

Chapter 4 Main Memory

Internal Memory. Computer Architecture. Outline. Memory Hierarchy. Semiconductor Memory Types. Copyright 2000 N. AYDIN. All rights reserved.

Memory Overview. Overview - Memory Types 2/17/16. Curtis Nelson Walla Walla University

William Stallings Computer Organization and Architecture 8th Edition. Chapter 5 Internal Memory

EE 308: Microcontrollers

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Introduction to general architectures of 8 and 16 bit micro-processor and micro-controllers

32-megabit DataFlash + 4-megabit SRAM Stack Memory AT45BR3214B

ECSE-2610 Computer Components & Operations (COCO)

Module 5a: Introduction To Memory System (MAIN MEMORY)

Semiconductor Memories: RAMs and ROMs

1-megabit (64K x 16) 5-volt Only Flash Memory AT49F1024A Features Description Pin Configurations

Read and Write Cycles

Memories. Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu.

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

APPLICATION NOTE 26 DS89C430/DS89C450 Ultra High-Speed Flash Microcontroller Memory Interface Timing

chapter 8 The Memory System Chapter Objectives

! Memory Overview. ! ROM Memories. ! RAM Memory " SRAM " DRAM. ! This is done because we can build. " large, slow memories OR

The D igital Digital Logic Level Chapter 3 1

RTL Design (2) Memory Components (RAMs & ROMs)

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (5 th Week)

CHAPTER TWELVE - Memory Devices

Computer Memory. Textbook: Chapter 1

Very Large Scale Integration (VLSI)

Contents. Main Memory Memory access time Memory cycle time. Types of Memory Unit RAM ROM

8051 Microcontroller

Interconnects, Memory, GPIO

Memory & Simple I/O Interfacing

Menu. word size # of words byte = 8 bits

Design and Implementation of an AHB SRAM Memory Controller

Am186ER/Am188ER AMD continues 16-bit innovation

CS 320 February 2, 2018 Ch 5 Memory

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

AT49BV004(T) TSOP Top View Type 1 1. AT49BV4096A(T) TSOP Top View Type 1 A16 BYTE GND I/O7 I/O14 I/O6 I/O13 I/O5 I/O12 I/O4 VCC I/O11 I/O3 I/O10 I/O2

CPEG300 Embedded System Design. Lecture 3 Memory

FIGURE Three EPROMs interfaced to the 8088 microprocessor.

Lecture 13: Memory and Programmable Logic

ECE 485/585 Microprocessor System Design

Memory Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Memory Systems for Embedded Applications. Chapter 4 (Sections )

Chapter 5. Internal Memory. Yonsei University

Semiconductor Memory Classification. Today. ESE 570: Digital Integrated Circuits and VLSI Fundamentals. CPU Memory Hierarchy.

Memory and Programmable Logic

Memory technology and optimizations ( 2.3) Main Memory

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458

AT25PE40. 4-Mbit DataFlash-L Page Erase Serial Flash Memory ADVANCE DATASHEET. Features

ORG ; Week8. Memory and Memory Interfacing

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

The Memory Hierarchy Part I

Storage Technologies and the Memory Hierarchy

Large and Fast: Exploiting Memory Hierarchy

AT45DB041E. 4-Mbit DataFlash (with Extra 128-Kbits), 1.65V Minimum SPI Serial Flash Memory. Features

AT45DB321E. Features. 32-Mbit DataFlash (with Extra 1-Mbits), 2.3V Minimum SPI Serial Flash Memory

Random-Access Memory (RAM) CS429: Computer Organization and Architecture. SRAM and DRAM. Flash / RAM Summary. Storage Technologies

Section 6. Memory Components Chapter 5.7, 5.8 Physical Implementations Chapter 7 Programmable Processors Chapter 8

Memory classification:- Topics covered:- types,organization and working

ECE 341. Lecture # 16

Memory. Outline. ECEN454 Digital Integrated Circuit Design. Memory Arrays. SRAM Architecture DRAM. Serial Access Memories ROM

Memory Challenges. Issues & challenges in memory design: Cost Performance Power Scalability

Latches. IT 3123 Hardware and Software Concepts. Registers. The Little Man has Registers. Data Registers. Program Counter

HM628128BI Series. 131,072-word 8-bit High speed CMOS Static RAM

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

Components of a personal computer

EE251: Tuesday December 4

a) Memory management unit b) CPU c) PCI d) None of the mentioned

Magnetic core memory (1951) cm 2 ( bit)

HT CMOS 2K 8-Bit SRAM

Transcription:

Memory Expansion Lecture 22 22-1

In These Notes... Memory Types Memory Expansion Interfacing Parallel Serial Direct Memory Access controllers 22-2

Memory Characteristics and Issues Volatility - Does it remember when the power fails? Persistence - How long does it remember when there is power? Speed How quickly can it be read or written? Reprogrammability Cost Speed is often an issue for nonvolatile memories Maximum number of W/E cycles Programming voltage Temperature Sensitivity - EPROMs forget at high temperatures 22-3

Types of Memory - ROM Mask PROM A custom ROM mask pattern is created Large minimum order, NRE costs Program by burning fuses. Apply a high voltage for a certain amount of time. Not erasable UV EPROM Program by squeezing charge into floating transistor gate with high voltage Erase entire memory at once with UV radiation 22-4

Types of Memory - EEPROM EEPROM Can erase a byte at a time electrically Limited reprogrammability: e.g. 100,000 cycles Slow programming (up to 10 ms per byte) Flash EEPROM Can erase entire chip, or just certain blocks May have limited reprogrammability: e.g. 1,000 cycles for some low-end units May have slow programming Serial or parallel interface 22-5

Types of Memory - RAM SRAM Use two or six transistors per bit Fast - 10 ns or less DRAM Use one transistor per bit Acts like a capacitor, discharges in a few milliseconds Incredibly cheap, but need to refresh each bit periodically Slower than SRAM - 60 ns Tricks to speed up access (e.g. page mode) 22-6

Parallel Memory Interface 1920 bytes are not enough for our data logger! We want to store up to 32 kbytes of data Choose a microcontroller with more memory? Not available, or too expensive Instead choose a microcontroller with a memory expansion mode M16C/62 Modes for M16C/62 MCU 22-7

SRAM Example IDT71256L 32k x 8 SRAM 22-8

IDT71256L Read Timing Symbol Parameter Minimum (ns) Maximum (ns) t RC Read Cycle Time 20 - t AA Address Access time - 20 t OLZ Output Enable to Output in Low-Z 2 - t OE Output Enable to Output Valid - 10 t OHZ Output Disable to Output in Hi-Z 2 8 22-9

IDT71256L Write Timing Symbol Parameter Minimum (ns) Maximum (ns) t wc Write Cycle Time 20 - t AW Address Valid to End-of-Write 15 - t WP Write Pulse Width 15 - t AS Address Set-Up Time 0 - t DW Data to Write Time Overlap 11 - t DH Data Hold from Write Time 0-22-10

External Memory Access Separate Buses D7-D0 A14-A0 MCU D7-D0 A15-A0 ~WR ~RD A15 ~WR ~RD Read I/O7-I/O0 A14-A0 SRAM ~CS ~WE ~OE Data from SRAM Adx from MCU Chip Select Partial vs. Full Decoding Power Consumption Write Data from MCU Adx from MCU 22-11

External Memory Access Multiplexed Buses AD7-AD0 ALE A14-A8 MCU AD7-AD0 A15-A8 Latch Out ALE ~WR ~RD A15 ~WR ~RD Read Hi Adx from MCU I/O7-I/O0 A7-A0 A14-A8 SRAM ~CS ~WE ~OE Use a latch to hold the low byte of the address Saves pins Write Low Adx SRAM D Low Adx MCU D Low Adx from MCU Hi Adx from MCU Low Adx from MCU 22-12

Multiple External Memories D7-D0 I/O7-I/O0 I/O7-I/O0 I/O7-I/O0 A14-A0 A14-A0 MCU SRAM 1 A14-A0 SRAM 2 A14-A0 A16-A15 ~CS ~CS ~CS ~WR ~WE ~WE ~RD ~OE ~OE ~OE ROM 1 0 1 2 Decoder Decoder selects a single memory chip Output 0 active when A16:A15 = 00. Address = 0 0xxx xxxx xxxx xxxx = 00000h to 07FFFh Output 1 active when A16:A15 = 01. Address = 0 1xxx xxxx xxxx xxxx = 08000h to 0FFFFh Output 2 active when A16:A15 = 10. Address = 1 0xxx xxxx xxxx xxxx = 10000h to 17FFFh 22-13

Issue Bus Loading Microcontroller has a limited output drive capacity on the data and address buses e.g. 100 pf for an AMD MCU Each device on the bus adds capacitance 11 pf for each input on IDT SRAM chip This leads to increased time delay until bus reaches valid voltage M16C lowers threshold voltages when accessing external memory Solution: add buffers 22-14

Issue - The Memory Wall Difference in read cycle times for memories Internal memories SRAM: blazingly fast Flash: down to 40 ns External parallel-interface memories SRAM: down to 10 ns Flash: down to 55 ns Memory Wall: flash memory can t keep up with fast processors External flash: 1/55 ns = 18 MHz Internal flash: 1/40 ns = 25 MHz Need a mechanism to speed up access to data stored in flash memory 22-15

Solutions to the Embedded Memory Wall Code shadowing Cache Use flash memory to hold the program At boot-time load the program into faster SRAM Execute the program out of SRAM Problem: extra memory costs money Use a small fast SRAM with a cache controller to hold commonly used data Problem: unpredictable access times make it hard to guarantee predictable timing (e.g. real-time is difficult) Wider bus to memory Access multiple (e.g. four bytes) at a time. Fetching byte N also prefetches bytes N+1, N+2 and N+3 Works well for sequential accesses Problem: Still incurs a delay for random accesses (e.g. branch) Branch target cache Cache multiple bytes from targets of branch instructions Problem: Unpredictable access times. But may be able to lock cache. Could also cache the beginning of all ISRs 22-16

Storing Large Amounts of Data What if we want to store more data than fits into our processor s address space? A. Use a memory paging scheme Use a register (or output port) to hold the upper bits of the address This register selects which page of memory we will access Control the register with a page select function This doesn t fit in well with C, as the compiler doesn t know about your custom paging scheme Some MCUs support paging, and the compilers can compile for it B. Use a serially-interfaced memory (inexpensive) Communicate with the memory over a few data lines C compiler doesn t know about this memory either May want to introduce some kind of file system to manage information in the expanded memory 22-17

Serial Interface Flash RESET input allows the System to Terminate Any Operation NOR Flash Memory Array with Small Pages RDY/BSY RDY/BSY output provides the device status Write Protect Provides method to protect a portion of the memory Array RESET WP FLASH MEMORY ARRAY PAGE SIZE = BUFFER SIZE Multiple Data Paths for Reading and Writing Chip Select Input allows multiple devices on the same bus DataFlash TM (Atmel) CS BUFFER 1 BUFFER 2 SPI compatible Serial Interface I/O INTERFACE SI SO SCK Dual SRAM Buffers to provide enhanced flexibility and simultaneous read or write operations High Speed Clock 22-18

Details for DataFlash Numbers 1 Mbit 128 Mbit capacities available Page sizes from 264 to 1056 bytes up to 20 MHz SPI interface speed Page->Buffer transfer/compare: < 250 us Page erase: < 8 ms Page program: < 14 ms C source code for interface available Flash file system (FAT12 and FAT16) Compression/decompression Error detection and correction Wear leveling Automatic page rewrite Commands (hardware) Page read Transfer page to buffer Compare page with buffer Buffer read, write Program page from buffer (with or without erasing) Program page through buffer Page erase Block erase (8 pages) Automatic page rewrite 22-19

Moving Data Efficiently Sometimes we just need to move data Loading a packet from an Ethernet interface Loading a video frame buffer Initializing an array to zero Loading an audio output buffer with audio samples Very slow when performed in software Loop: mov.w _source[a0], _dest[a1] add.w #2, A0 ; increment src. ptr add.w #2, A1 ; increment dest. ptr cmp.w A0, R0 ; assume R0 is end ptr jle Loop Consider a UART ISR which takes 50 cycles Actually just need to move a byte from the UART to a buffer 50 cycles/16 MHz = 3.125 us Limits us to maximum 320 khz bit rate (100% CPU utilization) 22-20

Direct Memory Access Sequence of activities Controller takes bus from CPU Performs data transfer Can interrupt CPU to signal completion Control Registers Start and destination addresses Transfer length Status DMA Controller preempts CPU, may need to interleave accesses to ensure progress for CPU UART DMA: 2 cycles At 320 kbps, CPU utilization = 320 khz * 2/16 MHz * 100% = 4% utilization 22-21

M16C/62 DMA Controllers 2 DMACs, 0 and 1 Control Registers Source Address SAR0, SAR1 Destination Address DAR0, DAR1 Transfer Count TCR0, TCR1 DMA Request Cause INT1, Timer, software trigger, UART Tx, UART Rx, A/D conversion complete Transfer mode Enable Byte or word transfer Single or repeat transfer Source address increment or fixed Destination address increment or fixed 22-22