Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:

Size: px
Start display at page:

Download "Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:"

Transcription

1 Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes: An 8 or 16 bit microprocessor (CPU). A small amount of RAM. Programmable ROM and/or flash memory. Parallel and/or serial I/O. Timers and signal generators. Analog to Digital (A/D) and/or Digital to Analog (D/A) conversion. Often used to run dedicated code that controls one or more tasks in the operation of a device or a system. Also called embedded controllers, because the microcontroller and support circuits are often built into, or embedded in, the devices they control. Devices that utilize microcontrollers include car engines, consumer electronics (VCRs, microwaves, cameras, pagers, cell phones.. ), computer peripherals (keyboards, printers, modems.. ), test/measurement equipment (signal generators, multimeters, oscilloscopes ). Microcontrollers usually must have low-power requirements (~ W as opposed to ~10-50 W for general purpose desktop CPUs) since many devices they control are battery-operated. #1 Lec # 20 Winter

2 Microcontroller Components From sensors To actuators Displays, keyboard etc. Single Chip RAM, EPROM, EEPROM, flash Examples: Motorola s 68HC11, 68HC12, AMD 29K, Zilog s Z8, Z80, Intel s 8052, Microchip s PIC Low-power, embedded versions of desktop CPUs: e.g Intel s #2 Lec # 20 Winter

3 A Typical Microcontroller Application: Speed Measurement Car Cruise Control #3 Lec # 20 Winter

4 The Motorola 68HC12 Microcontroller A Typical 68HC12 has the following components on the chip: A 16-bit central processing unit (CPU12): 20-Bit ALU. Instruction Queue. Enhanced Indexed Addressing. Fuzzy Logic Instructions. 32-Kbyte Flash EEPROM with 2-Kbyte Erase-Protected Boot Block. 768-Byte EEPROM. 1-Kbyte RAM with Single-Cycle Access for Aligned or Misaligned Read/Write. 8-Channel, 8-Bit Analog-to-Digital (A/D) Converter. 8-Channel Timer. 16-Bit Pulse Accumulator: External Event Counting, Gated Time Accumulation. Pulse-Width Modulator: 8-Bit, 4-Channel or 16-Bit, 2-Channel Separate Control for Each Pulse Width and Duty Cycle #4 Lec # 20 Winter

5 A Typical 68HC12 Chip Pin-Out MC68HC912B32 #5 Lec # 20 Winter

6 M68EVB912B32 Evaluation Board Layout #6 Lec # 20 Winter

7 Motorola 68HC12 16-bit Memory Address Space 0x0800 0x08FF 0x0900 0x09FF User Program Memory: 256 bytes User Data Memory: 256 bytes #7 Lec # 20 Winter

8 68HC12 Programming Model: Registers #8 Lec # 20 Winter

9 68HC12 Registers A 8-bit Accumulator A B 8-bit Accumulator B D 16-bit Double accumulator D (A : B) X 16-bit Index register X Y 16-bit Index register Y SP 16-bit Stack pointer PC 16-bit Program Counter CCR Condition code register: S STOP instruction control bit X Non-maskable interrupt control bit H Half-carry status bit I Maskable interrupt control bit N Negative status bit Z Zero status bit V Two s complement overflow status bit C Carry/Borrow status bit #9 Lec # 20 Winter

10 68HC12 Data Types The HC12 uses the following types of data: Bits. 5-bit signed integers. 8-bit signed and unsigned integers. 8-bit, 2-digit binary coded decimal (BCD) numbers. 9-bit signed integers. 16-bit signed and unsigned integers. 16-bit effective addresses. 32-bit signed and unsigned integers. 5-bit and 9-bit signed integers are used only as offsets for indexed addressing modes. 16-bit effective addresses are formed during addressing mode computations. 32-bit integer dividends are used by extended division instructions. Extended multiply and extended multiply-and-accumulate instructions produce 32-bit products. #10 Lec # 20 Winter

11 68HC12 Addressing Modes Inherent Addressing Mode (INH). Immediate Addressing Mode (IMM). Direct Addressing Mode (DIR). Extended Addressing Mode (EXT). Indexed Addressing Modes: 5-Bit Constant Offset Indexed Addressing (IDX). Auto Pre/Post Decrement/Increment Indexed Addressing (IDX) Accumulator Offset Indexed Addressing (IDX). 9-Bit Constant Offset Indexed Addressing (IDX1). 16-Bit Constant Offset Indexed Addressing (IDX2). Indirect Indexed Addressing: 16-Bit Constant Offset Indexed Addressing [IDX2]. Accumulator D Indirect Indexed Addressing [D, IDX]. #11 Lec # 20 Winter

12 68HC12 Addressing Modes Inherent Addressing Mode (INH): Instructions that use this addressing mode either have no operands or all operands are in internal CPU registers. Examples: NOP CLRA ABA ASRA ; this instruction has no operands ; clear A ; add A to B result in A ; arithmetic shift right A Immediate Addressing Mode (IMM): Examples: LDAA #$55 ; load A with the 8-bit value $55 LDX #$1234 ; load index register X with 16-bit address $1234 LDY #$67 ; load index register Y with 16-bit address $0067 ADDA #$17 ; add the value $17 to register A, result in A #12 Lec # 20 Winter

