MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Similar documents
Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

Microprocessors/Microcontrollers

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

ELCT708 MicroLab Session #1 Introduction to Embedded Systems and Microcontrollers. Eng. Salma Hesham

THE MICROCOMPUTER SYSTEM CHAPTER - 2

Introduction to Microcontrollers

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Microcomputer Architecture and Programming

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

ME 515 Mechatronics. A microprocessor

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

Concept of Memory. The memory of computer is broadly categories into two categories:


CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

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

Computer Hardware Requirements for Real-Time Applications

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Lecture (01) Introducing Embedded Systems and the Microcontrollers By: Dr. Ahmed ElShafee

CS-424/580A Microcontrollers and Robotics

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Fig 1. Block diagram of a microcomputer

Computer Organization and Microprocessors SYLLABUS CHAPTER - 1 : BASIC STRUCTURE OF COMPUTERS CHAPTER - 3 : THE MEMORY SYSTEM

ECED3204: Microprocessor Part I--Introduction

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer

MICROCONTROLLERS 8051

Embedded Systems Design (630414) Lecture 1 Introduction to Embedded Systems Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

EE 308: Microcontrollers

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

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

Basic Components of Digital Computer

In this tutorial, we will discuss the architecture, pin diagram and other key concepts of microprocessors.

Address connections Data connections Selection connections

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Module 1. Introduction. Version 2 EE IIT, Kharagpur 1

Overview of Microcontroller and Embedded Systems

William Stallings Computer Organization and Architecture 8th Edition. Chapter 5 Internal Memory

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

Computer Systems Organization

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

Computer Organization

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

To be familiar with the USART (RS-232) protocol. To be familiar with one type of internal storage system in PIC (EEPROM).

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422)

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

Bolt 18F2550 System Hardware Manual

machine cycle, the CPU: (a) Fetches an instruction, (b) Decodes the instruction, (c) Executes the instruction, and (d) Stores the result.

Lecture (02) PIC16F84 (I)

EMBEDDED SYSTEM BASICS AND APPLICATION

1 Introduction to Microcontrollers

DERTS Design Requirements (1): Microcontroller Architecture & Programming

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

3. The MC6802 MICROPROCESSOR

Components of a personal computer

Cork Institute of Technology. Autumn 2006 Microcomputer Applications (Time: 2 Hours)

INDUSTRIAL TRAINING:6 MONTHS PROGRAM TEVATRON TECHNOLOGIES PVT LTD

Explanation of PIC 16F84A processor data sheet Part 1: overview of the basics

Computer Organization

TUTORIAL Describe the circumstances that would prompt you to use a microprocessorbased design solution instead of a hard-wired IC logic design.

PIC Microcontroller Introduction

Introduction to 8051 microcontrollers

Chapter 4 Main Memory

1 Digital tools. 1.1 Introduction

Three-box Model: These three boxes need interconnecting (usually done by wiring known as a bus. 1. Processor CPU e.g. Pentium 4 2.

Read and Write Cycles

5 Computer Organization

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

Lecture-7 Characteristics of Memory: In the broad sense, a microcomputer memory system can be logically divided into three groups: 1) Processor

Microprocessor. Dr. Rabie A. Ramadan. Al-Azhar University Lecture 1

CHAPTER 1 MICROCOMPUTER SYSTEMS. 1.1 Introduction. 1.2 Microcontroller Evolution

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

Memory Overview. Overview - Memory Types 2/17/16. Curtis Nelson Walla Walla University

ELEG3923 Microprocessor Ch.0 & Ch.1 Introduction to Microcontroller

Chapter 5 Internal Memory

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

Introduction read-only memory random access memory

Computer Organization and Assembly Language (CS-506)

Architecture of Computers and Parallel Systems Part 6: Microcomputers

Digital Circuits Part 2 - Communication

Summer 2003 Lecture 18 07/09/03

eip-24/100 Embedded TCP/IP 10/100-BaseT Network Module Features Description Applications

5 Computer Organization

ECE 372 Microcontroller Design

EE 3170 Microcontroller Applications

Lecture 1. Course Overview and The 8051 Architecture

Dec Hex Bin ORG ; ZERO. Introduction To Computing

eip-10 Embedded TCP/IP 10-BaseT Network Module Features Description Applications

The Microcontroller Idea Book

Memory & Simple I/O Interfacing

Computer Systems A Background Review

PART B UNIT II PART A

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

Memory Expansion. Lecture Embedded Systems

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

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

Transcription:

