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

Similar documents
The 8051 microcontroller has two 16-bit timers/counters called T0 and T1.

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code:

Microcontroller and Applications

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

FACULTY OF ENGINEERING LAB SHEET

EE6502- MICROPROCESSOR AND MICROCONTROLLER

Timers and interrupts

CPEG300 Embedded System Design. Lecture 8 Timer

Q.1. A) Attempt any THREE of the following:

8051 Microcontroller

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

WINTER 14 EXAMINATION

ELEG3923 Microprocessor Ch.9 Timer Programming

C51 Family. Architectural Overview of the C51 Family. Summary

Module Contents of the Module Hours COs

Chapter 09. Programming in Assembly

8051 Overview and Instruction Set

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

CHAPTER TIMER PROGRAMMING

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

Introduction To MCS-51

Microcontroller Intel [Instruction Set]

8051 Microcontroller. Ali Ziya Alkar 1

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

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

Three criteria in Choosing a Microcontroller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Embedded Controller Programming

8051 Microcontroller

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers

MODEL ANSWER SUMMER 17 EXAMINATION

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

Question Bank Microprocessor and Microcontroller

8051 Timers. Class 7 EE4380 Fall Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

8051 Core Specification

WINTER 14 EXAMINATION Subject Code: Model Answer Page No: 1/ 26

VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU

CS 320. Computer Architecture Core Architecture

C H A P T E R 1 INTRODUCTION

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

Microcontroller and Embedded Systems:

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

UNIT IV MICROCONTROLLER

8051 Microcontroller

8051 Microcontroller memory Organization and its Applications

1. Pin diagram of 8051 and ports

8051 microcontrollers

8XC51RA RB RC Hardware Description


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

80C51 Block Diagram. CSE Overview 1

8051 Serial Communication

Digital Blocks Semiconductor IP

Mod-3: Interrupts,Timer operation,serial communication 1

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION

Digital Blocks Semiconductor IP

Programming of 8085 microprocessor and 8051 micro controller Study material

2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution:

Lecture 9. Timer Operations and Programming

8051 MICROCONTROLLER

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

1. Attempt any three of the following: 15

AT Bit Spread- Spectrum Microcontroller. Preliminary. Features. Description. Pin Configuration

Vidyalankar T.E. Sem. V [EXTC] Microprocessors and Microcontrollers I Prelim Question Paper Solution V SS (GND)

8051 Timers and Serial Port

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT- IV

Rev. No. History Issue Date Remark

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07)

THE 8051 MICROCONTROLLER Simple comparison: Pentium vs. 8051


80C451 operation of port 6

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch

Assembly Language programming (2)

ENE 334 Microprocessors

Digital Blocks Semiconductor IP

Preliminary W77C32 8 BIT MICROCONTROLLER GENERAL DESCRIPTION FEATURES

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) Summer 2016 EXAMINATIONS.

Application Brief D-005

Microcontroller. Instruction set of 8051

T.Y. Diploma : Sem. V [EJ/EN/ET/EX/DE/IS/IC/IE/EV/MU] Micro-controller

8-bit Microcontroller with 2/4-Kbyte Flash AT89LP2052 AT89LP4052

UNIT MICROCONTROLLER AND ITS PROGRAMMING

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER 14 EXAMINATION Model Answer

W77IE58 8-BIT MICROCONTROLLER. Table of Contents-- Publication Release Date: December Revision A2

Chapter 09. Programming in Assembly

Department of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1

SUMMER 13 EXAMINATION

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

MODULE-1. Short Answer Questions

Microcontroller Lab Manual

~: Simple Programs in 8051 assembly language :~

Dodatak. Skup instrukcija

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

Transcription:

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following. (9M) 1) Describe the instructions SWAP A and MOVX@DPTR,A with one example. (3Marks) SWAP A - Function-swap nibbles within the accumulator. Description- Example- SWAP A interchange the low order and high order nibbles of the accumulator. No flags are affected. suppose the A=(11000101B) Langth-1Byte Operation: A3-A0 then after SWAP A A=01011100B MOVX@DPTR,A - Function-Move external Description- A7-A4 Load content of accumulator into External memory indicated by DPTR

Length-1Byte Operation- (DPTR) (A) 2) Describe function of PSEN, EA, XTAL1& XTAL@ pins of 051 microcontroller. (3Marks) PSEN - program store enable is the read strobe to external program memory. when the 8051 is executing code from internal program memory, PSEN is inactive(high) when the device is executing code from external program memory, PSEN is activated twice. EA - EA must be strapped to Vss in order to enable the 8051 to fetch code from external program memory locations starting at 0000H up to 0FFFFH. EA must be strapped to VCC for internal program execution. XTAL1- input to the inverting oscillator amplifier and input to the internal clock generating circuits. XTAL2- this is an output line of the internal inverting oscillator amplifier. 3) Compare data memory and program memory w.r.t. 8051 microcontroller. (3Marks)