13 68HC12 Addressing Modes Direct Addressing Mode (DIR): Used to access operands in the memory address range $0000 through $00FF Examples: LDAA $55 ; load register A with 8-bit value in memory address $0055 LDX $20 ; load index register X with 16-bit value in $0020, $0021 STY $50 ; store value of Y to memory addresses $0050, $0051 Extended Addressing Mode (EXT): Used to access operands in the full 16-bit address of the memory. Examples: LDAA $F03B ; load register A with 8-bit value from address $F03B LDX $0900 ; load index register X with 16-bit value in $0900, $0901 #13 Lec # 20 Winter

14 68HC12 Indexed Addressing Modes 5-Bit Constant Offset Indexed Addressing (IDX): Uses an 5-bit signed offset (range -16 to 15) which is added to the base index register (X, Y, SP, or PC) to form the effective address: Examples: LDAA 12,X ; load A with the byte at memory address (X) + 12 STAB 8,Y ; store the byte in B at address (Y) - 8 ADDA 5,X ; add A to the byte at (X) + 5, result in A 9-Bit Constant Offset Indexed Addressing (IDX1): Uses an 9-bit signed offset (range -256 to 255) which is added to the base index register (X, Y, SP, or PC) to form the effective address: Examples: LDAA $FF,X ; load A with the byte at memory address (X) + $FF STAB 20,Y ; store the byte in B at address (Y) Bit Constant Offset Indexed Addressing (IDX2): Uses an 16-bit offset which is added to the base index register (X, Y, SP, or PC) to form the effective address. This allows access to any address in the 64-Kbyte address space. #14 Lec # 20 Winter

15 Auto Pre/Post Decrement/Increment Indexed Addressing (IDX) Predecrement and preincrement versions of the addressing mode adjust the value of the index register before accessing the memory location affected by the instruction: STAA 1, SP STX 2, SP ;equivalent to PSHA ;equivalent to PSHX Post-decrement and postincrement versions of the addressing mode use the initial value in the index register to access the memory location affected by the instruction, then change the value of the index register. LDX 2,SP+ LDAA 1,SP+ ;equivalent to PULX ;equivalent to PULA #15 Lec # 20 Winter

16 Indexed Addressing Modes Accumulator Offset Indexed Addressing (IDX): In this indexed addressing mode, the effective address is the sum of the values in the base index register (X, Y, SP, or PC) and an unsigned offset in one of the accumulators (8bit A, B or 16-bit D). Example: LDAA B,X This instruction internally adds B to X to form the address from which A will be loaded. #16 Lec # 20 Winter

17 Indirect Indexed Addressing 16-Bit Constant Offset Indexed Addressing [IDX] : Adds a 16-bit instruction-supplied offset to the base index register to form the address of a memory location that contains a pointer to the memory location affected by the instruction. Example: LDAA [10,X] In this example, X holds the base address of a table of pointers. Assume that X has an initial value of $1000, and that the value $2000 is stored at addresses $100A and $100B. The instruction first adds the value 10 to the value in X to form the address $100A. Next, an address pointer ($2000) is fetched from memory at $100A. Then, the byte value stored in location $2000 is read and loaded into the A accumulator. #17 Lec # 20 Winter

18 Indirect Indexed Addressing Accumulator D Indirect Indexed Addressing [D,IDX]: Adds the value in the D accumulator to the value in the base index register to form the address of a memory location that contains a pointer to the memory location affected by the instruction. The square brackets distinguish this addressing mode from D accumulator offset indexing. Example: JMP GO1 DC.W GO2 DC.W GO3 DC.W [D,PC] PLACE1 PLACE2 PLACE3 Assume that the value in D is $0002. The JMP instruction adds the values in D and PC to form the address of GO2. Next the CPU reads the address PLACE2 from memory at GO2 and jumps to PLACE2. #18 Lec # 20 Winter

19 68HC12 Load & Store Instructions #19 Lec # 20 Winter

20 68HC12 Transfer & Exchange Instructions #20 Lec # 20 Winter

21 68HC12 Move Instructions #21 Lec # 20 Winter

22 68HC12 Addition & Subtraction Instructions #22 Lec # 20 Winter

23 68HC12 BCD Instructions #23 Lec # 20 Winter

24 HC12 Increment & Decrement Instructions #24 Lec # 20 Winter

25 HC12 Compare & Test Instructions #25 Lec # 20 Winter

26 HC12 Logic Instructions #26 Lec # 20 Winter

27 HC12 Clear, Complement & Negate Instructions #27 Lec # 20 Winter

28 HC12 Multiplication & Division Instructions #28 Lec # 20 Winter

29 Multiply and Accumulate Instruction EMACS The EMACS instruction multiplies two 16-bit operands stored in memory and accumulates the 32-bit result in a third memory location. Often used to implement simple digital filters. #29 Lec # 20 Winter

30 HC12 Bit Test & Manipulation Instructions #30 Lec # 20 Winter

31 HC12 Logical Shifts Instructions #31 Lec # 20 Winter

32 HC12 Arithmetic Shifts Instructions #32 Lec # 20 Winter

33 HC12 Rotate Instructions #33 Lec # 20 Winter

34 HC12 Short Branch Instructions The numeric range of short branch offset values is $80 ( 128) to $7F (127) #34 Lec # 20 Winter

35 HC12 Short Branch Instructions The numeric range of short branch offset values is $80 ( 128) to $7F (127) #35 Lec # 20 Winter

