Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2.

Similar documents
MICROPROCESSOR 8085 AND ITS INTERFACING SUNIL MATHUR. Second Edition A 1 ALE AD 0 - AD 7. Latch. Keyboard data V CC 8 P A D D 0 7 STB STB G G A

Honorary Professor Supercomputer Education and Research Centre Indian Institute of Science, Bangalore

MICROPROCESSOR Architecture, Programming and Interfacing SUNIL MATHUR. Assistant Professor Maharaja Agrasen Institute of Technology Delhi

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Computer Hardware Requirements for Real-Time Applications

DIGITA L LOGIC AND COMPUTER ORGA NIZATION

BASIC INTERFACING CONCEPTS

FUNDAMENTALS OF DIGITAL CIRCUITS

EMBEDDED SYSTEMS: Jonathan W. Valvano INTRODUCTION TO THE MSP432 MICROCONTROLLER. Volume 1 First Edition June 2015

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

Microprocessors/Microcontrollers

Embedded Systems. Software Development & Education Center. (Design & Development with Various µc)

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

MSP430 Microcontroller Basics

Microcontroller & Interfacing

Telecommunication Switching Systems and Networks

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

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

Rewa Engineering College, Rewa. Rewa Department OF Electrical Engineering

Embedded Systems. Read pages

Automation Engineers AB Pvt Ltd, NOIDA Job-Oriented Course on Embedded Microcontrollers & Related Software Stack

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Pearson New International Edition. The 8051 Microcontroller and Embedded Systems Mazidi Mazidi McKinlay Second Edition

Department of Electronics and Instrumentation Engineering Question Bank

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

CLOUD COMPUTING. M.N. Rao

CHAPTER 1 MICROCOMPUTER SYSTEMS. 1.1 Introduction. 1.2 Microcontroller Evolution

Microcomputer Architecture and Programming

Question Bank Microprocessor and Microcontroller


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

Analysis of Algorithms

Fig 1. Block diagram of a microcomputer

Lecture 1. Course Overview and The 8051 Architecture

INTRODUCTION OF MICROPROCESSOR& INTERFACING DEVICES Introduction to Microprocessor Evolutions of Microprocessor

DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING

Overview of Microcontroller and Embedded Systems

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

Four Categories Of 8085 Instructions That >>>CLICK HERE<<<

MICROCONTROLLER BASED SMART FAN SYSTEM

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

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

Z8 Encore! XP F1680 Series 8-Bit Flash Solution with Extended Peripherals

Acknowledgments About the Author

Three criteria in Choosing a Microcontroller

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

MICROPROCESSOR BASED SYSTEM DESIGN

UNIT 3 THE 8051-REAL WORLD INTERFACING

MICROCONTROLLERS 8051

UNIT - II PERIPHERAL INTERFACING WITH 8085

DTMF BASED INDUSTRIAL AUTOMATION

B.C.A 2017 MICROPROCESSOR AND ASSEMBLY LANGUAGE MODULE SPECIFICATION SHEET. Course Outline

The Microcontroller Idea Book

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

It is a program controlled semiconductor device (IC}, which fetches, decode and executes instructions.

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

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

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


Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

EE 308: Microcontrollers

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

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

PIC Microcontroller Introduction

PHI Learning Private Limited

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

ATmega128. Introduction

BHARATHIDASAN ENGINEERING COLLEGE. III Year / V Semester / EEE MICROPROCESSORS AND MICROCONTROLLERS (R-2013)

8051 Microcontroller

Sample Copy. Not For Distribution.

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Microprocessor Theory

PROGRAMMING AND CUSTOMIZING

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

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

Fundamentals of Discrete Mathematical Structures

Microprocessors and Interfacng. Question bank

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT IV I/O INTERFACING PART A (2 Marks)

Microcontrollers. Microcontroller

Microcontroller and Embedded Systems:

Programming 8-bit PIC Microcontrollers in С

The Freescale MC908JL16 Microcontroller

Object-Oriented Analysis and Design Using UML

The Atmel ATmega328P Microcontroller

THE AVR MICROCONTROLLER AND EMBEDDED SYSTEMS. Using Assembly and С

CN310 Microprocessor Systems Design

COMPUTER GRAPHICS, MULTIMEDIA AND ANIMATION, Second Edition (with CD-ROM) Malay K. Pakhira

Chapter 2 Sections 1 8 Dr. Iyad Jafar

8051 Microcontroller

Class: S.E. (Electrical) Course: 2012 PAT. Semester: IV : FUNDAMENTALS OF MICROPROCESSOR AND MICROCONTROLLER Textbooks:

QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

The Atmel ATmega168A Microcontroller

SEMESTER SYSTEM, PROPOSED SCHEME FOR B.Sc. (ELECTRONICS), B.Sc. (ELECTRONICS MAINTENANCE)

Microprocessor and Microcontroller question bank. 1 Distinguish between microprocessor and microcontroller.

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors

