eet 2261 n.
Skip this Video
Download Presentation
EET 2261

Loading in 2 Seconds...

play fullscreen
1 / 37

EET 2261 - PowerPoint PPT Presentation

  • Uploaded on

EET 2261. Microprocessors Professor Nick Reeder. Reminders. Please turn off cell phones. No food or soft drinks in the classroom. Stow water bottles at floor level. EET 2261 Unit 1 Introduction and HCS12 Overview. Read Almy , Sections 1 & 2. Homework #1 and Lab #1 due next week.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'EET 2261' - thelma

Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
eet 2261

EET 2261


Professor Nick Reeder

  • Please turn off cell phones.
  • No food or soft drinks in the classroom.
  • Stow water bottles at floor level.
eet 2261 unit 1 introduction and hcs12 overview
EET 2261 Unit 1Introduction and HCS12 Overview
  • Read Almy, Sections 1 & 2.
  • Homework #1 and Lab #1 due next week.
  • Quiz next week.

Roles of the Microprocessor

  • The microprocessor is the heart of a computer system. It performs the following functions:
    • Fetches instructions from memory.
    • Decodes and executes the instructions. This typically involves:
      • Transferring data to/from memory or I/O devices.
      • Performing arithmetic or logical operations on data.
    • Provides timing and control signals for all other elements in the computer.
    • Responds to interrupts (requests from I/O devices).

Some Popular Microprocessors

  • Dozens of companies design and manufacture microprocessors. Two of the most successful:
    • Intel
      • 4004, 8008, 8086, 80286, 80386, Pentium, Celeron, Itanium, Xeon, Core 2, …
    • Freescale(formerly Motorola)
      • 6800, 68000, PowerPC, …


  • A microcontroller is a specialized microprocessor with less computational power than general microprocessors.
  • Contains ROM, RAM, I/O ports on the same chip as the processor.
  • Widely used in embedded applications, where it is dedicated to a specific, unchanging control task.
    • Examples: inside cars, smartphones, dishwashers, microwave ovens, toys, ….

Some Popular Microcontrollers

  • Dozens of companies design and manufacture microcontrollers. Some of the most successful:
    • Intel
      • 8051
    • Freescale(formerly Motorola)
      • 68HC11, 68HC12, HCS12, …
    • Microchip Technology
      • PIC16, PIC18, PIC32, …
    • Atmel
      • 8-bit AVR, 32-bit AVR, …

Three Big Topics

  • In this course you'll learn a lot about the following three topics:
    • HCS12 microcontroller
    • Dragon12 trainer
    • CodeWarrior software

Big Topic #1: HCS12 Microcontroller

  • The HCS12, manufactured by Freescale (formerly Motorola) is a popular microcontroller.
  • Freescale makes many variations of this chip. The one we’ll work with is in the HCS12D “family,” and it’s called the MC9S12DG256.
  • It’s a 112-pin chip, and it’s farmore complicated than any chip you’ve studied in previous courses.

Big Topic #2: Dragon12 Trainer

  • Our HCS12 chip is mounted on a trainer board called the Dragon12-Plus2, manufactured by EVBplus.
  • The HCS12 chip on this board is already connected to many peripheral devices:
    • Switches
    • LEDs
    • Keypad
    • 7-segment displays
    • Temperature sensor
    • Speaker
    • and more.

Big Topic #3: CodeWarrior

  • To program the HCS12 chip, we’ll use Freescale’s CodeWarrior IDE, which runs on a personal computer.
  • This is very powerful, complex software.
  • The professional edition is expensive, but you can download a free “special edition,” intended for students, from Freescale’swebsite.

What’s an IDE?

  • People who program microcontrollers need to use several computer applications:
    • One to type their program
    • Another to check for errors and translate their program to machine code
    • Another to download the machine code to the chip
  • An integrated development environment (IDE), such as CodeWarrior, combines all of these tasks into a single program.

Reference Documents

  • Datasheets for the HCS12 microcontroller, manufactured by Freescale Semiconductor.
  • User’s manual and schematic diagram for the Dragon12-Plus2 board, manufactured by EVBplus.
  • Users Guide for CodeWarrior, manufactured by Freescale Semiconductor.

Review: Binary & Hex

  • Recall that any positive integer can be written in decimal notation, binary notation, or hexadecimal notation.
    • Example: 1510 = 11112 = F16
  • You must memorize the binary and hex notation for numbers from 0 to 15.
    • Use my games page for practice.
  • You must also know how to convert between decimal and binary (or vice versa) for larger numbers.

Binary & Hex Prefixes

  • Instead of subscripts, we’ll use prefixes to specify whether a number is in decimal, binary, or hex notation:
    • No prefix means decimal
    • % prefix means binary
    • $ prefix means hex
  • Example: 15 = %1111 = $F

Terms for Units of Data

  • Bit: The smallest unit of digital data, a single 1 or 0.
  • Byte: A group of 8 bits.
  • Nibble: A “half-byte”: a group of 4 bits.
  • Word: 2 bytes (or 16 bits).