36 HC12 Long Branch Instructions The numeric range of long branch offset values is $8000 ( 32,768) to $7FFF (32,767) #36 Lec # 20 Winter

37 HC12 Long Branch Instructions The numeric range of long branch offset values is $8000 ( 32,768) to $7FFF (32,767) #37 Lec # 20 Winter

38 HC12 Decrement/Branch Instructions #38 Lec # 20 Winter

39 HC12 Jump & Subroutine Instructions #39 Lec # 20 Winter

40 HC12 Interrupt Instructions #40 Lec # 20 Winter

41 HC12 Stack Related Instructions #41 Lec # 20 Winter

42 HC12 Stack Related Instructions #42 Lec # 20 Winter

43 HC12 Condition Codes Instructions #43 Lec # 20 Winter

44 HC12 Example: Addition of Two Values USER_STACKTOP equ $0a00 org $0800 Main lds #USER_STACKTOP ;load stacktop ldaa #FIRST ;load first byte in A adda #SECOND ;add second value to A result in A staa ANSWER ;store result in answer End bra End ;done with program org $0900 FIRST dc.b #$01 ;first value to add SECOND dc.b #$02 ;second value to add ANSWER dc.b #$00 ;addition result #44 Lec # 20 Winter

45 USER_STACKTOP equ $0a00 org $0800 HC12 Loop Example Main: lds #USER_STACKTOP ;load stacktop ldaa #ITER ;load number of iterations to perform ldab #COUNT ;load number of iterations performed already loop: deca ;decrement Acc A incb ;increment Acc B cmpa #$00 ;Is Acc A = 0? bne loop ;No, continue with loop stab COUNT ;Otherwise, save the count End: bra End ;done with program org $0900 ITER dc.b #$08 ;Number of loop iterations to perform COUNT dc.b #$00 ;Number of loop iterations performed #45 Lec # 20 Winter

46 HC12 Data Table Example ; This program takes a table of data, and creates a new table ; which is the original table divided by 2 prog: equ $0800 ;put program at address 0x0800 data: equ $0900 ;put data at address 0x0900 count: equ 10 ;number of entries in table org prog ;set program counter to 0x0800 ldx #table1 ;Reg X points to entry to process in table 1 ldy #table2 ;Reg Y points to entry to write to table 2 ldab #count ;ACC B holds number of entries left to process repeat: ldaa 1,x+ ;Get table1 entry into ACC A; inc X to next entry asra ;Divide by 2 staa 1,y+ ;Save in table2; inc Y to next entry in table2 dbne b,repeat ;Decrement number left to process; ;If not done, process next table1 entry swi ;Done -- Exit org data ;initialize table1 (COUNT bytes long) table1: dc.b $07,$ae,$4a,$f3,$6c,$30,$7f,$12,$67,$cf table2: ds.b count ;reserve count bytes for table2. #46 Lec # 20 Winter

CPU12. Introduction. CPU12 Programming Model. The CPU12 Central Processing Unit M68HC12 and HCS12 microcontrollers

CPU12. Introduction. CPU12 Programming Model. The CPU12 Central Processing Unit M68HC12 and HCS12 microcontrollers CPU12 The CPU12 Central Processing Unit M68HC12 and HCS12 microcontrollers Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor

More information

Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle

Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle Contents 3.1. Register Transfer Notation... 2 3.2. HCS12 Addressing Modes... 2 1. Inherent Mode (INH)... 2 2.

More information

Programming Model, Address Mode, HC12 Hardware Introduction

Programming Model, Address Mode, HC12 Hardware Introduction EEL 4744C: Microprocessor Applications Lecture 2 Programming Model, Address Mode, HC12 Hardware Introduction Dr. Tao Li 1 Reading Assignment Microcontrollers and Microcomputers: Chapter 3, Chapter 4 Software

More information

Assembly Language for the Freescale 9S12 and CodeWarrior

Assembly Language for the Freescale 9S12 and CodeWarrior Assembly Language for the Freescale 9S12 and CodeWarrior Microprocessor Applications for Engineering University of Hartford, CETA Fall 2009 Prof. Jonathan Hill jmhill@hartford.edu 9S12 Architecture The

More information

Decimal, Hexadecimal and Binary Numbers Writing an assembly language program

Decimal, Hexadecimal and Binary Numbers Writing an assembly language program Decimal, Hexadecimal and Binary Numbers Writing an assembly language program o Disassembly of MC9S12 op codes o Use flow charts to lay out structure of program o Use common flow structures if-then if-then-else

More information

M6800. Assembly Language Programming

M6800. Assembly Language Programming M6800 Assembly Language Programming 1 3. MC6802 MICROPROCESSOR MC6802 microprocessor runs in 1MHz clock cycle. It has 64 Kbyte memory address capacity using 16-bit addressing path (A0-A15). The 8-bit data

More information

Introduction to Microcontrollers

Introduction to Microcontrollers Introduction to Microcontrollers Motorola M68HC11 Specs Assembly Programming Language BUFFALO Topics of Discussion Microcontrollers M68HC11 Package & Pinouts Accumulators Index Registers Special Registers

More information

HC12 Assembly Language Programming

HC12 Assembly Language Programming HC12 Assembly Language Programming Programming Model Addressing Modes Assembler Directives HC12 Instructions Flow Charts 1 Assembler Directives In order to write an assembly language program it is necessary

More information

Sample Problem Set #1 - SOLUTIONS

