CS-280 Dr. Mark L. Hornick 1 EEPROM Memory Storing, Reading, and Writing.

Slides:



Advertisements
Similar presentations
ECE 353 Introduction to Microprocessor Systems
Advertisements

Accessing Atmega32 SRAM data memory
Chapter 5 Internal Memory
1BA3 G Lacey Lecture 51 Evaluating mathematical expressions  How do computers evaluate x + y or any mathematical expression ?  Answer : “Reverse Polish.
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 4: Operating Systems.
Overview Finite State Machines - Sequential circuits with inputs and outputs State Diagrams - An abstraction tool to visualize and analyze sequential circuits.
©Brooks/Cole, 2003 Chapter 5 Computer Organization.
Registers  Flip-flops are available in a variety of configurations. A simple one with two independent D flip-flops with clear and preset signals is illustrated.
Chapter 5 Internal Memory
Memory Devices Wen-Hung Liao, Ph.D..
I/O Subsystem Organization and Interfacing Cs 147 Peter Nguyen
IT Systems Memory EN230-1 Justin Champion C208 –
Sec (1.2): Main memory. Memory: Stores data and instructions in the beginning, intermediate and final stages of the processing.
COMPUTER MEMORY Modern computers use semiconductor memory It is made up of thousands of circuits (paths) for electrical currents on a single silicon chip.
Basic Computer Organization CH-4 Richard Gomez 6/14/01 Computer Science Quote: John Von Neumann If people do not believe that mathematics is simple, it.
Memory. When we receive some instruction or information we retain them in our memory. Similarly a computer stores the instructions for solving a problem,
F1020/F1031 COMPUTER HARDWARE MEMORY. Read-only Memory (ROM) Basic instructions for booting the computer and loading the operating system are stored in.
Instrumentation for scientists Lectures 13 & 14 Binary Arithmetic Revision: –Add –CPU operation: –Address Bus, Data Bus, ALU, Instruction Pointer, MAR,
Atmega32 Architectural Overview
CS-280 Dr. Mark L. Hornick 1 Parts of a GP Computer (Microcomputer) Contains separate Microprocessor chip Memory/Memory controller MB control chips Peripheral.
Writing an Assembly-language program Atmel assembly language CS-280 Dr. Mark L. Hornick 1.
Khaled A. Al-Utaibi Memory Devices Khaled A. Al-Utaibi
328eForth for Arduino Uno C. H. Ting February 16, 2012 SVFIG.
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 2. Computer Structure Computer Structure The traditional diagram of a computer...
Storing data in Program Memory
Introduction to Computing: Lecture 4
Revised: Aug 1, ECE 263 Embedded System Design Lesson 1 68HC12 Overview.
CS-280 Dr. Mark L. Hornick 1 Calling subroutines in assembly And using the Stack.
I/O Ports CS-280 Dr. Mark L. Hornick 1. CS-280 Dr. Mark L. Hornick 2 Ports are channels from the CPU to external hardware and software Atmega32 has: 4.
1 Microprocessor-based systems Course 6 Memory design.
CE-2810 Dr. Mark L. Hornick 1 GNU GCC Assembler and C/C++ compiler.
HARDWARE ARCHITECTURE
Memory and Storage Dr. Rebhi S. Baraka
Memory Interface A Course in Microprocessor Electrical Engineering Dept. University of Indonesia.
MEMORY INTERFACE (ROMS, RAMS). Computer Memory Overview.
Microprocessor Fundamentals Week 3 Mount Druitt College of TAFE Dept. Electrical Engineering 2007.
CE-2810 Dr. Mark L. Hornick 1 Mixing C and assembly Safety goggles on!
Microprocessor Fundamentals Week 3 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
Memory Devices 1. Memory concepts 2. RAMs 3. ROMs 4. Memory expansion & address decoding applications 5. Magnetic and Optical Storage.
Computer operation is of how the different parts of a computer system work together to perform a task.
ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 8.
Basic Concepts Computer Organization & Assembly Language Programming Instructor: Maram Alsahafi [Some of the contents Adapted from slides Dr Adnan Gutub,
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
EEPROM Memory 4K bytes of EEPROM exist on the Mega128 EEPROM exists in a separate address space Can only address single bytes using special registers EEPROM.
Objectives : At the end of this lesson, students should be able to : i.Identify the types of memory chip and their functions. ii.Define the difference.
Modified Harvard architecture 8-bit RISC single chip microcontroller Complete System-on-a-chip On Board Memory (FLASH, SRAM & EEPROM) On Board Peripherals.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 1 Looking Inside the Computer System.
PCs ENVIRONMENT and PERIPHERALS Lecture 3. operating system and other system software that control the usage of the computer equipment application programs.
“Atmega32 Architectural Overview” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Parihar Shipra A Guided By:-
“ INSTRUCTIONS SET OF AVR MICROCONTROLLER ” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Abhishek Lakhara
Components of Computer. Memory Unit Most important part of the computer Used to store data and instructions that are currently in use Main memory consists.
INTRODUCTION TO AVRASSEMBLY PROGRAMMING
MEMORY BYTES. MEMORY BYTES MEMORY MEMORY OUR Internal External.
Hoda Roodaki BIT ADDRESSABILITY Hoda Roodaki
Introduction to Smart Systems
Atmega32 Architectural Overview
EEPROM Memory 4K bytes of EEPROM exist on the Mega128
Internal Memory.
Memory Units Memories store data in units from one to eight bits. The most common unit is the byte, which by definition is 8 bits. Computer memories are.
Chapter 11 Sequential Circuits.
Subject Name: Embedded system Design Subject Code: 10EC74
Memories.
Architectural Overview
Microprocessors And Microcontrollers
Introduction to Computing Chapter 0
COMP2121: Microprocessors and Interfacing
Tim Sumner, Imperial College, Rm: 1009, x47552
Advanced Assembly Chapter 6
MICROPROCESSOR MEMORY ORGANIZATION
Presentation transcript:

CS-280 Dr. Mark L. Hornick 1 EEPROM Memory Storing, Reading, and Writing

CS-280 Dr. Mark L. Hornick 2 Atmega32 Memory Address bus (16-bit in Atmega32) A unique 16-bit address references each memory byte. Data bus (8-bit) Volatile – RAM (fast RW) SRAM (temp data store) DRAM  Nonvolatile – ROM (fast R – slow W)  ROM  PROM  EPROM  EEPROM (permanent data store)  Flash ROM (program store)

CS-280 Dr. Mark L. Hornick 3 EEPROM is non-volatile memory Power does not have to be supplied to maintain values stored in EEPROM EEPROM values are maintained when power is shut off EEPROM is (generally) not affected if Program Memory is rewritten (new program loaded) EEPROM can be written/erased at least 100,000 times

CS-280 Dr. Mark L. Hornick 4 EEPROM Memory Addressing EEPROM is organized and accessed in bytes, as in SRAM There are 1024 bytes of EEPROM Each byte has a unique 16-bit address But since there are only 1024 bytes of EEPROM, only 10 bits are used The first byte of EEPROM is at address 0x0000 As compared to SRAM, which starts at 0x0060 Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 0x0000 0x0001 0x0002 0x0003 0x x03FE 0x03FF Byte 1022 Byte 1023

CS-280 Dr. Mark L. Hornick 5 Data can be stored in EEPROM via the.db directive.ESEG ; switch further directives to EEPROM segment.ORG0x0000 ; set addr for start of EEPROM x1:.db 1,5 ; alloc 2 bytes in EEPROM with initial values of 1 and 5 title:.db ‘c’,’e’,’2’,’8’,’0’, ‘0’,0 ; allocate 7 bytes in EEPROM course:.db “CE-2800”, 0 ; allocate 8 bytes in EEPROM Note assembler does NOT automatically insert a NULL char at the end of the string The.db n,m,… (“define byte”) directive tells the assembler to allocate and store the bytes n,m… in EEPROM The initial values of the memory are specified, as with Program Memory

The AVR Assembler creates a separate file (with the.EEP extension) containing EEPROM data You have to load the EEPROM values as a separate step in AVR Studio Recall: The.HEX file contains opcodes for the program as well as Flash memory data CS-280 Dr. Mark L. Hornick 6

Downloading EEPROM data in AVR Studio From the Debug menu, select the “Up/Download Memory” command The debugger must be running for this command to become enabled The EEPROM data is in an “.eep” file, NOT the “.hex” file CS-280 Dr. Mark L. Hornick 7

CS-280 Dr. Mark L. Hornick 8 Reading data from EEPROM There are no specific instructions to load (read) data from EEPROM Instead, EEPROM is accessed as if it were an I/O Subsystem EEPROM is accessed via Special-purpose I/O Registers EECR – Control Register EEARH – Address Register (high 2 bits) EEARL – Address Register (low 8 bits) EEDR - Data Register

Using EEPROM I/O Registers to read EEPROM data CS-280 Dr. Mark L. Hornick 9.ESEG; put data in EEPROM values:.db 1,2,3,4,5.CSEG CLRtemp OUTEECR, temp ; clear EECR bits ; load the address of EEPROM data we want to read LDI ZL, LOW(values) ; low 8 bits of the address LDI ZH, HIGH(values) ; high 2 bits OUTEEARL, ZL; set EEPROM address OUTEEARH, ZH ;next, tell the EEPROM we want to read it SBIEECR, 0; set EERE=1 (read enable) ; after SBI, the EEPROM value is in the EEDR register ; finally, move the value in EEDR to a regular register INtemp, EEDR ; move data to temp register

Using EEPROM I/O Registers to write EEPROM data CS-280 Dr. Mark L. Hornick 10.ESEG; reserve space in EEPROM values:.byte 5.CSEG CLRtemp OUTEECR, temp ; clear EECR bits ; load the address of EEPROM data we want to write LDI ZL, LOW(values) ; low 8 bits of the address LDI ZH, HIGH(values) ; high 2 bits OUTEEARL, ZL; set EEPROM address OUTEEARH, ZH Wait: SBIC EECR, 1 ; check if EEWE is clear (write not in progress) RJMP wait ; loop back if not clear (takes several ms) LDItemp, ‘a’ ; the value to be written to EEPROM OUTEEDR, temp ; move the value to EEDR SBIEECR, 2; bit EEMWE: master write enable ; note: EEMWE is cleared automatically after 4 clock cycles SBIEECR, 1 ; bit EEWE: clr’d automatically after write EEWE is cleared automatically after the byte is actually written, but each EEPROM write takes several ms, so EEWE will remain set for some time