SARDAR RAJA COLLEGES SARDAR RAJA COLLEGE OF ENGINEERING ALANGULAM

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

MAKING PIC MICROCONTROLLER INSTRUMENTS AND CONTROLLERS

Transcription:

Ajit Pal Microcontrollers Principles and Applications +5 V 2K 8 8 bit dip switch P2 8 Reset switch Microcontroller AT89S52 100E +5 V +5 V 2.2K 10 uf RST 7 Segment common anode LEDs P1(0-6) & P3(0-6) 7 2 10K 8 22 pf ADC 0804 SC P0 X1 XTAL P1.7 X2 RD Vin+ 22 pf P3.7 Op-Amp 27K +5 V +12 V 220 V 47K 10K D1 100K 2.2K LM 35 1K Heater

Microcontrollers

Microcontrollers Principles and Applications AJIT PAL Professor Department of Computer Science and Engineering Indian Institute of Technology Kharagpur New Delhi-110001 2011

MICROCONTROLLERS: Principles and Applications Ajit Pal 2011 by PHI Learning Private Limited, New Delhi. All rights reserved. No part of this book may be reproduced in any form, by mimeograph or any other means, without permission in writing from the publisher. ISBN-978-81-203-4392-4 The export rights of this book are vested solely with the publisher. Published by Asoke K. Ghosh, PHI Learning Private Limited, M-97, Connaught Circus, New Delhi-110001 and Printed by Raj Press, New Delhi-110012.

In the Loving Memory of My Parents

Contents Preface Acknowledgements 1. INTRODUCTION 1 17 Learning Objectives 1 1.1 Historical Background 2 1.2 Microprocessors versus Microcontrollers 5 1.3 Microcontroller Features 7 1.3.1 On-chip Oscillator 7 1.3.2 Large Number of Special-purpose Registers 7 1.3.3 Harvard Architecture 8 1.3.4 On-chip Program Memory 9 1.3.5 On-chip Data Memory 9 1.3.6 On-chip I/O Ports 9 1.3.7 Watchdog-Timer Reset 10 1.3.8 Powerful Interrupt Structure 11 1.3.9 Fast Context Switching 11 1.3.10 Built-in ADC 12 1.3.11 Built-in PWM 12 1.4 Educational Need 12 1.4.1 Hardware Design 13 1.4.2 Software Design 13 1.4.3 Hardware-Software Integration 14 1.5 Survey of Microcontrollers 14 1.6 Applications of Microcontrollers 16 Summary 16 Review Questions 17 Fill in the Blanks 17 Short Questions 17 vii xv xvii

viii Contents 2. ARCHITECTURE OF THE INTEL 8051 18 38 Learning Objectives 18 2.1 On-chip Oscillator and CPU Timing 19 2.2 Memory Organization 21 2.3 Register Organization 22 2.4 Multifunction I/O Ports 24 2.5 ALU Capability of 8051 28 2.6 Reset Operation 31 2.6.1 Power-on Reset 31 2.7 Interrupt Structure 32 2.8 The 8051 Family 35 Summary 36 Review Questions 37 Fill in the Blanks 37 Short Questions 37 3. INSTRUCTION SET: VOCABULARY OF THE MACHINE 39 81 Learning Objectives 39 3.1 Data and Its Representation 41 3.2 Instruction Formats 44 3.2.1 Instruction Formats of 8051 47 3.3 Addressing Modes 48 3.3.1 Addressing Modes of 8051 56 3.4 Organization of the Instruction Set 59 3.4.1 Data Transfer Group 59 3.4.2 Logic Group 63 3.4.3 Arithmetic Group 66 3.4.4 Control Transfer Group 71 Summary 78 Review Questions 80 Fill in the Blanks 80 Short Questions 80 4. ASSEMBLY LANGUAGE PROGRAMMING 82 114 Learning Objectives 82 4.1 Software Design Steps 83 4.1.1 Problem Specification 83 4.1.2 Design 83 4.1.3 Coding 87 4.1.4 Testing and Debugging 88 4.1.5 Documentation and Maintenance 88 4.2 Why Assembly Language Programming? 88 4.3 Assembly Language Format 89

