Skip to Content

The 68HC11 Microcontroller

The 68HC11 Microcontroller

We just called the HC11 a microcontroller. Why? Well, it has the processor, the memory, and the I/O capability all embedded onto a single chip. This makes it a cheap solution to controlling fairly small systems, like microwaves or other such things.

Let's talk specifics:

The HC11 is an 8-bit processor

  1. It computes (mostly) in bytes
  2. It fetches only a byte at a time from memory or I/O (i.e., it has an 8-bit data bus)

It uses 16 bit addresses

  1. How much memory can it address?

Registers:

Two 8-bit accumulators, A and B.

  1. accumulator is the historical name for a register used in arithmetic operations

A 16-bit accumulator, D

  1. But, this is actually A and B concatenated together
  2. If A or B changes, D changes, and vice versa!

Two 16-bit index registers, X and Y.

  1. They are used to index memory, like an array

A 16-bit stack pointer, SP

  1. What's a stack? We'll learn

A 16-bit program counter, PC

  1. Remember, this holds the address of the current instruction being executed

An 8-bit condition code register, CCR

  1. Used to make decisions (if-then, while, etc.)

The HC11 Memory

The HC11 uses 16-bit addresses, so it can potentially address 64Kbytes of memory

But, it doesn't really have that much memory

  1. Some addresses just don't have memory associated them -- nothing is there!

So where is there actual memory, and what kind is it?

Addresses $0000 to $00FF is RAM memory

  1. How much is this?
  2. This is "regular" read/write memory, useful for variables

Addresses $F800 to $FFFF is EEPROM memory

  1. How much is this?
  2. This memory can be loaded with values, but can't be changed during program execution
  3. This is useful for loading a program, and constants, into memory, then executing it.

Addresses $FFC0 to $FFFF are interrupt vectors

  1. Tells the CPU what to do when something exceptional happens
  2. E.g., $FFFE/$FFFF contains the address for the CPU to go to when it first starts up, or is reset by a switch.

Addresses $1000 to $100F are special control registers

  1. Not really memory, but values to control how the processor behaves
  2. And to do I/O. The I/O is "memory-mapped" because it takes up space in the memory address space.

So, much of the address space is empty (physically, there is no memory there!), and really only 256 bytes of memory is RAM! That is not much space for data, eh?

Addressing Modes

We have load and store instructions to get data to and from memory. To make certain types of programming easier, such as accessing an array of data, the HC11 supports several different addressing modes, or ways of accessing memory locations. More is on the next lecture's web page.