Docsity

Microcontroller Memory Operations: Read/Write Modules & Timing Diagrams - Prof. Andrew Fag, Study notes of Aerospace Engineering

Partial preview of the text

Download Microcontroller Memory Operations: Read/Write Modules & Timing Diagrams - Prof. Andrew Fag and more Study notes Aerospace Engineering in PDF only on Docsity!

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Components of a Microprocessor

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Components of a Microprocessor• Memory:

  • Storage of data– Storage of a program
    • Registers: small, fast memories
      • General purpose: store arbitrary data– Special purpose: used to control the

processor

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Components of a Microprocessor• Instruction decoder:

  • Translates current program instruction into a

set of control signals

  • Arithmetic logical unit:
    • Performs both arithmetic and logical

operations on data

  • Input/output control modules

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Components of a Microprocessor• Many of these components must

exchange data with one-another

  • It is common to use a ‘bus’ for this

exchange

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Buses

  • At most one component may write to the

bus at any one time

  • Which component is allowed to write is

usually determined by the instructiondecoder (in the microprocessor case)

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Collections of Bits

  • 8 bits: a “byte”• 4 bits: a “nybble”• “words”: can be 8, 16, or 32 bits

(depending on the processor)

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Memory

What are the essential components of a

memory?

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

A Memory Abstraction

  • We think of memory as an array of

elements – each with its own address

  • Each element contains a value
    • It is most common for the values to by 8-bits

wide (so a byte)

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Memory Operations

Read

foo(A+5); reads the value from the memory locationreferenced by ‘A’ and adds the value to 5.The result is passed to a function called foo();

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Memory Operations

Write

A

writes the value 5 into the memory locationreferenced by ‘A’

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Types of Memory

Read Only Memory (ROM)• Computer

cannot

arbitrarily change state

of this memory

  • When power is lost, the contents are

maintained

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Types of Memory

Erasable/Programmable ROM (EPROM)• State can be changed under very specific

conditions (usually not when connected toa computer)

  • Our microcontrollers have an Electrically

Erasable/Programmable ROM (EEPROM)for program storage

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Today

  • Memory behavior• Atmel mega8 microcontroller• Assembly language (just a hint)• Digital I/O with the Atmel mega

Andrew H. Fagg: Embedded Real-Time Systems: Microcontrollers

Administrivia

  • Homework 2 is out
    • Due on February 14

th

(one week)