Professional Documents
Culture Documents
MPMC 2 Marks UNIT 4
MPMC 2 Marks UNIT 4
PART A
A device which contains the microprocessor with integrated peripherals like memory, serial ports,
parallel ports, timer/counter, interrupt controller, data acquisition interfaces like ADC,DAC is called
microcontroller.
3. Specify the single instruction, which clears the most significant bit of B register of 8051, without
affecting the remaining bits.
Single instruction, which clears the most significant bit of B register of 8051, without affecting
the remaining bits is CLR B.7.
Microprocessor Microcontroller
Microprocessor contains ALU, general purpose Microcontroller contains the circuitry of
registers, stack pointer, program counter, clock microprocessor and in addition it has built- in
timing circuit and interrupt circuit. ROM, RAM, I/O devices, timers and counters
It has many instructions to move data between It has one or two instructions to move data
memory and CPU. between memory and CPU
It has one or two bit handling instructions. It has many bit handling instructions
Access times for memory and I/O devices are Less access times for built-in memory and I/O
more devices
Microprocessor based system requires more Microcontroller based system requires less
hardware. hardware reducing PCB size and increasing the
reliability
8.Write a program to subtract the contents of R1 of Bank0 from the contents of R0 of Bank2.
MOV PSW, #10
MOV A, R0
MOV PSW, #00
SUBB A, R1
Port 3
Interrupt priority control register.
Interrupt enable control register.
19. Write Code to Send 55h to Ports P1 And P2 Using Their Names & Their Addresses.
MOV A, #55H ; A = 55H
MOV P1, A ; P1 = 55H
MOV P2, A ; P2 = 55H
II. P1 address = 80H ; P2 address = AOH
MOV A, #55H ; A = 55H
MOV 80H, A ; P1 = 55H
MOV OAOH, A ; P2 = 55H.
21. What Is The Difference Between Direct And Register Indirect Addressing Mode?
Loop is most efficient and is possible only in register indirect addressing whereas looping is not direct
addressing mode.
SETB PSW – 4
MOV R7, A.
26. Write A Program To Save The Status Of Bits P1.2 And P1.3 On Ram Bit Locations 6 And 7
Respectively.
MOV C, P1.2 ; save status of P1.2 on CY
MOV O6, C ; save carry in RAM bit location 06
MOV C, p1.3 ; save status of p1.3 on CY
MOV 07, C ; save carry in RAM bit location 07.
27. Write A Program To See If Bits 0 And 5 Of Register B R1. If They Are Not, Make Them So
And Save It In R0.
JNB OFOH, NEXT – 1 ; JUMP if B.0 is low
SET BOFOH ; Make bit B.0 high
NEXT – 1:JNB OF5H, NEXT – 2 ; JUMP if B.5 is low
SETB OF5H ; Make B.5 high
NEXT – 2: MOV R0, B ; Save register B.
Output pin
A logic zero (0) is applied to a bit of the P register. The output FE transistor is turned on, thus
connecting the appropriate pin to ground.
Input Pin
A logic one (1) is applied to a bit of the P register. The output FE transistor is turned off and the
appropriate pin remains connected to the power supply voltage over a pull-up resistor of high resistance.
Logic state (voltage) of any pin can be changed or read at any moment. A logic zero (0) and logic one (1)
are not equal. A logic one (0) represents a short circuit to ground.
31. Give the alternate functions for the port pins of port3
PIN ALTERNATE USE
P3.0-RXD Serial data input
P3.1- TXD Serial data output
P3.2-INTO External interrupt 0
Operation: RET
Function: ReturnFrom Subroutine
Syntax: RET
Byte
Instructions OpCode Flags
s
PART-B
2. Draw the Pin Diagram of 8051 and explain the function of various signals
PINS AND SIGNALS OF 8031/8051 MICROCONTROLLER
• The INTEL 805 F is an 8-bit microcontroller with 128 byte internal RAM and 4kb internal
ROM.
• The INTEL 8031 is same, as 8051 except that it does not have internal ROM.
• The 8051 is a pin 40 pin IC available in Dual-In line package (DIP).
• Requires a single power supply of +5V.
• Its maximum internal clock frequency rating is 12 MHz.
This is type of addressing mode in which we use the register name directly as source data.
e.g MOV A, R5
In this mode of addressing address of source data is given by value at register indirectly
e.g. MOV A, @R1
3. Explain the I/O ports and circuits with neat diagrams wherever necessary
PORT 0:
The structure of a Port-0 pin is shown in fig 6.It has 8 pins (P0.0-P0.7).
PORT 1:
The structure of a port-1 pin is shown in fig below.It has 8 pins (P1.1-P1.7) .
PORT 2:
The structure of a port-2 pin is shown in fig. below. It has 8-pins (P2.0-P2.7).
PORT 3:
Port-3 (P3.0-P3.7) having alternate functions to each pin,The internal structure of a port-3 pin is shown in
fig below.
TCON 88 Timer control. Both bit addressing and byte addressing possible.