Applications of 8051 Microcontrollers

Similar documents
INTERFACING 16 2 LCD WITH 8051

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

1. LCD (Liquid Crystal Display)interface

LCD AND KEYBOARD INTERFACING

8051 Interfacing and Applications Microcontroller


Engr. A. N. Aniedu Electronic and Computer Engineering Nnamdi Azikiwe University, Awka

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

1. Pin diagram of 8051 and ports

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

8051 I/O and 8051 Interrupts

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

C H A P T E R 1 INTRODUCTION

Microcontroller and Embedded Systems:

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 9 Simple I/O Interfacing

8051 Intermidiate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

JUMP, LOOP AND CALL INSTRUCTIONS

8051 Overview and Instruction Set

ELEG3923 Microprocessor Ch.4 I/O Ports

Chapter 3. Bit Addressable Area. By DeccanRobots


ET2640 Microprocessors

ST400C-NT USER S GUIDE. Table of Contents

AVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

Embedded Systems and Software. LCD Displays

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

Assembly Language programming (3)

Microcontroller Intel [Instruction Set]

COMP2121: Microprocessors and Interfacing. I/O Devices (II)

DEV-1 HamStack Development Board

TOPIC 6 LATCH. FIGURE 1 INTERFACING OF ROM/EPROM TO µc 8051.

Microcontroller and Applications

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

UNIT 10: Driving motors

~: Simple Programs in 8051 assembly language :~

LCM NHD-0440CI-YTBL. User s Guide. (Liquid Crystal Display Module) RoHS Compliant. For product support, contact NHD CI- Y- T- B- L-

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.


RoboClaw 2x30A Dual Channel Motor Controller


e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interfacing External Devices using Embedded C Module No: CS/ES/22

VALLIAMMAI ENGINEERING COLLEGE

Department of Electronics and Instrumentation Engineering Question Bank

DMX-K-DRV Integrated Step Motor Driver Manual

UNIT 3 THE 8051-REAL WORLD INTERFACING

DMX-K-DRV. Integrated Step Motor Driver + (Basic Controller) Manual

Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

PROGRAMMING AND CUSTOMIZING

Motor driver board. EB022

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

LCM NHD-0440AZ-FSW -FBW. User s Guide. (Liquid Crystal Display Character Module) RoHS Compliant FEATURES

DESIGN AND IMPLEMENTATION OF FPGA BASED MULTIPURPOSE REAL-TIME CONTROLLER FOR HYBRID STEPPER MOTOR

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

melabs Serial LCD Firmware Version 1.0 2/7/07

INTRO TO I/O INTERFACE

FACULTY OF ENGINEERING LAB SHEET

Me Stepper Driver. Overview

Parallel Display Specifications Revision 1.0

Application Brief D-005

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

INTERFACING HARDWARE WITH MICROCONTROLLER

AN1745. Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas. Introduction

中显液晶 技术资料 中显控制器使用说明书 2009年3月15日 北京市海淀区中关村大街32号和盛大厦811室 电话 86 010 52926620 传真 86 010 52926621 企业网站.zxlcd.com

USER S MANUAL. C11S- MULTIFUNTCION CNC BOARD Rev. 1.2

SERIE 59. Rear clamp. Frontal clamp HIGH RESOLUTION HOLLOW SHAFT INCREMENTAL ENCODER FOR INDUSTRIAL APPLICATIONS

ELEG3923 Microprocessor Ch.9 Timer Programming

MICROCONTROLLER BASED AUTOMATIC PLANT IRRIGATION SYSTEM

16COM / 40SEG DRIVER & CONTROLLER FOR DOT MATRIX LCD

LCD. Configuration and Programming

16COM/40SEG DRIVER & CONTROLLER FOR DOT MATRIX LCD

Development of Prototype Model for Wireless Based Controlled Pick and Place Robotic Vehicle

Home Security System with Remote Home Automation Control

KIT 134. INTRODUCTION TO LCD S

DIGI POT 3 click. PID: MIKROE 3016 Weight: 25 g

RoboClaw 120A/160A/200A Dual Channel Motor Controller

Embedded Controller Programming

SN8F5000 Family Instruction Set

80C451 operation of port 6

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

CHAPTER 3 JUMP, LOOP, AND CALL INSTRUCTIONS

Experiment# 8: Photo-Interrupter Control

melabs Serial LCD Firmware Version 1.1 3/5/07

Lab Experiment 9: LCD Display

Introduction To MCS-51

Microcontroller Based Code Locking System with Alarm

Basic Interface Techniques for the CRD155B