Sample Problem Set #1 - SOLUTIONS Sample Problem Set #1 - SOLUTIONS Notes: These problems are typical exam problems; most are drawn from previous homeworks and exams. This exam is open book, open notes. It may help to have a calculator.

More information

The stack and the stack pointer

The stack and the stack pointer The stack and the stack pointer If you google the word stack, one of the definitions you will get is: A reserved area of memory used to keep track of a program's internal operations, including functions,

More information

Types of microprocessor

Types of microprocessor Types of microprocessor Depending on register 1. Accumulator based 2. Register based Based on aplication 1. Bit Slice Processors 2. General purpose CPUs 3. Dedicated/Embedded controllers Accumulator based

More information

1 Absolute Addressing: 2 Immediate Addressing: EECC250 - Shaaban

1 Absolute Addressing: 2 Immediate Addressing: EECC250 - Shaaban 68000 Addressing Modes Addressing modes are concerned with the way data is accessed Addressing can be by actual address or based on a offset from a known position. Theoretically, only absolute addressing

More information

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR AND MICROCOMPUTER BASICS Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

More information

Programmer s Model = model of µc useful to view hardware during execution of software instructions

Programmer s Model = model of µc useful to view hardware during execution of software instructions HC12/S12 Programmer s Model Programmer s Model = model of µc useful to view hardware during execution of software instructions Recall: General Microcontroller/Computer Architecture note: Control Unit &

More information

Introduction to Microcontrollers. ECE473/573 Microprocessor System Design, Dr. Shiue

Introduction to Microcontrollers. ECE473/573 Microprocessor System Design, Dr. Shiue Introduction to Microcontrollers 1 Introduction It is hard to imagine the present world of electronic devices without the microprocessor. Cash register, scales, ovens, washing machine, alarm clock, thermostats,

More information

Programming the Motorola MC68HC11 Microcontroller

Programming the Motorola MC68HC11 Microcontroller Programming the Motorola MC68HC11 Microcontroller CONTENTS: COMMON PROGRAM INSTRUCTIONS WITH EXAMPLES MEMORY LOCATIONS PORTS SUBROUTINE LIBRARIES PARALLEL I/O CONTROL REGISTER (PIOC) COMMON PROGRAM INSTRUCTIONS

More information

68HC12 Assembly Programming 2.1 Objectives

68HC12 Assembly Programming 2.1 Objectives 2 68HC12 Assembly Programming 2.1 Objectives After completing this chapter you should be able to: Use assembler directives to allocate memory blocks, define constants, and create a message to be output

More information

ECE 3120 Computer Systems HCS12 Assembly Programming -Review

ECE 3120 Computer Systems HCS12 Assembly Programming -Review ECE 3120 Computer Systems HCS12 Assembly Programming -Review Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Program Structure

More information

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV UNIT I THE 8086 MICROPROCESSOR 1. What is the purpose of segment registers

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

Lecture 1: Introduction to Microcomputers

Lecture 1: Introduction to Microcomputers Lecture 1: Introduction to Microcomputers Today s Topics What is a microcomputers? Why do we study microcomputers? Two basic types of microcomputer architectures Internal components of a microcomputers

More information

8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language.

8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language. 8051 Programming The 8051 may be programmed using a low-level or a high-level programming language. Low-Level Programming Assembly language programming writes statements that the microcontroller directly

More information

Introduction Difference between microcontroller and microprocessor Criteria for choosing a microcontroller Overview of 8051 microcontroller Inside

Introduction Difference between microcontroller and microprocessor Criteria for choosing a microcontroller Overview of 8051 microcontroller Inside Introduction Difference between microcontroller and microprocessor Criteria for choosing a microcontroller Overview of 8051 microcontroller Inside the 8051 Inside the computer Microprocessor CPU for

More information

Intro to Microprocessors and Microcomputers

Intro to Microprocessors and Microcomputers Intro to Microprocessors and Microcomputers Content Microprocessor, microcontrollers and microcomputers Communication within microcomputers Registers Process architecture CPU Data and program storage Negative

More information

CPU08RM/AD Rev. 2 CPU08 CENTRAL PROCESSOR UNIT REFERENCE MANUAL

CPU08RM/AD Rev. 2 CPU08 CENTRAL PROCESSOR UNIT REFERENCE MANUAL CPU08RM/AD Rev. 2 HC 8 CPU08 CENTRAL PROCESSOR UNIT REFERENCE MANUAL Motorola, Inc., 1996; All Rights Reserved CPU08 Central Processor Unit Reference Manual N O N - D I S C L O S U R E A G R E E M E N

More information

MC68HC11 Instruction Set

MC68HC11 Instruction Set Overview MC68HC11 Instruction Set K 68HC11 instruction set A quick look at the programming procedure The programmer's model Instruction types and formats Addressing modes A tour of the instruction set

More information

Feature of 8086 Microprocessor

Feature of 8086 Microprocessor 8086 Microprocessor Introduction 8086 is the first 16 bit microprocessor which has 40 pin IC and operate on 5volt power supply. which has twenty address limes and works on two modes minimum mode and maximum.

More information

CHAPTER 7: The CPU and Memory

CHAPTER 7: The CPU and Memory CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides

More information

Introduction to 6811 Programming

Introduction to 6811 Programming Introduction to 6811 Programming Fred G. Martin July 25, 1994 1 Bits and Bytes Most humans, having ten fingers, think in decimal numbers. In computers, information is represented with voltages, and it