Data memory Program memory 1) 8051 provides on chip 256 bytes of It provides on chip 4K bytes of ROM RAM 2) address is 8 bit address is 16 bit 3) it is always used to store data not program it is always used to store program not data 4) Describe one mode of timer of 8051 microcontroller. (3Marks) 13-bit Time Mode (mode 0) Timer mode "0" is a 13-bit timer. It provides compatibility with its predecesor, the 8048. Generally the 13-bit timer mode is not used in new development. When the timer is in 13-bit mode, TLx will count from 0 to 31. When TLx is incremented from 31, it will "reset" to 0 and increment THx. Thus, effectively, only 13 bits of the two timer bytes are being used: bits 0-4 of TLx and bits 0-7 of THx. 16-bit Time Mode (mode 1) Timer mode "1" is a 16-bit timer. This is a very commonly used mode. It functions just like 13-bit mode except that all 16 bits are used.

TLx is incremented from 0 to 255. When TLx is incremented from 255, it resets to 0 and causes THx to be incremented by 1. Since this is a full 16-bit timer, the timer may contain up to 65536 distinct values. If you set a 16-bit timer to 0, it will overflow back to 0 after 65,536 machine cycles. 8-bit Time Mode (mode 2) Timer mode "2" is an 8-bit auto-reload mode. When a timer is in mode 2, THx holds the "reload value" and TLx is the timer itself. Thus, TLx starts counting up. When TLx reaches 255 and is subsequently incremented, instead of resetting to 0 (as in the case of modes 0 and 1), it will be reset to the value stored in THx. The auto-reload mode is very commonly used for establishing a baud rate. Split Timer Mode (mode 3) Mode 3 is the split timer mode and is different for each timer. Timer 0 in mode 3 is split into two 8-bit timers. TL0 and TH0 act as separate timers with overflows setting the TF0 and TFI bits respectively. Timer 1 is stopped in mode 3 but can be started by switching it into one of the other modes. The only limitation is that the usual Timer I overflow flag, TF1, is not affected by Timer 1 overflows, since it is connected to TH0. The 8051 appears to have a third timer.

Timer 1 can be turned on and off by switching it out of and into its own mode 3. It can still be used by the serial port as a baud rate generator Q2.) Attempt any TWO of the following (8M) 1) Draw the format of TMOD register and write the function of each bit. (4Marks) TMOD format: TMOD (89h) SFR Bit Name Explanation of Function Timer 7 GATE1 When this bit is set the timer will only run when INT1 (P3.3) is high. When this bit is clear the timer will run regardless of the state 1 of INT1. 6 C/T1 When this bit is set the timer will count events on T1 (P3.5). When this bit is clear the timer will be incremented every machine cycle. 1 5 T1M1 Timer mode bit 1 4 T1M0 Timer mode bit 1 3 GATE0 2 C/T0 When this bit is set the timer will only run when INT0 (P3.2) is high. When this bit is clear the timer will run regardless of the state of INT0. When this bit is set the timer will count events on T0 (P3.4). When this bit is clear the timer will be incremented every machine cycle. 0 0

1 T0M1 Timer mode bit 0 0 T0M0 Timer mode bit 0 The modes of operation are: TxM1 TxM0 Timer Description Mode of Mode 0 0 0 0 1 1 1 0 2 1 1 3 13-bit Timer. 16-bit Timer 8-bit autoreload Split timer mode 3) Write an assembly language program to transfer block of ten bytes stored in internal data memory. (4Marks) mov r0,#0ah mov r1,#30h mov r2,#40h up: mov a,@r1 mov @r2,a inc r1 inc r2 djnz r0,up here: sjmp here

Q.3) Attempt any TWO of the following (8M) 1) List addressing modes of 8051 microcontroller with one suitable instruction each. (4Marks) 1) Register Addressing- mov A,R1 2) Direct Addressing- mov A,40h 3) Register indirect Addressing- mov A,@R1 4) Immediate Addressing- mov A,#04h 2) Write an assembly language program to arrange the given 10 numbers in descending order. (4Marks) REPEAT: CLR 44H MOV R0,#40H MOV A,@R0 MOV R3,A DEC R3 INC R0 MOV 60H,@R0 INC R0 MOV A,@R0 CJNE A,60H,DN AJMP FN DN: JC FN XCH A,60H MOV @R0,A

DEC R0 MOV @R0,60H INR R0 SETB 44H FN:DJNZ R3,AGAIN JB 44H,REPEAT 3) Describe the alternate functions of port3 of 8051 microcontroller. (4Marks) pin name Alternate function P3.0 RXD Serial input line P3.1 TXD Serial output line P3.2 External interrupt 0 INT0 P3.3 External interrupt 1 INT1 P3.4 T0 Timer 0 external input P3.5 T1 Timer 1 external input P3.6 External data memory write strobe WR P3.7 External data memory read strobe RD