Review: ASCII Codes

  • Recall that ASCII is a code for representing text using binary numbers. Each character is represented by a 7-bit code:
    • Example: The ASCII code for A is %100 0001.
  • The ASCII code arises often in computer programming.
  • For a table of the ASCII codes, refer to one of the following:
    • Appendix J in your textbook (p. 375)
    • Wikipedia’s article on ASCII

Review: Kilo-, Mega-, Giga-

  • In engineering notation,
    • Kilo means 1,000 (the same as 103)
    • Mega means 1,000,000 (same as 106)
    • Giga means 1,000,000,000 (same as 109)
  • When talking about computer memories, these terms have slightly different meanings:
    • Kilo means 1,024 (the same as 210)
    • Mega means 1,048,576 (same as 220)
    • Giga means 1,073,741,824 (same as 230)

Bytes, Kilobytes, Megabytes, Gigabytes

  • There are 1024 bytes in a kilobyte: 1 KB = 1024 bytes
  • There are 1024 kilobytes in a megabyte: 1 MB = 1024 KB
  • There are 1024 megabytes in a gigabyte: 1 GB = 1024 MB

Making Sense of Windows File Sizes

  • Have you ever noticed that when you use Windows to look at a file’s size, it gives two numbers that don’t seem to match each other?
  • Example:“Size on disk: 624 KB (638,976 bytes)”
  • That’s because 624 x 1024 = 638,976.

Computer Busses

  • A computer system’s data bus carries data and instructions from one part of the system to another.
  • Its address bus carries addresses of memory locations or external devices.
  • In the HCS12, both of these busses are 16 bits wide.
  • When people say a “16-bit system” or a “32-bit system,” they’re talking about the width of the data bus.

Memory Units

The location of a unit of data in a memory is called the address. Usually a byte is the smallest unit of data that can be addressed.

For example the blue byte is located in address 6.


Write Operations

The two main memory operations are called read and write. A simplified write operation is shown in which new data overwrites the original data. Data moves to the memory.

Address register

Data register

Address decoder

Byte organized memory array

Address bus

  • The address is placed on the address bus.
  • Data is placed on the data bus.
  • A write command is issued.

Data bus



Read Operations

The read operation is actually a “copy” operation, as the original data is not changed. The data bus is a “two-way” path; data moves from the memory during a read operation.

Address register

Data register

Address decoder

Byte organized memory array

Address bus

Data bus

  • The address is placed on the address bus.
  • A read command is issued.
  • A copy of the data is placed in the data bus and shifted into the data register.



Some Common Address Bus Widths

  • An address bus’s width (in bits) determines the number of locations it can address:

Powers of 2

  • Here’s a handy table showing the powers of 2 up to 240.
  • You can use a table like this to answer the following questions:
      • How many addressable locations are there in a memory with n address bits?
      • How many rows are there in a truth table with n input variables?
      • What is the MOD of an n-bit counter?

Review: Memory Technologies

  • Most memory chips fall into one of the following three categories (which have many subcategories).
  • RAM (Random Access Memory)
      • Read/write
      • Volatile (Loses data when power is removed.)
  • ROM (Read-Only Memory)
      • Impossible or difficult to write to
      • Non-volatile

Random Access Memory (RAM)

  • RAM is for temporary data storage. It is read/write memory and can store data only when power is applied, hence it is volatile. Two major categories are static RAM (SRAM) and dynamic RAM (DRAM).
  • The memory cells in SRAM are latches or flip-flops.
  • The memory cells in Dynamic RAMs (DRAMs) are capacitors. Since the capacitors lose charge, they must be refreshed many times each second.
types of ram
Types of RAM

Latch or flip-flop

storage cell.

Capacitor storage cell. Must be refreshed.

High-density but slow. Used for main memory.

Fast but low-density. Used for cache memory.


Read-Only Memory (ROM)

  • Members of the ROM family are all considered non-volatile, because they retain data with power removed.
  • Various members can be either permanent memory (truly read-only) or erasable (not truly read-only, but they are more difficult to write to than RAM).
  • ROMs are used to store data that is never (or rarely) changed, such as system initialization files.
types of rom
Types of ROM

Data written by the user, and can be changed with some difficulty.

Data written by the manufacturer, and can never be changed.

Data written by the user, and can never be changed.


Memory in the HCS12

  • The HCS12 chip contains some Flash memory, some RAM, and some EEPROM.
  • In a final product, typically:
    • Flash holds the program that the chip executes.
    • RAM holds temporary data.
    • EEPROM holds permanent data.
  • But in this course we’ll use RAM for everything (program as well as data).

HCS12 Pin Diagram

  • See page 52 of Device User Guide.
  • Most pins serve more than one function; we’ll learn later how to specify which function we want them to perform.

HCS12 Block Diagram

  • See page 6 of textbook or page 23 of Device User Guide.

HCS12 Memory Map

  • See page 26 of Device User Guide.