E21 Lecture #18

Microcontrollers

Review big issues: memory structure & organization, CISC v. RISC

Architecture design issues

There are some high-level decisions you need to make when designing a microcontroller

They need to answer the three fundamental questions:

Instruction set issues

What instructions to execute? (CISC v. RISC)

The instruction sets indicate what functions the microcontroller can execute.

CISC: complex instruction set design

  • Many instructions, more complex instructions
  • Many kinds of addressing modes
  • Fewer registers
  • Specialized commands for accessing ports, running peripherals, etc.
  • Different instructions can take different amounts of time

RISC: reduced instruction set design

  • Few instructions, throw out all but the simplest ones
  • Simple addressing modes: immediate, direct, indirect (get address from a register)
  • More registers
  • Few specialized commands (if any), usually means memory-mapped I/O
I/O calls are set up so it's like addressing data memory
  • All instructions take the same amount of time

Addressing Issues

Immediate

  • Data is contained in the instruction itself

Direct

  • Data is contained in the register/memory location in the instruction

Indirect

  • Data is contained in the register/memory location pointed to by the register/memory location in the instruction

Indexed

  • Data is contained in the register/memory location pointed to by the index register plus the value in the instruction.

Organizational Issues

Harvard v. Von Neumann architecture

Harvard architecture: data and program memory are in different physical locations

  • Allows data words to have a different size than the program instructions
  • Allows data fetching independently (simultaneously) with program instruction fetching
  • Allows the program instructions to be of a different physical type of memory than data
Program instructions are in ROM/EPROM
Data is all static RAM

Von Neumann architecture: data and program memory are the same

  • Gives you greater flexibility with your programs
  • Less robust
  • Data and program instructions compete for access to the bus