More information

CONTENTS I LEARNING MICROCONTROLLERS. Preface

CONTENTS I LEARNING MICROCONTROLLERS. Preface CONTENTS Foreword Preface xiii xv I LEARNING MICROCONTROLLERS 1. Introduction to Microcontrollers 3 1.1 Introduction 3 1.2 Microcontrollers and Microprocessors 5 1.3 History of Microcontrollers and Microprocessors

More information

Zilog ZSO. Microprocessor Update: Photo 7: The Z80 microprocessor evaluation board.

Zilog ZSO. Microprocessor Update: Photo 7: The Z80 microprocessor evaluation board. Photo 7: The Z80 microprocessor evaluation board. Microprocessor Update: Zilog ZSO Burt Hashizume PO Box 172 Placentia CA 92670 One feature of the Z80 not found in other 8 bit microprocessors is a built

More information

150127-Microprocessor & Assembly Language

150127-Microprocessor & Assembly Language Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

More information

Basic Concepts of Microprocessors

Basic Concepts of Microprocessors MICROPROCESSOR 8085 Reference Book: Ramesh S. Goankar, Microprocessor Architecture, Programming and Applications with 8085, 5 th Edition, Prentice Hall Week 1 Basic Concept and Ideas about Microprocessor.

More information

Microcontroller Introduction

Microcontroller Introduction Microcontroller Introduction ECE110 Lecture 1 John A. Chandy Adapted from Prof. Martin Fox s s ECE266 Notes Agenda Course outline/ goals and approach Quick Overview of Computer Architecture Definition

More information

Lecture 6 Introduction to the ATmega328 and Ardunio CSE P567

Lecture 6 Introduction to the ATmega328 and Ardunio CSE P567 Lecture 6 Introduction to the ATmega328 and Ardunio CSE P567 Outline Lecture 6 ATmega architecture and instruction set I/O pins Arduino C++ language Lecture 7 Controlling Time Interrupts and Timers Lecture

More information

14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT

14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT FORM 5 COMPUTER STUDIES Chapter 14: The Central Processing Unit March, 01 14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT Still remember what CPU is? If not, take a look of the following: CPU is a device

More information

Microprocessor/Microcontroller. Introduction

Microprocessor/Microcontroller. Introduction Microprocessor/Microcontroller Introduction Microprocessor/Microcontroller microprocessor - also known as a CU or central processing unit - is a complete computation engine that is fabricated on a single

More information

PART B QUESTIONS AND ANSWERS UNIT I

PART B QUESTIONS AND ANSWERS UNIT I PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional

More information

MACHINE ARCHITECTURE & LANGUAGE

MACHINE ARCHITECTURE & LANGUAGE in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based

More information

5.4 Microcontrollers I: Introduction

5.4 Microcontrollers I: Introduction 5.4 Microcontrollers I: Introduction Dr. Tarek A. Tutunji Mechatronics Engineering Department Philadelphia University, Jordan Microcontrollers: Introduction Microprocessors were described in the last three

More information

Tutorial. Introduction to 8085 Architecture and Programming

Tutorial. Introduction to 8085 Architecture and Programming Tutorial On Introduction to 8085 Architecture and Programming Contents 1. Internal architecture of 8085 microprocessor 2. 8085 system bus 3. 8085 pin description. 4. 8085 functional description. 5. Programming

More information

Week 5 Course notes. Introduction to material covered this week

Week 5 Course notes. Introduction to material covered this week Week 5 Course notes Introduction to material covered this week Having reviewed the instruction set for the MC68HC11 with practice on some of the more frequently used opcodes, we are now ready to learn

More information

CPU08 Central Processor Unit

CPU08 Central Processor Unit CPU08 Central Processor Unit Reference Manual M68HC08 Microcontrollers CPU08RM Rev. 02/2006 freescale.com CPU08 Central Processor Unit Reference Manual To provide the most up-to-date information, the

More information

Computer Hardware Requirements for Real-Time Applications

Computer Hardware Requirements for Real-Time Applications Lecture (4) Computer Hardware Requirements for Real-Time Applications Prof. Kasim M. Al-Aubidy Computer Engineering Department Philadelphia University Summer Semester, 2011 Real-Time Systems, Prof. Kasim

More information

ECE3120: Computer Systems Chapter 4: Subroutines

ECE3120: Computer Systems Chapter 4: Subroutines ECE3120: Computer Systems Chapter 4: Subroutines Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Stack Frame - The region

More information

EE 308 Spring Binary, Hex and Decimal Numbers (4-bit representation) Binary. Hex. Decimal A B C D E F

EE 308 Spring Binary, Hex and Decimal Numbers (4-bit representation) Binary. Hex. Decimal A B C D E F EE 8 Spring Binary, Hex and Decimal Numbers (-bit representation) Binary Hex 8 9 A B C D E F Decimal 8 9 EE 8 Spring What does a number represent? Binary numbers are a code, and represent what the programmer

More information

MICROPROCESSOR 2 marks questions and answers UNIT-I

MICROPROCESSOR 2 marks questions and answers UNIT-I MICROPROCESSOR 2 marks questions and answers 1. Define microprocessors? UNIT-I A semiconductor device(integrated circuit) manufactured by using the LSI technique. It includes the ALU, register arrays,

More information

