U of U CS 5780 - 68HC12 Architecture and Lab 1 Introduction

Unformatted text preview:

ECE/CS 5780/6780: Embedded System DesignScott R. LittleLecture 2: 68HC12 Architecture & Lab 1 IntroductionScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 1 / 46AdministriviaLab1 is posted. There is NO prelab for Lab 1.Lab will begin next week.Tentative lab sections are posted.Please send me ([email protected]) your lab preferenceTODAY if you have not done so already!The ECE stockroom where you can sign-up to get 24/7 labaccess and check out your lab kit is MEB 2355.Code cannot be left on the lab machines.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 2 / 46History of the MicroprocessorIn 1968, Bob Noyce and Gordon Moore left FairchildSemiconductor and formed Integrated Electronics (Intel).At Intel in 1971, Federico Faggin, Ted Hoff, and Stan Mazorinvented the first single chip microprocessor, the 4004, a 4-bitmicroprocessor.In 1974, the 8008 and 8080, 8-bit microprocessors, weredesigned at Intel using NMOS technology.In 1974, Motorola also released the MC6800, an 8-bitmicroprocessor.One major difference was that Intel’s microprocessors usedisolated I/O while Motorola’s u sed memory-mapped I/O.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 3 / 46First Microprocessorshttp://www.cpu-world.comScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 4 / 46Die Photos: Intel 4004/Motorola 6800Intel 4004 Motorola 6800Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 5 / 46Intel 80 08 (1972)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 6 / 46Intel 80 80 (1974)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 7 / 46Intel 80 86- 8088 (1978)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 8 / 46Intel 28 6 (1982)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 9 / 46Intel386TM(1985)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 10 / 46Intel486TMDX CPU (1989)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 11 / 46IntelR! PentiumR!(1993)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 12 / 46IntelR! PentiumR!Pro (1995)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 13 / 46IntelR! PentiumR!II (1997)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 14 / 46IntelR! PentiumR!III (1999)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 15 / 46IntelR! PentiumR!4 (2000)Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 16 / 46MicrocontrollersDuring early 1980s, microcontrollers began to be designed.While microprocessors were optimized for speed and memorysize, microcontrollers were optimized for power and physical size.Intel produced the 8051 microcontroller.Motorola produced the 6805, 6808, 6811, and 6812.In 1999, Motorola shipped its 2 billionth MC68HC05microcontroller.In 2004, Motorola spun off i ts microcontroller divisi on asFreescale Semiconductor.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 17 / 466812 ArchitectureInstruction sets lend themselves to C compiler implementations.Two separate 8-bit accumulators (A,B) or one combined 16-bitaccumulator (D).Two 16-bit index registers (X,Y).8-bit condition code register.Powerful bit-manipulation instructions.Supports 16-bit add/subtract, 32 × 16 unsigned/signed divide,16 × 16 fractional divide, 16 × 16 unsigned/signed multiply,and 32 + (16 × 16) multiply and accumulate.Stack pointer points to the top element and grows downward.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 18 / 46RegistersScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 19 / 46Condition Code RegisterScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 20 / 46Address Map for MC9S12C32Address (hex) Size Device Contents$0000 to $03FF 1K I/O$3800 to $3FFF 2K RAM Variables and stack$4000 to $7FFF 16K EEPROM Program and constants$C000 to $FFFF 16K EEPROM Program and constantsScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 21 / 46External I/O PortsPort 48-pin Shared FunctionsPort A PA0 Address/Data BusPort B PB4 Address/Data BusPort E PE7, PE4, PE1, PE0 System Integration ModulePort J − Key wakeupPort M PM5-PM0 SPI, CANPort P PP5 Key wakeup, PWMPort S PS1-PS0 SCIPort T PT7-PT0 Timer, PWMPort AD PAD7-PAD0 Analog-to-Digital ConverterScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 22 / 46MC9S12C32 Block DiagramScott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 23 / 46Digital Representations of NumbersNumbers are represented as a binary seque nce of 0’s and 1’s.Each 8-bit byte is stored at a different address.A byte can be represented using two hexadecimal digits.%10110101 = $B5 (0xB5 in C)N = 128 · b7+ 64 · b6+ 32 · b5+ 16 · b4+ 8 · b3+ 4 · b2+ 2 · b1+ b0(unsigned)N = −128 · b7+ 64 · b6+ 32 · b5+ 16 · b4+ 8 · b3+ 4 · b2+ 2 · b1+ b0(signed)Programmer must track if a number is signed or unsigned.While addition and subtraction use same hardware, separatehardware is required for multiply, divide, and shift right.A byte can also represent a character using the 7-bit ASCII c ode.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 24 / 4616-Bit Words (Double Bytes)Endian comparison for the 16-bit number $03E8:Freescale microcontrollers use the big endian approach.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 25 / 46Fixed-Point NumbersIn embedded systems, fixed-point is often preferred over floatingpoint since it is simpler, more memory effici ent, and often allthat is required.fixed-point num ber ≡ I · ∆where I is a variable integer and ∆ is a fixed constant.If ∆ = 10n, then called decimal fixed-point.If ∆ = 2n, then called binary fixed-point.The value of ∆ cannot be changed during program execution,and it likely only appe ars as a comment in the code.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 26 / 46Precision, Resolution, and RangePrecision is the total number of distinguishable values.Resolution is the smallest difference that can be repres ented.Range is the minimum and maximum values.Example: A 10-bit ADC with a range of 0 to +5V, has aprecision of 210= 1024 values, and a resolu tion of 5V/1024 orabout 5mV.This could be accurately stored in a 16-bit fixed-point numberwith ∆ = 0.001V.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 27 / 46Overflow and Drop-OutOverflow is when the result of calculation is outside the range.Drop-out is when an intermediate result cannot be represented.Example:M = (53 ∗ N)/100 versus M = 53 ∗ (N/100)Promotion to higher precision avoids overflow.Dividing last avoids drop-out.Scott R. Little (Lecture 2: 68HC12) ECE/CS 5780/6780 28 / 46Fixed-Point ArithmeticLet x = I · ∆, y = J · ∆, z = K · ∆.z =


View Full Document

U of U CS 5780 - 68HC12 Architecture and Lab 1 Introduction

Documents in this Course
Lab 1

Lab 1

5 pages

FIFOs

FIFOs

10 pages

FIFOs

FIFOs

5 pages

FIFO’s

FIFO’s

12 pages

MCU Ports

MCU Ports

12 pages

Serial IO

Serial IO

26 pages

Load more
Download 68HC12 Architecture and Lab 1 Introduction
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view 68HC12 Architecture and Lab 1 Introduction and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view 68HC12 Architecture and Lab 1 Introduction 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?