0% found this document useful (0 votes)
15 views4 pages

2 Test

Uploaded by

Mr. Originator
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

2 Test

Uploaded by

Mr. Originator
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Test 2 NAME OF THE COURES WITH CODE MAX

MARKS
Date 16/05/2023 Embedded C Programming (20EC43P) 30
Time 9:30 to 10:50 Semester 4th MONTH/YEAR MAY-2023
am
Name of course coordinator: RESHMA M
Answer one full question from each sections

SECTION-1
1.A) Define Microprocessor and Microcontroller(or)
Microcontroller:-

A microcontroller is a highly integrated chip that contains a CPU, scratch pad RAM, special and
general purpose register arrays, on chip ROM/FLASH memory for program storage, timer and
interrupt control.

Micprocessors:

A microprocessor is a computer processor that incorporates the functions of a central processing unit
on a single integrated circuit (IC), or at most a few integrated circuits.
The microprocessor is a multipurpose, clock driven, register based, digital integrated circuit that
accepts binary data as input, processes it according to instructions stored in its memory, and
provides results as output.

1.A) List the features of 8051 microcontroller.


 8 bit CPU.
 On chip Oscillator.
 4k byte of on chip ROM.
 128 bytes of on chip RAM.
 32 I/O lines arranged as four 8 bit ports P0,P1,P2,P3.
 21 special function registers
 2 timer
 Full duplex one serial port
 6 interrupt resources.
 64kB of external data memory(RAM)
 64kB of external program memory(ROM)
1.B) Identify the interfacing connection used to access the external
ROM from 8051.(or)

When the on chip 4k ROM is not sufficient to store program, external ROM chip can be used.

 PORT0 provide lower 8 bit address A0-A7 and PORT2 provides higher 8 bit A8-A15. PORT0 is
used to carry both address and data bits.
 ALE pin of 8051 is used to indicate whether bits present on PORT0 are pertaining to address
or data.
 A latch IC 74LS373 is used to hold lower bytes of address provides by port0 when ALE=1.
 EA(External Access) pin must be connected to ground to access external ROM is illustrate in
figure

1.B) Identify the interfacing connections used to access 1K bytes of


external RAM from 8051.

Fig illustrates interfacing of 1k byte RAM with 8051.

 RD line is connected to RAM’s OE(Output Enable) and WR is connected to RAM W line.


 EA pin must be connected to +5V. PSEN signal is not used.
 PORT0 id=s used to Carry both data and address bit (lower 8 bit) PORT2 carries only upper 8
address bit.
 Maximum of 64k external RAM can be interfaced with 8051. The instruction MOVX and
register DPTR are used to access external RAM.
 ALE is used to indicate whether the bit on PORT0 are related to address or data when ALE=1
the port 0 carries address bit and are given to the latch.
SECTION-2
2.A)Explain the 8051 addressing modes. (or)
There are 5 addressing modes:-

1. Immediate addressing mode:- In this mode immediate data is a part of the instruction. And
the immediate data is preceded by “#” sign.
Ex-MOV A,#20H
2. Register addressing mode.:- In this mode data is available in one of the register available
in 8051 that register name is specified in the instruction.
EX- MOV A,R3;
3. Direct addressing mode:- In this mode the address of the memory location where the data is
stored is part of the instruction.
EX- MOVR3,22H;
4. Register indirect addressing mode:- In this mode 2 register R0 and R! are used as
memory pointers to hold the address pf the memory location where the data is stored.
EX- MOV A,@RO
5. Indexed addressing mode:- This mode is used to access data in ROM. This mode is used
to access data elements of look up table enteries located in ROM spaces.
a. EX- MOV A,@A+DPTR

2.A)Explain the structure of embedded C program.


The structure of C is show below.

Comments:-

A comment helps the reader to understand the code easily.

Ex c=a+b;/*

2.B)Analyse the following code indicate what is the result and in


which register the result would the result would be stored.
ORG 0000H
MOV A,#05H;

ANL A,#15H;

MOV R4,A;

END

2.B) 2.B)Analyse the following code indicate what is the result and in
which register the result would the result would be stored.
Assume 50h-02h, and 52=03h.

ORG 0000H

MOV A,50H;

MOVB,52;

MUL AB;

MOV R1,A;

MOV R2,B;

END

SECTION-3
3)Develop an 8051 Assembly Language program to move a block of
data within internal Ram.
3)Develop an 8051 Assembly Language program to convert packed
BCD to unpack BCD.

You might also like