Lecture (09) PIC16F84A LCD interface LCD. Dr. Ahmed M. ElShafee

Autonomous, Surveillance Fire Extinguisher Robotic Vehicle with Obstacle Detection and Bypass using Arduino Microcontroller

LCD MODULE DEM SBH-PW-N

Keywords Digital IC tester, Microcontroller AT89S52

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

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

L298N Dual H-Bridge Motor Driver

Robotic Systems ECE 401RB Fall 2006

Module Contents of the Module Hours COs

TUTORIAL Assembly Language programming (2)

Pmod modules are powered by the host via the interface s power and ground pins.

Transcription:

Applications of 8051 Microcontrollers INTRODUCTION: A microcontroller is a versatile chip which can be used in various fields starting from simple consumer electronics, measuring devices to high end medical, automobile and defense applications. Today microcontrollers are found in every walk of life. The various fields of applications are listed below. Automobile Aeronautics Space Rail Transport Mobile communications Industrial processing Remote sensing, Radio and Networking Robotics Consumer electronics, music players, Computer applications Security (e-commerce, smart cards) Medical electronics (hospital equipment, and mobile monitoring) and Defense application Example 1: Binary Counter A binary counter is just like any other counter which counts the numbers in binary form. An 8- bit binary counter counts from 00000000 to 11111111.This binary counter can be realized by interfacing 8-LEDs to the port of the Microcontroller. By sending the continuous pulses through the port, the LEDs glow continuously one after the other. The ON state of an LED indicates the binary 1 and the OFF state of LED denotes the binary 0. 1

The interface circuit is shown in the above diagram. A array of LEDs is interfaced to the Port1 of the microcontroller. To drive the LEDs properly without any damage to the circuit, resistors of 220 ohms (current limiting resistors) are connected in series with the LEDs as shown in the circuit. Suitable assembly program is used to realize the binary counter so that the LEDs glow from 00 to FF. Assembly language Program : START : MOV A, #00 ; load accumulator with 00 LOOP : MOV P1, A ; send the contents of accumulator to Port1 CALL DELAY ; Create some delay INC A ; Increment the content of accumulator. CJNE A, # 0FF, LOOP ; compare the contents of A with FF and if not equal go to loop. MOV P1, A ; send the value FF to Port 1 SJMP START ; keep the counter working continuously. This program counts from 00 to FF and after reaching FF again it starts counting from 00. Note : The binary counter circuit can also be designed using an inverter buffer IC with port. 2

INTERFACING DC MOTOR- 8051 A DC motor runs in response to the applied Direct Current. It produces torque by using both electric and magnetic fields. The DC motor has rotor, stator, field magnet, brushes, shaft, commutator etc..,. The DC motor requires large currents, of the order of 400mA for its rotation. But this much amount of current can not be generated by the ports of the microcontroller. So, if a DC motor is connected directly to the ports of the controller, the motor draw high current for its operation from the ports and hence the microcontroller gets damaged. Therefore a motor driving circuit such as an H-Bridge Driver (L293 IC) circuit is necessary to connect a DC motor to the controller. The driving circuit provides the necessary current to the motor for its operation. An opto-isolator may be used to provide additional protection to the microcontroller by isolating it from the large current circuit. H-Bridge Driver Interface: The interface circuit consists of L293D IC which is a dual H-bridge motor driver. This is a 16-pin chip, which can be used to interface two DC motors and can be controlled in both clockwise and anticlockwise direction of motion. L293 D has an output current of 600mA and peak output current of 1.2A per channel. Also for protection of the circuit from back emf,output diodes are also included in the IC. The output supply has a wide range from 4.5 V to 36V. Opto Isolator ILQ74 The ILQ74 is A Quad chip with four, optically coupled Gallium Arsenide infrared LED and silicon NPN phototransistor pairs. Signal information, including a DC level, can be transmitted by the device while maintaining a high degree of electrical isolation between input and output. 3

The 8051- DC motor interface circuit is shown in the figure. The port1 pins P1.0, P1.1 & P1.2 are connected to the opto-isolator inputs and the outputs of the opto-isolator are connected to the IN1, IN2 and the Enable1 pins of the L293D driver IC. To rotate the motor the EN pin must be always high. Otherwise the status will be High impedance state (No rotation). The direction of rotation is controlled by the pins IN1 and IN2 and is shown in the table below. Enable (EN) Input1 IN1 Input2 IN2 Result High High Low Clockwise Rotation High Low High Anticlockwise Low X X High Impedance (No Rotatoion) The rotation of the motor is controlled by writing a suitable program. Assembly Language program : MAIN: SETB P1.2 Enable the H-bridge driver MOV P1,#00000001B Motor runs in clockwise Remarks 4