MICROPROCESSORS AND MICROCONTROLLERS

MICROPROCESSORS AND MICROCONTROLLERS MICROPROCESSORS AND MICROCONTROLLERS Introduction & Overview Of 8051 Microcontrollers Arun Xavier VAST 2 Microcontroller 8051 Module IV (Microcontroller 8051) (18 Hours) Overview of 8051 microcontrollers

More information

Organization and Architecture of the Renesas RX63N Microcontroller Board

Organization and Architecture of the Renesas RX63N Microcontroller Board Organization and Architecture of the Renesas RX63N Microcontroller Board Chapter 3 Renesas Electronics America Inc. Embedded Systems using the RX63N 9/15/2013 Rev. 0.1 2013 Renesas Electronics America

More information

Unit 8 : Microprocessor Architecture

Unit 8 : Microprocessor Architecture Unit 8 : Microprocessor Architecture Lesson 1 : Microcomputer Structure 1.1. Learning Objectives On completion of this lesson you will be able to : draw the block diagram of a simple computer understand

More information

P A R T LEARNING MICROCONTROLLERS. 1 Introduction to Microcontrollers Microcontrollers

P A R T LEARNING MICROCONTROLLERS. 1 Introduction to Microcontrollers Microcontrollers P A R T LEARNING MICROCONTROLLERS I 1 Introduction to Microcontrollers 2 8051 Microcontrollers 3 8051 Pin Description, Connections, I/O Ports and Memory Organization 4 MCS-51 Addressing Modes and Instructions

More information

Chapter 1 THE PIC MICROCONTROLLERS: HISTORY AND FEATURES

Chapter 1 THE PIC MICROCONTROLLERS: HISTORY AND FEATURES Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 3322: Embedded Systems Discussion Chapter 1 THE PIC MICROCONTROLLERS: HISTORY AND FEATURES Eng. Eman R. Habib February,

More information

Topics Introduction to Microprocessors

Topics Introduction to Microprocessors Topics 2102440 Introduction to Microprocessors Chapter 1 Intro to 80x86 Introduction Goals Brief History of Microprocessors Microprocessor Systems Overview Microprocessor Data Types Intro to 80x86 Suree

More information

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals CPU Architectures Motorola 68000 Several CPU architectures exist currently: Motorola Intel AMD (Advanced Micro Devices) PowerPC Pick one to study; others will be variations on this. Arbitrary pick: Motorola

More information

Microcontrollers A Brief History of Microprocessors

Microcontrollers A Brief History of Microprocessors Microcontrollers A Brief History of Microprocessors The first microprocessor was developed by what was then a small company called Intel (short for Integrated Electronics) in the early 1970s. The client,

More information

Module Introduction. CONTENT: - 31 pages - 6 questions. LEARNING TIME: - 60 minutes

Module Introduction. CONTENT: - 31 pages - 6 questions. LEARNING TIME: - 60 minutes Module Introduction PURPOSE: The intent of this module is to present all CPU12 instructions to better prepare you to write short routines in assembly language. OBJECTIVES: - Discuss all CPU12 instruction

More information

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions All computers, from the first room-sized mainframes, to today's powerful desktop, laptop and even hand-held PCs, perform

More information

6800 Basics. By Ruben Gonzalez

6800 Basics. By Ruben Gonzalez 6800 Basics By Ruben Gonzalez 6800 Processor Uses 8 bit words Has addressable main memory of 64k Has Memory Mapped I/O and interrupts The 6800 has the following main registers: 8- bit Accumulator A (AccA)

More information

Microcomputer Systems

Microcomputer Systems CHAPTER 1 Microcomputer Systems 1.1 Introduction The term microcomputer is used to describe a system that includes at minimum a microprocessor, program memory, data memory, and an input-output (I/O) device.

More information

MICROCONTROLLAR BASED DIGITAL CLOCK WITH ALARM

MICROCONTROLLAR BASED DIGITAL CLOCK WITH ALARM MICROCONTROLLAR BASED DIGITAL CLOCK WITH ALARM www.microsyssolution.com Page 1 A BRIEF INTRODUCTION TO 8051 MICROCONTROLLER-: When we have to learn about a new computer we have to familiarize about the

More information

CPU- Internal Structure

CPU- Internal Structure ESD-1 Elettronica dei Sistemi Digitali 1 CPU- Internal Structure Lesson 12 CPU Structure&Function Instruction Sets Addressing Modes Read Stallings s chapters: 11, 9, 10 esd-1-9:10:11-2002 1 esd-1-9:10:11-2002

More information

Advanced Microprocessors RISC & DSP

Advanced Microprocessors RISC & DSP Advanced Microprocessors RISC & DSP RISC & DSP :: Slide 1 of 23 RISC Processors RISC stands for Reduced Instruction Set Computer Compared to CISC Simpler Faster RISC & DSP :: Slide 2 of 23 Why RISC? Complex

More information

Microprocessor or Microcontroller?

Microprocessor or Microcontroller? Microprocessor or Microcontroller? A little History What is a computer? [Merriam-Webster Dictionary] one that computes; specifically : programmable electronic device that can store, retrieve, and process

More information

Microprocessor and Microcontroller Architecture

Microprocessor and Microcontroller Architecture Microprocessor and Microcontroller Architecture 1 Von Neumann Architecture Stored-Program Digital Computer Digital computation in ALU Programmable via set of standard instructions input memory output Internal

