Microcontrollers. Microcontroller

Similar documents
Chapter 7 Central Processor Unit (S08CPUV2)

S12CPUV2. Reference Manual HCS12. Microcontrollers. S12CPUV2/D Rev. 0 7/2003 MOTOROLA.COM/SEMICONDUCTORS

Wed. Aug 23 Announcements

Microprocessors/Microcontrollers

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Microcontrollers and the Freescale/Motorola HC11

MOXSYN. General Description. Features. Symbol

CS/ECE 5780/6780: Embedded System Design

Microcomputer Architecture and Programming

AVR Microcontrollers Architecture

ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 6

EE 308: Microcontrollers

Mark II Aiken Relay Calculator

Exam I Review February 2017

Unit wise Question Bank UNIT-II

Introduction to Microcontrollers

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram

Fredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт.


Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12. EE383: Introduction to Embedded Systems University of Kentucky

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

CN310 Microprocessor Systems Design

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ).

ENE 334 Microprocessors

8051 microcontrollers

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

8051 Microcontroller

Accumulator and memory instructions 1. Loads, stores, and transfers 2. Arithmetic operations 3. Multiply and divide 4. Logical operations 5. Data test

MICROPROCESSOR BASED SYSTEM DESIGN

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

538 Lecture Notes Week 5

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Design of Embedded Systems Using 68HC12/11 Microcontrollers

538 Lecture Notes Week 5

MC68HC05J1A/D Rev. 1.0 HC 5 MC68HC05J1A MC68HCL05J1A MC68HSC05J1A. HCMOS Microcontroller Units TECHNICAL DATA

Computers and Microprocessors

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

Computer Organization I. Lecture 28: Architecture of M68HC11

Module 2: Introduction to AVR ATmega 32 Architecture

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

ME 515 Mechatronics. A microprocessor