ACALL DELAY MOV P1,#00000010B Motor runs in anticlockwise ACALL DELAY SJMP MAIN Motor rotates continuously in clockwise for some time and anticlockwise for some time DELAY: MOV R4,#FF H Load R4 register with FF MOV R3,#FF H Load R3 register with FF LOOP1: DJNZ R3,LOOP1 Decrement R3 until it is zero LOOP2: DJNZ R4,LOOP2 Decrement R4 until it is zero RET Return to the main program Interfacing LCD Module -8051 Microcontroller : LCD modules are based on liquid crystal technology. The seven segment displays suffer from dissipation of power and also they are not suitable for display of graphs etc.. Hence the Liquid Crystal modules have become very popular now a days. They consume less power and they are highly suitable to display graphics, numbers and characters etc.. General LCD modules are available in different version like 1x16 (one line -16 characters) or 2x16 (two lines -16 characters) or 2 x 20 (two lines 20 characters) etc.. The pin diagram of the LCD module is shown below. It is a 14-pin module in which - 8 pins are for data - one pin is Vcc, one pin is Gnd - one pin is for contrast (Vee) - one pin is for RS (REG.SELECT) - one pin is for EN and - one pin is for R/W control. The description of the pins is given below. The pins 7-14 denotes the data pins which are used to transfer Data.These pins are used to send information to the LCD or to read the contents of the LCD s internal registers. 5

RS is the register select pin. The LCD has two internal registers. One is command code register and the other is the data register. The command code register is used to send commands like clear display, cursor at home etc.., The data register allows the user to send the data to be displayed on the LCD. When RS = 1,the data register is selected and when RS = 0 the command code register is selected. RS = 0 is also used to check the busy flag bit to find whether the LCD is ready to receive information. The busy flag is D7 and can be read when R/W = 1 and RS=0. For ex: if R/W= 1,RS=0 AND D7 = 1 means the LCD is busy due to internal operations and will not accept any new data. Suppose D7=0 means the LCD is ready to receive the data. R/W pin allows the user to read the information from LCD or write information to the LCD. When R/W = 0 writing is enabled and R/W=1 read is enabled. EN pin is used by the LCD to latch information on its data pins. When data is given to data pins, a high to low pulse must be applied to this pin so that the LCD can Latch in the data present at the data pins. Vcc,Vss and Vee pins denote supply, ground and contrast pins respectively. Vee pin is meant for adjusting the contrast of the LCD display and the contrast can be adjusted by varying the voltage at this pin. This is done by connecting one end of a POT to the Vcc (5V), other end to the Ground and connecting the center terminal (wiper) of of the POT to the Vee pin. The contrast pin is applied a negative voltage so that by adjusting this voltage the contrast of the Display can be controlled. Interfacing circuit: The interfacing of LCD module to 8051 microcontroller is shown below. The 8-data pins are connected to Port1 and control pins are connected to Port 2 pins. The busy flag 6

must be checked before the data is send to the LCD. With the help of a 10K potentiometer the contrast of the LCD display is adjusted. The assembly language program to diplay STHC on LCD is given below MOV A, #38H ; Use 2 lines and 5x7 matrix ; Issue a command MOV A, #0FH ; LCD ON, cursor ON, cursor blinking ON ; Command subroutine MOV A, #01H ; Clear screen ; Command subroutine MOV A,#06H ; Shift cursor right ; Command subroutine MOV A, #80H ; Start display from Cursor line home ; Command subroutine MOV A, # S ; Display letter S ACALL DISPLAY ; Display subroutine MOV A, # T ; Display letter T 7

ACALL DISPLAY ; Display subroutine MOV A, # H ; Display letter H ACALL DISPLAY ; Display subroutine MOV A, # C ; Display letter C ACALL DISPLAY ; Display subroutine HERE : SJMP HERE ; Display the data continuously COMMAND SUBROUTINE : MOV P1, A ; Issue command code. CLR P2.2 ; RS = 0 CLR P2.1 ; R/W =0 to write to LCD SETB P2.0 ; EN =1 pulse to enable CLR P2.0 ; EN =0 latch in RET DATA DISPLAY SUBROUTINE MOV P1, A ; Issue data SETB P2.2 ; RS = 1 data register CLR P2.1 ; R/W = 0 Write to LCD SETB P2.0 ; EN = 1 for high to low pulse CLR P2.0 ; EN = 0 Latch in RET; 8

9