More information

1 Classical Universal Computer 3

1 Classical Universal Computer 3 Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 3 1.1 Von Neumann Architecture 3 1.2 CPU and RAM 5 1.3 Arithmetic Logical Unit (ALU) 6 1.4 Arithmetic Logical Unit

More information

Z80 Instruction Set. Z80 Assembly Language

Z80 Instruction Set. Z80 Assembly Language 75 Z80 Assembly Language The assembly language allows the user to write a program without concern for memory addresses or machine instruction formats. It uses symbolic addresses to identify memory locations

More information

INDEX. Cables Operator Interface, 2 15 Programming Device, 2 15

INDEX. Cables Operator Interface, 2 15 Programming Device, 2 15 INDEX A Accessing AUX Functions via direct entry, A 3 via DirectSOFT 5, A 3 via the Handheld Programmer, A 3 Accumulating Fast Timer Instruction, 5 38 Accumulating Timer Instruction, 5 38 Accumulator /

More information

Chapter 13. PIC Family Microcontroller

Chapter 13. PIC Family Microcontroller Chapter 13 PIC Family Microcontroller Lesson 01 PIC Characteristics and Examples PIC microcontroller characteristics Power-on reset Brown out reset Simplified instruction set High speed execution Up to

More information

Outline - Microprocessors

Outline - Microprocessors Outline - Microprocessors General Concepts Memory Bus Structure Central Processing Unit Registers Instruction Set Clock Architecture Von Neuman vs. Harvard CISC vs. RISC General e Concepts - Computer Hardware

More information

Assignment 5: Memory-Mapped Address Decoding

Assignment 5: Memory-Mapped Address Decoding Assignment 5: Memory-Mapped Address Decoding Overview This assignment has one lab-based design problem, one paper-based design problem, and one paper-based exercise. Please refer to the handout Appendix

More information

Lecture N -1- PHYS 3330. Microcontrollers

Lecture N -1- PHYS 3330. Microcontrollers Lecture N -1- PHYS 3330 Microcontrollers If you need more than a handful of logic gates to accomplish the task at hand, you likely should use a microcontroller instead of discrete logic gates 1. Microcontrollers

More information

Milwaukee School of Engineering MSOE 2013 CE-2800 Embedded Systems I

Milwaukee School of Engineering MSOE 2013 CE-2800 Embedded Systems I Milwaukee School of Engineering MSOE 2013 CE-2800 Embedded Systems I Description Required Materials Course Learning Outcomes This course presents a typical embedded microcontroller and assembly language

More information

Embedded Systems Dr Santanu Chaudhury Department of Electrical Engineering IIT Delhi Lecture 5 ARM Processor

Embedded Systems Dr Santanu Chaudhury Department of Electrical Engineering IIT Delhi Lecture 5 ARM Processor Embedded Systems Dr Santanu Chaudhury Department of Electrical Engineering IIT Delhi Lecture 5 ARM Processor In the last class we had discussed PIC processors which were targeted primarily for low end

More information

Lecture 2: MC68000 architecture

Lecture 2: MC68000 architecture Lecture 2: MC68000 architecture g General information g Programmer s model g Memory organization g Instruction format g Our first assembly program g The sim68k simulator g Machine translation 1 MC68000

More information

Dept. of Computers Science and Engineering, MMU

Dept. of Computers Science and Engineering, MMU Dept. of Computers Science and Engineering, MMU Microprocessor & its Applications Prepared by- Nancy Bindal Dept. of CSE, mmu,mullana Module Contents The curriculum consists of 5 modules with 8085 as the

More information

Chapter 4 The Components of the System Unit

Chapter 4 The Components of the System Unit Chapter 4 The Components of the System Unit The System Unit Box-like case that contains computer s electronic components Sometimes called the chassis What are common components inside the system unit?

More information

The Microcontroller Idea Book

The Microcontroller Idea Book The Microcontroller Idea Book Circuits, Programs & Applications featuring the 8052-BASIC Single-chip Computer Jan Axelson Table of Contents Chapter 1 Microcontroller Basics 1 What s a Microcontroller?

More information

Week Assembly Language Programming Chapter 2

Week Assembly Language Programming Chapter 2 Week 2 8051 Assembly Language Programming Chapter 2 1 Outline 2.1 Inside the 8051 2.2 Introduction to 8051 Assembly programming 2.3 Assembling and running an 8051 program 2.4 The program counter and ROM

More information

Interrupts and the Timer Overflow Interrupts Huang Sections 6.1-6.4. What Happens When You Reset the HCS12?

Interrupts and the Timer Overflow Interrupts Huang Sections 6.1-6.4. What Happens When You Reset the HCS12? Interrupts and the Timer Overflow Interrupts Huang Sections 6.1-6.4 o Using the Timer Overflow Flag to interrupt a delay o Introduction to Interrupts o How to generate an interrupt when the timer overflows

More information

PIC MICROCONTROLLERS FOR DIGITAL FILTER IMPLEMENTATION

PIC MICROCONTROLLERS FOR DIGITAL FILTER IMPLEMENTATION PIC MICROCONTROLLERS FOR DIGITAL FILTER IMPLEMENTATION There are many devices using which we can implement the digital filter hardware. Gone are the days where we still use discrete components to implement

More information

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS 1) Which is the microprocessor comprises: a. Register section b. One or more ALU c. Control unit 2) What is the store by register? a. data b. operands