Contents ix 4.4 Simple Sequence Programs 91 4.4.1 Multi-byte Addition 91 4.4.2 Code Conversion 92 4.4.3 Binary to BCD Code Conversion 92 4.5 Program Looping 93 4.5.1 Multi-byte Addition 95 4.5.2 Checksum Byte Calculation 95 4.5.3 Delay Generation 96 4.5.4 Searching 99 4.5.5 Sorting 103 4.6 Subroutine Linkage 104 4.6.1 Parameter Passing Using Registers 107 4.6.2 Parameter Passing Using Memory 108 4.6.3 Parameter Passing Using Stack 109 4.7 Subroutine Call versus Interrupt 110 4.7.1 Software Interrupts 111 Summary 111 Review Questions 112 Fill in the Blanks 112 Short Questions 113 5. INTERFACING EXTERNAL MEMORY 115 142 Learning Objectives 115 5.1 Program Memories 116 5.1.1 Mask-programmable ROM 117 5.1.2 Programmable ROM 117 5.1.3 Electrically Programmable ROM 118 5.1.4 Electrically Erasable and Programmable ROM 119 5.1.5 Flash Memory 119 5.1.6 Non-volatile RAM 120 5.2 Data Memories 120 5.2.1 Static RAM 120 5.2.2 Dynamic RAM 121 5.3 Important Memory Characteristics 121 5.3.1 Electrical Characteristics 121 5.3.2 Memory Organization 121 5.3.3 Timing Characteristics 126 5.4 Interfacing External Memory to 8051 128 5.4.1 External Program Memory Address Space 129 5.4.2 External Data Memory Address Space 129 5.4.3 The System Bus 129 5.4.4 Interfacing of Program Memories 134 5.4.5 Interfacing of Data Memory 138 Summary 140 Review Questions 141 Fill in the Blanks 141 Short Questions 141

x Contents 6. DATA TRANSFER TECHNIQUES AND I/O PORTS 143 163 Learning Objectives 143 6.1 Data Transfer Techniques 144 6.1.1 Synchronous Mode 145 6.1.2 Asynchronous Mode 146 6.1.3 Interrupt-driven Mode 146 6.2 I/O Port 148 6.2.1 The 8255A Programmable Peripheral Interface (PPI) 149 6.2.2 Interfacing of 8255 to the Microcontroller 155 6.2.3 8051 I/O Port Progrmming 157 Summary 161 Review Questions 162 Fill in the Blanks 162 Short Questions 163 7. INTERFACING FOR HUMAN INTERACTION 164 200 Learning Objectives 164 7.1 Interfacing of DIP Switches 165 7.2 Keyboard 165 7.2.1 Interface Circuit 166 7.2.2 Interfacing Issues 168 7.2.3 Row-scanning Technique 170 7.2.4 Scanning by Hardware 175 7.3 Interfacing of Display Devices 176 7.3.1 Single LEDs 176 7.3.2 Bi-colour LEDs 179 7.3.3 Seven-segment LEDs 180 7.3.4 Interfacing Multiple Seven-segment LEDs 182 7.4 Liquid Crystal Displays 186 7.4.1 Multi-digit Seven-segment LCD Driver 187 7.4.2 Intelligent LCD Display Module 188 Summary 199 Review Questions 199 Fill in the Blanks 199 Short Questions 200 8. INTERFACING OF TRANSDUCERS, SENSORS AND ACTUATORS 201 248 Learning Objectives 201 8.1 Transducers 203 8.1.1 Temperature Transducers 204 8.1.2 Pressure and Displacement Transducers 206 8.1.3 Light Sensors 209 8.2 Signal Conditioning Circuits 210 8.3 Optocouplers 217 8.4 Relays 218

Contents xi 8.5 Digital-to-Analog Converters 220 8.5.1 DAC Parameters 221 8.5.2 DAC Realizations 222 8.6 Analog-to-Digital Converters 229 8.6.1 Single Ramp Comparison Type ADC 229 8.6.2 Dual-slope Integrator Type ADC 231 8.6.3 Direct Type ADC 232 8.6.4 Tracking Type ADC 233 8.6.5 The Successive Approximation ADC Counter 233 8.6.6 Microcontroller-based ADCs 235 8.6.7 ADC Chips 238 8.6.8 Bus Compatible ADCs 238 8.6.9 DAC/ADC Specifications 239 8.7 Sample and Hold Amplifier 240 8.8 Analog Multiplexer 242 8.9 Data Acquisition Systems 243 Summary 246 Review Questions 247 Fill in the Blanks 247 Short Questions 247 9. TIMER/COUNTER OPERATIONS 249 267 Learning Objectives 249 9.1 Software-based Approach 250 9.1.1 Clock Generation 251 9.1.2 Pulse Width Modulated Signal 251 9.2 Hardware-based Approach 252 9.2.1 Monostable Operation 254 9.2.2 Astable Operation 255 9.3 Combined Hardware Software-based Approach 256 9.3.1 Registers Involved in Timer/Counter Operations 256 9.3.2 Timer/Counter Clock Source 258 9.3.3 Timer Modes of Operation 259 9.3.4 Counting External Events 261 9.3.5 Interaction between the Timer/Counter and the Processor 262 Summary 265 Review Questions 266 Fill in the Blanks 266 Short Questions 266 10. SERIAL MODE OF DATA TRANSFER 268 299 Learning Objectives 268 10.1 Serial Transmission Fundamentals 269 10.1.1 Modes of Data Transfer 270

Microcontrollers : Principles And Applications 30% OFF Publisher : PHI Learning ISBN : 978812034 3924 Author : PAL, AJIT Type the URL : http://www.kopykitab.com/product/74 89 Get this ebook