ADC Interfacing with 8051 Microprocessor PDF

Title ADC Interfacing with 8051 Microprocessor
Author Mehran Zahid
Course Microprocessor Systems and Interfacing
Institution COMSATS University Islamabad
Pages 6
File Size 343.6 KB
File Type PDF
Total Downloads 22
Total Views 160

Summary

8051 Interfacing of Analog to Digital convertor Tutorial ...


Description

To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programmingTo interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming

LAB # 9 : To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming Objectives 

To explain the interfacing of ADC0804 with the AT89C51 MCU using breadboard



To modify the program and create a thermostat using temperature sensor and assembly language programming

Pre-Lab Theory Read the details given below in order to comprehend the basic operation of LCD and interfacing of LCD with microcontroller. It can be interfaced to perform different tasks in different combinations.

Components Required Components

Quantit y

AT89C51

1

12 MHz crystal

1

33 pF capacitors

2

16V-10 µF capacitor

2

ADC0804

1

LED bar display

1

10 KΩ variable resistor

1

150 Ω 9-line SIP

1

10 KΩ resistor

4

150 nF capacitor

1

Male-to-female cables

15

LED

2

To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programmingTo interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming

Introduction In this section, we will learn about the working with a common analogue-to-digital (ADC), ADC0804 and its interface with 89C51 MCU using assembly language programming.

Figure 9-1 Pinout of ADC0804

This is an 8-bit ADC that produces the 8-bit digital numbers corresponding to the analogue voltage at its input. It is interfaced with microcontroller through its control lines i.e. WR, RD, INTR and CS. The line CS must be logic low to perform any conversion with ADC. WR line should go low to start new conversion and INTR signals the completion of conversion by placing logic 0 on it. When conversion is completed, RD line must be pulled to logic 0 by the MCU to read the 8-bit result from the data bus of ADC. A typical configuration circuit for ADC0804 is shown in figure below.

Figure 9-2 Configuration circuit of ADC0804 and interfacing with MCU

To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programmingTo interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming The WR and INTR lines of the ADC are connected with the I/O lines of MCU and data bus of ADC (DB7… DB0) is connected with the 8-bit port of MCU.

LCD OperationThis In-Lab Tasks 1.1.1 Create an assembly language program the converts the analog voltage into digital value and displays it on LED bar display Program ADC_WR ADC_RD ADC_INT LED EQU ADC EQU

EQU EQU EQU P1 P3

P2.0 P2.1 P2.2

ORG 0000H LJMP MAIN ORG

0030H

MAIN: CALL CALL MOV JMP CONVERT: SETB SETB NOP CLR NOP SETB JB CLR NOP MOV SETB RET

DELAY CONVERT LED, A MAIN

;RESULT IS IN A ;WRITE RESULT TO BAR DISPLAY

ADC_WR ADC_RD ADC_WR ADC_WR ADC_INT,$ ADC_RD A, ADC ADC_RD

;POLL FOR INTR = 0

;READ ADC PORT IN A

;SUBROUTINE GENERATES SOME DELAY DELAY: MOV R1, 250 LOOP1: MOV R0, #0FFH DJNZ R0, $ MOV R0, #0FFH

To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programmingTo interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming DJNZ R0, $ MOV R0, #0FFH DJNZ R0, $ MOV R0, #0FFH DJNZ R0, $ DJNZ R1, LOOP1 RET

END

9.1.3 Write a complete assembly language program to turn on an LED with input from ADC Write a complete assembly language program that turns on an LED when ADC output becomes greater than 150. LED should remain off when ADC output is less than 150.

To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programmingTo interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming

The student performance for the assigned task during the lab session was:

Excellent

The student completed assigned tasks without any help from the instructor and showed the results appropriately.

4

Good

The student completed assigned tasks with minimal help from the instructor and showed the results appropriately.

3

Average

The student could not complete all assigned tasks and showed partial results.

2

Worst

The student did not complete assigned tasks.

1

Instructor Signature: ______________________________

Date: ____________________

To interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programmingTo interface an Analogue to Digital Converter (ADC) with 8051 MCU using Assembly Language programming...


Similar Free PDFs