1 2 A microprocessor is a single, very-large-scale-integration (VLSI) chip that contains many digital circuits that perform arithmetic, logic, communication, and control functions. When a microprocessor is packaged on a printed circuit board with other components, such as interface and memory chips, the resulting assembly is referred to as a microcomputer or single-board computer. The overall architecture of a typical microcomputer system using a microprocessor is illustrated in Figure 10.1. The microprocessor, (also called the central processing unit (CPU) or microprocessor unit (MPU), is where the primary computation and system control operations occur. Arithmetic logic unit (ALU) within the CPU executes mathematical functions on data structured as binary words. Word: an ordered set of bits, usually 8, 16, 32, or 64 bits long. The instruction decoder interprets instructions fetched sequentially from memory by the control unit and stored in the instruction register. Figure 10.1 Microcomputer architecture. 3 4 Each instruction is a set of coded bits that commands the ALU to perform bit manipulation, such as binary addition and logic functions, on words stored in the CPU data registers. The ALU results are also stored in data registers and then transferred to memory by the control unit. Bus: a set of shared communication lines that serves as the central nervous system of the computer. Data, address, and control signals are shared by all system components via the bus. Each component connected to the bus communicates information to and from the bus via its own bus controller. The data lines, address lines, and control lines allow a specific component to access data addressed to that component. Data lines: used to communicate words to and from data registers in the various system components such as memory, CPU, and input/output (I/O) peripherals. Address lines: used to select devices on the bus or specific data locations within memory. Devices usually have a combinational logic address decoder circuit that identifies the address code and activates the device. Control lines: transmit read and write signals, the system clock signal, and other control signals such as system interrupts. Memory: Different types of memory include Read-only memory (ROM): used for permanent storage of data that the CPU can read, but the CPU cannot write data to ROM. ROM does not require a power supply to retain its data and therefore is called nonvolatile memory. Random access memory (RAM): can be read from or written to at any time, provided power is maintained. The data in RAM is considered volatile because it is lost. There are two main types of RAM: static RAM (SRAM), which retains its data in flip-flops as long as the memory is powered, and

5 6 Dynamic RAM (DRAM), which consists of capacitor storage of data that must be refreshed (rewritten) periodically because of charge leakage. Erasable-programmable ROM (EPROM): Data stored in an EPROM can be erased with ultraviolet light applied through a transparent quartz window on top of the EPROM IC. Then new data can be stored on the EPROM. Another type of EPROM is electrically erasable (EEPROM). Data in EEPROM can be erased electrically and rewritten through its data lines without the need for ultraviolet light. Because data in RAM are volatile, ROM, EPROM, EEPROM, and peripheral mass memory storage devices such as magnetic, optical, and solid-state drives are sometimes needed to provide permanent data storage. Communication to and from the microprocessor occurs through I/O devices connected to the bus. External computer peripheral I/O devices include keyboards, printers, displays, and network devices. For mechatronic applications, analog-to-digital (A/D), digital-to-analog (D/A), and digital I/O (D/D) devices provide interfaces to switches, sensors, and actuators. 7 8 There are two branches of the microprocessor. One branch supports CPUs for the PC and workstation industry, where the main constraints are high speed and large word size (32 and 64 bits). The other branch includes microcontroller single IC containing specialized circuits and functions that are applicable to mechatronic system design. It contains a microprocessor, memory, I/O capabilities, and other on-chip resources. It is basically a microcomputer on a single IC. Examples of microcontrollers are Microchip s PIC, Motorola s 68HC11, and Intel s 8096. Factors that have driven development of the microcontroller are low cost, versatility, ease of programming, and small size. Microcontrollers are attractive in mechatronic system design because their small size and broad functionality allow them to be physically embedded in a system to perform all of the necessary control functions. Uses: used in a wide array of applications including home appliances, entertainment equipment, telecommunication equipment, automobiles, trucks, airplanes, toys, and office equipment.

9 10 All these products involve devices that require some sort of intelligent control based on various inputs. For example, the microcontroller in a microwave oven monitors the control panel for user input, updates the graphical displays when necessary, and controls the timing and cooking functions. In an automobile, there are many microcontrollers to control various subsystems, including cruise control, antilock braking, ignition control, keyless entry, air and fuel flow etc. An office copy machine controls actuators to feed paper, uses photo sensors to scan a page, sends or receives data via a network connection, and provides a user interface complete with menu-driven controls. A toy robot dog has various sensors to detect inputs from its environment (e.g., bumping into obstacles, being patted on the head, light and dark, voice commands), and an onboard microcontroller actuates motors to mimic actual dog behavior (e.g., bark, sit, and walk) based on this input. The components of a microcontroller include the CPU, RAM, ROM, digital I/O ports, a serial communication interface, timers, analog-to-digital (A/D) converters, and digital-to-analog (D/A) converters. The CPU executes the software stored in ROM and controls all the microcontroller components. Microcontroller manufacturers offer programming devices that can download compiled machine code from a PC directly to the EEPROM of the micro-controller, usually via the PC serial port and special-purpose pins on the microcontroller. Figure 10.2 Components of a typical full-featured microcontroller. 11 : Memory 12 There are various standards or protocols for serial communication, e.g. SPI (serial peripheral interface), I 2 C (interintegrated circuit), UART (universal asynchronous receiver-transmitter), and USART (universal synchronous-asynchronous receiver-transmitter). The A/D converter allows the microcontroller to convert an external analog voltage (e.g., from a sensor) to a digital value that can be processed or stored by the CPU. The D/A converter allows the microcontroller to output an analog voltage to a nondigital device (e.g., a motor amplifier). Onboard timers are usually provided to help create delays or ensure events occur at precise time intervals (e.g., reading the value of a sensor). Microcontrollers typically have less than 1 kilobyte to several tens of kilobytes of program memory. The memory of a microcomputer, microprocessor, or microcontroller stores both data and instructions. Instructions need to move sequentially through the CPU to be decoded and executed. Data can be read from memory by the CPU or written in memory by the CPU. Therefore, the way that memory is organized and the way it communicates with the CPU determines the performance of the device. The two generic hardware models for memory structure are called Von Neumann and Harvard architectures.

: Memory 13 : Memory 14 Figure 10.3 (a) von Neumann and (b) Harvard architectures. The von Neumann architecture uses a single memory to store instructions and data. This means that one unique address bus can access program instructions and data. Also, a unique data bus can transmit program instructions and data. The CPU sends the same control signal to read data or to read an instruction. There are no independent data or instructions control signals. Although ROM is used for instruction storage and RAM is used for data storage, the CPU is not concerned with this distinction and treats them the same way. From the CPU point of view, both ROM and RAM make up a single memory block to which the CPU sends control signals for addresses and data. Harvard architecture uses different memories to store instructions and data. The program memory has its own address bus (instruction address bus), its own data bus (more properly called an instruction bus), and its own control bus. Data memory has its own address bus, data bus, and control bus independent from the instruction buses. The program memory can only be read when data memory can be read and written. : Memory 15 : PIC 16 The von Neumann architecture uses fewer lines than the Harvard architecture, thus making a much simpler connection between CPU and memory. However, this structure does not allow simultaneous handling of data and instructions because there is only one bus. On the other hand, because it has different buses, Harvard architecture allows the handling of data and instructions simultaneously. This gives Harvard architecture an advantage in the speed of execution of programs. The five pins RA0 through RA4 are digital I/O pins collectively referred to as PORTA The eight pins RB0 through RB7 are digital I/O pins collectively referred to as PORTB. In total, there are 13 I/O lines, called bidirectional lines because each can be individually configured in software as an input or output. Interrupt An interrupt occurs when a specially designated input changes state. When this happens, normal program execution is suspended while a special interrupt handling portion of the program is executed. On the PIC16F84, pins RB0 and RB4 through RB7 can be configured as interrupt inputs. Figure 10.4 PIC16F84 pin-out and required external components.

: PIC 17 : PIC 18 Power and ground are connected to the PIC through pins V dd and V ss The dd and ss subscripts refer to the drain and source notation used for MOS transistors. The voltage levels (e.g., V dd 5 V and V ss 0 V) can be provided using a DC power supply or batteries (e.g., four AA batteries in series or a 9 V battery connected through a voltage regulator). Reset The master clear pin (MCLR) is active low and provides a reset feature. Grounding this pin causes the PIC to reset and restart the program stored in EEPROM. This pin must be held high during normal program execution. To provide a manual reset feature to a PIC design, we can add a normally open (NO) pushbutton switch. Closing the switch grounds the pin and causes the PIC to reset. Clock The PIC clock frequency can be controlled using different methods, including an external RC circuit, an external clock source, or a clock crystal. In Figure 10.4, we show the use of a clock crystal to provide an accurate and stable clock frequency at relatively low cost. The clock frequency is set by connecting a 4-MHz crystal across the OSC1 and OSC2 pins with the 22 pf capacitors grounded as shown in Figure 10.4.