CPU: SOFTWARE ARCHITECTURE INSTRUCTION SET (PART

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

538 Lecture Notes Week 1

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

8051 Overview and Instruction Set

Somes French translations :

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

AVR ISA & AVR Programming (I)

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

EE 308 Spring Lecture 28 March 30, 2012 Review for Exam 2. Introduction to the MC9S12 Expanded Mode

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

PROGRAM CONTROL UNIT (PCU)

UNIT 2 PROCESSORS ORGANIZATION CONT.

CHAPTER 8. Solutions for Exercises

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

Cmpt 150 The Freescale CPU12 March, The Freescale HC12

3.1 Description of Microprocessor. 3.2 History of Microprocessor

Segment 1A. Introduction to Microcomputer and Microprocessor

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

b. List different system buses of 8085 microprocessor and give function of each bus. (8) Answer:

Introduction to the MC9S12 Hardware Subsystems

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE

17. Instruction Sets: Characteristics and Functions

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

Introduction to Computers - Chapter 4

Introduction to Microcontrollers

ECE 4510/5530 Microcontroller Applications Chapter 1

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

Introduction to Microprocessor

7. Discuss the hardware signals and superscalar architecture of Pentium BTL 2 Understand

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang

Description of the Simulator

History and Basic Processor Architecture

CPE300: Digital System Architecture and Design

Computer Architecture

Introduction to general architectures of 8 and 16 bit micro-processor and micro-controllers

Fig 1. Block diagram of a microcomputer

BASIC INTERFACING CONCEPTS

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE0501. Subject Name: Microprocessor Fundamentals & Programming

Introduction to the 9S12 Microcontroller

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

Digital Blocks Semiconductor IP

CPU12 REFERENCE MANUAL

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

Computer Organisation CS303

Digital IP Cell 8-bit Microcontroller PE80

Digital Blocks Semiconductor IP

Microprocessors and Microcontrollers. Assignment 1:

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

Transcription:

Microcontrollers Microcontroller A microprocessor on a single integrated circuit intended to operate as an embedded system. As well as a CPU, a microcontroller typically includes small amounts of RAM and PROM and timers and I/O ports. (hyperdictionary.com) Special type of ASIP designed for embedded control applications Microcontrollers can usually run as a single chip system (on chip memory and peripherals). Frees pins on the chip normally used for interfacing with memory etc for programmable I/O Efficient bit manipulation and direct access to part pins 1

Large variety of microcontrollers spanning a wide range of price and performance Based on 4-, 8-, 16-, 32-bit processors (8- bit most popular, 32-bit for high end applications) Most popular are lower end devices used extensively in cost sensitive applications Some reasons for popularity of microcontrollers Speeds design time (many peripherals integrated) Simplifies I/O interfacing Reduce/eliminate external memory Single chip solution can help optimise for power, board space, cost, Some Examples PIC (www.microchip.com) Versatile, robust, low-power, low-cost controller No external busses, expansion and communication through serial peripheral interaces or I/O ports Variety of versions - some with as little as 8 pins (small footprint) 2

Harvard architecture (8-bit data space) and limited registers, instruction set and addressing modes (RISC like) 8051 Popular 8-bit microcontroller originally made by Intel, now made by many others A large number of variants- memory configuration, peripherals, pin count, 16-bit variants Efficient vectored interrupts Efficient bit-manipulation instructions useful in control applications ARM (not a chip maker - IP based) 32-bit RISC processor core embedded into microprocessors, ASIPs & microcontrollers High speed and advanced architecture Many applications: network, digital cameras, PDAs, mobile phones, Some models have both 32-bit and 16-bit instruction sets Windows CE, Linux, Palm OS, Symbian OS, and Java OS, many RTOS options support for both microcontroller and DSP functions, embedded ICE features 3

Motorola HCS12 family has a high-speed (for a microcontroller), 16-bit central processing unit programming model identical to M68HC11 instruction set is a proper superset of the M68HC11 instruction set Fairly complex CISC processor with a large number of multi-cycle instructions Flexible addressing modes Large number of built in peripherals, memory, A member of this family used in the lab One of hundreds of processors used in embedded systems We will give a brief overview but will not discuss the microcontroller in depth in class Engineers and designers need to be able to learn and evaluate different processors, architectures, instruction sets, For this course, you are required to become proficient in coding for the HCS12 You need to become very familiar with data sheet and user guide 512K bytes of Flash EEPROM 14K bytes of RAM 4K bytes of EEPROM two asynchronous serial communications interfaces (SCI), Three serial peripheral interfaces (SPI) an 8-channel IC/OC enhanced capture time two 8-channel, 10-bit analog-todigital converters (ADC) an 8-channel pulse-width modulator (PWM) a digital Byte Data Link Controller (BDLC) 29 discrete digital I/O channels five CAN 2.0, I2C bus 4

5

Accumulators Two 8-bit accumulators A and B are used to hold ALU operands. Can be combined into double accumulator D Index Registers used for indexed addressing Stack Pointer Automatic program stack saves system context for restoring after interrupts and subroutine calls Can also store temporary data and pass parameters to subroutines SP register contains address of last data pushed on stack. The stack grows downward from SP. Push decrements SP, pop increments it Subroutines call and interrupts Before entering subroutine, return address is pushed onto the stack Typically also push on state of registers etc at start of routine and restore before returning On return from subroutine, the return address is popped off the stack and program resumes execution at this address 6

Program counter (PC) holds the 16-bit address of the next instruction to be executed. automatically incremented each time an instruction is fetched. Condition code register (CCR) Contains status and control bits Status flags: Half carry (H), Negative (N), Zero (Z), Overflow (V), Carry/borrow (C) X-mask, I-mask bits: used to enable interrupts S-bit: enables stop instruction Peripherals Peripherals are controlled through a series of memory mapped registers Default range $0000 - $03FF ($ for hex number) Moveable to any other 2kB block For example, to write to portb output ports movb #$00,DDRB; set PORTB pins to output movb #$AA, PORTB; set alternate bits 7

Operating modes Special operating modes - factory test and development modes Normal modes Single-chip: no external memory interface Expanded-wide mode: PORTA and PORTB replaced by multiplexed16-bit address and data busses for external memory interface Expanded-wide mode: like expanded wide but uses an 8-bit data bus MCS12 Data types Bits 5-bit signed integers 8-bit signed and unsigned integers 8-bit, 2-digit binary-coded decimal numbers 9-bit signed integers 16-bit signed and unsigned integers 16-bit effective addresses 32-bit signed and unsigned integers 8

Negative integers: two s complement form. Five-bit and 9-bit signed integers are used only as offsets for indexed addressing. Sixteen-bit effective addresses are formed during addressing mode computations. Thirty-two-bit integer dividends are used by extended division instructions. Extended multiply and extended multiplyand-accumulate instructions produce 32-bit products. HCS12 instructions Consist of 1-2 byte operation code (opcode) and 0-5 bytes of operand addressing information Opcode determines operation to be performed and how to interpret addressing information to access operands HCS12 has very flexible addressing modes 9

Examples loading accumulator A Immediate ldaa #$0A ; A fl $0A Direct ldaa $0A ; A fl m[$0a] Indexed Constant offset 5, 9 or 16 bit ldaa 8,X ; A fl m[x+8] Auto pre-decrement (offset 1-8) ldaa 8,-X ; X fl X-8 ; A fl m[x] Auto pre-decrement (offset 1-8) ldaa 8,X+ ; A fl m[x+8] ; X fl X+8 10

Indirect Indexed (pointer table) ldx 2000 ldaa [10,X] ; A fl m[m[2010]] HCS12 Instruction Set CISC instruction set with many specialised instructions Multi-cycle execution time Instruction set covers a variety of instruction types: Memory and Register operations, Logic, Arithmetic, Memory and Register Operations Load and Store operations move data between main memory and CPU registers (A,B,D,X,Y,SP,CCR) Transfer and Exchange instructions move data between CPU registers Move instructions move data between memory locations (do not affect CCR) Stack operations push onto and pop (pull) from stack 11

12

Arithmetic and Logic Operations Binary addition, subtraction, multiplication and division Boolean logic Fast increment and decrement instructions (for counters) - do not affect CCR Specialised instructions for BCD arithmetic 13

14

Program control operations Short (8-bit) and long (16-bit) branch instructions Loop primitive instructions for counter based loops (while/for loop) Opcodes to call and return from subroutines, return from interrupts and call software interrupts 15

16

Other instructions Test and compare (not used as much as in other instruction sets) Fuzzy logic Multiply and accumulate (DSP) Max, min Table lookup Stop, Wait Background and Null instructions Shows Reading description of opcodes machine language opcodes for different addressing modes Cycle by cycle execution sequence Affect on status bits For example 17

18