More information

Microcontrollers and the Freescale/Motorola HC11

Microcontrollers and the Freescale/Motorola HC11 Microcontrollers and the Freescale/Motorola HC11 Summer 2008 What is a microcontroller? A computer on a chip used to control electronic devices A microprocessor Usually not cutting edge (4-bit to 32-bit)

More information

Table 1a: The complete MSP430 instruction set of 27 core instructions

Table 1a: The complete MSP430 instruction set of 27 core instructions Table a: The complete MSP430 instruction set of 27 core instructions core instruction mnemonics core instruction binary Single-operand arithmetic 5 4 3 2 0 9 8 7 6 5 4 3 2 0 0 0 0 0 0 opcode B/ As source

More information

Section 44. CPU with Extended Data Space (EDS)

Section 44. CPU with Extended Data Space (EDS) Section 44. CPU with Extended Data Space (EDS) HIGHLIGHTS This section of the manual contains the following topics: 44.1 Introduction... 44-2 44.2 Programmer s Model... 44-5 44.3 Software Stack Pointer...

More information

Lecture 2 Microcomputer Organization: Central Processing Unit:

Lecture 2 Microcomputer Organization: Central Processing Unit: Lecture 2 Microcomputer Organization: The basic components of a microcomputer are: 1) CPU 2) Program memory 3) Data memory 4) Output ports 5) Input ports 6) Clock generator. These components are shown

More information

MICROCOMPUTER BASICS

MICROCOMPUTER BASICS MICROCOMPUTER BASICS I. Terminology Binary Digit (BIT): basic unit of digital storage, a 0 or 1 Nibble: 4 bits, ½ byte, 1 hex digit Byte: grouping of 8 bits handled as a single unit, has 2 8 = 256 possible

More information

SEVEN-SEGMENT DISPLAY

SEVEN-SEGMENT DISPLAY CME-11E9 EVBU LAB EXPERIMENT SEVEN-SEGMENT DISPLAY Revision 03.11.13 Class Instructor / Professor LICENSE You may use, copy, modify and distribute this document freely as long as you include this license

More information

Microprocessors, Microcontrollers & Digital Signal Processors. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Microprocessors, Microcontrollers & Digital Signal Processors. ECE 153B Sensor & Peripheral Interface Design Winter 2016 Microprocessors, Microcontrollers & Digital Signal Processors ECE 153B Sensor & Peripheral Interface Design Intel 4004/8008 4004 introduced in 1971 First microprocessor All CPU components on a single chip

More information

Lecture 3: MC68000 instruction set

Lecture 3: MC68000 instruction set Lecture 3: MC68000 instruction set g Assembler directives (the most important ones) n ORG, EQU, END, DC, DS, EXTERN/PUBLIC g Instructions (the most important ones) n Data movement n Integer arithmetic

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three subsystems of a computer. Describe the

More information

Module 2: Architecture of the TMS320F28335

Module 2: Architecture of the TMS320F28335 Connexions module: m36737 1 Module 2: Architecture of the TMS320F28335 Frank Bormann This work is produced by The Connexions Project and licensed under the Creative Commons Attribution License Abstract

More information

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System? Management Challenge Managing Hardware Assets What computer processing and storage capability does our organization need to handle its information and business transactions? What arrangement of computers

More information

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present

More information

Microprocessor Overview

Microprocessor Overview EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 16th January 2002 CLR Part I Microprocessor Overview Central processing units (CPU s) for early computers, were originally

More information

Call Subroutine (PC<15:0>) TOS, (W15)+2 W15 (PC<23:16>) TOS, Process data. Write to PC NOP NOP NOP NOP

Call Subroutine (PC<15:0>) TOS, (W15)+2 W15 (PC<23:16>) TOS, Process data. Write to PC NOP NOP NOP NOP Section 3. Descriptions CALL Call Subroutine Syntax: {label:} CALL lit23 CALL.S Operands: lit23 [0... 8388606] (PC)+4 PC, (PC) TOS, (W15)+2 W15 (PC) TOS, (W15)+2 W15 lit23 PC, NOP Register.

More information

E246: Electronics & Instrumentation. Lecture: Microprocessors and DSPs

E246: Electronics & Instrumentation. Lecture: Microprocessors and DSPs E246: Electronics & Instrumentation Lecture: Microprocessors and DSPs Microprocessor It is an integrated circuit that is the fundamental building block of a digital computer, controlled by software programs

More information

Microprocessor-Based Automatic Door Opener

Microprocessor-Based Automatic Door Opener Microprocessor-Based Automatic Door Opener Jitendra Chaudhary UG201110012 CSE, IIT Jodhpur Hemraj Kumawat UG201110011 CSE, IIT Jodhpur Abstract A microprocessor controlled automatic door opener including

More information

Data types. lecture 4

Data types. lecture 4 Data types lecture 4 Information in digital computers is represented using binary number system. The base, i.e. radix, of the binary system is 2. Other common number systems: octal (base 8), decimal (base

More information

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway Abstract High Level Languages (HLLs) are rapidly becoming the standard

More information

Laboratory 1 Task 1: Familiarisation

Laboratory 1 Task 1: Familiarisation Laboratory 1 Task 1: Familiarisation Laboratory 1 should take an average student 9 hours (3 lab sessions) to complete. Objectives: In this experiment you will learn the basic skills required to use and

More information