Microprocessor Micro Controllers
Microprocessor Micro Controllers
1. What is microprocessor?
It is a program controlled semi conductor device (IC), which fetches,
decodes and execute instructions.
co m
3. What is a bus?
ld .
signals.
o r
Bus is a group of conducting lines that carries data, address and control
tu w
j n
The microprocessor is to fetch (read) the data from memory or input device
.
for processing and after processing it has to store (write) the data to memory or output
w
devices. Hence the data bus is bi-directional.
w
w
5. Why data bus is bi-directional?
The address is an identification number used by the microprocessor to
identify or access a memory location or input/output device. It is an output signal
from the processor. Hence the address bus is unidirectional.
co m
The instruction cycle is divided in to fetch and execute cycles. The fetch
ld .
cycle is executed to fetch the opcode from memory. The execute cycle is executed to
r
decode the instruction and to perform the work instructed by the instruction.
o
10. List the flags of 8085?
tu w
There are five flags in 8085.They are sign flag, zero flag, auxiliary carry
j n
flag, parity flag and carry flag.
.
w w
11. What does memory-mapping mean?
The memory mapping is the process of interfacing memories to
w
microprocessor and allocating addresses to each memory locations.
co m
Hardware interrupts- The interrupts where the CPU pins are used to receive
interrupt requests , are called hardware interrupts.
ld .
o r
Software interrupts – This interrupt is caused by the execution of the instruction.
These are special instructions supported by the microprocessor.
tu w
16. What are the types of hardware interrupts?
. j n TRAP
RST 7.5
w w RST 6.5
RST 5.5
w INTR
17. Difference between memory mapped I/o and I/O mapped I/o?
Memory mapped I/O I/O mapped I/O
1. In this device address is 16- bit. Thus 1. In this device address is 8-bit. Thus Ao
Ao to A15 lines are used to generate the to A7 or A8 to A15 lines are used to
device address generate device address.
2. MEMR and MEMW control signals 2. IOR and IOW control signals are used
are used to control read and write I/O to control read and write I/O operations.
operations.
3. Instructions available are 3. Instructions available are IN and OUT.
LDA,STA,MOV R,M , ADD M etc
4. Data transfer is between any register 4. Data transfer is between accumulator
and I/O device. and I/O device.
5. Decoding 16-bit address may require 5. Decoding 8-bit address will require
more hardware. less hardware.
co m
ld .
READY – It is used by the microprocessor to sense whether a peripheral is ready or
tu w
ALE – In 8085 , ADo to AD7 lines are multiplexed and lower half of address (Ao to
A7) is available only during T1 of the machine cycle. The latching of lower half
j n
address from the multiplexed address lines by using ALE signal.
.
IO/M - indicates whether I/O operation or memory operation is being carried out.
w w
HOLD – This signal indicates that another master is requesting for the use of address
bus, data bus and control bus.
w
SID(Serial Input Data) – This input signal is used to accept serial data bit by bit from
the external device.
SOD(Serial Output Data) – This is an output signal which enables the transmission of
serial data bit by bit to the external device.
Timing Diagram
co m
8. CMA
9. CMC
1
1
4
4
OF
OF
ld .
10. ADD M
11. CMP M
2
2
7
7
o r
OF,MR
OF,MR
12. LDA address 4
tu
13
w Of,MR,MR,MR
j. n
13. DAD rp 3 10 OF,Bus Idle,Bus Idle
14. INR M 3 10 OF,MR,MW
15. XTHL
w w
16. JMP address3
5
3
16
10
OF,MR,MR,MW,MW
OF,MR,MR
w
17. J condition
18. PUSH rp
19. POP rp
2
3
3
7
10
10
OF,MR
OF,MW,MW
OF,MR,MR
20. CALL address 5 18 OF,MR,MR,MW,MW
21. RET 3 10 OF,MR,MR
22. RST 3 12 OF,Mw,MW
23. MOV r,M 2 7 OF,MR
24. MOV M,r 2 7 OF,MW
25. IN address 3 10 OF,MR,I/O Read
26. OUT address 3 10 OF,MR,I/O Write
19. Comparison between full address decoding and partial address decoding?
Full Address Decoding Partial Address decoding
1. All higher address lines are decoded to 1. Few higher address lines are decoded
select the memory or I/O device. to select the memory or I/O device.
2. More hardware is required to design 2. Hardware required to design decoding
decoding logic. logic is less and sometimes it can be
eliminated.
3. Higher cost for decoding circuit. 3. Less cost for decoding circuit.
4. No Multiple addresses. 4. It has a advantage of multiple
addresses.
5. Used in large systems 5. Used in small systems
co m
20. What is ALE?
ld .
o r
The ALE (Address latch enable) is a signal used to demultiplex the
address and data lines using an external latch. It is used to enable the external latch.
.
input/output devices to get extra time for data transfer or to introduce wait states in
w
the bus cycles.
w
w
22. Give some examples of port devices used in 8085 microprocessor based system?
The various port devices used in 8085 are
8212,8155,8156,8255,8355,8755.
co m
When an interrupt is accepted, if the processor control branches to a
specific address defined by the manufacturer then the interrupt is called vectored
ld .
interrupt. In Non-vectored interrupt there is no specific address for storing the
tu w
27. List the software and hardware interrupts of 8085?
j n
Software interrupts : RST 0,RST 1,RST 2,RST 3,RST 4,RST 5,RST 6,RST 7
.
Hardware interrupts : TRAP,RST 7.5,RST 6.5,RST 5.5, INTR.
w w
28. What is TRAP?
29. How clock signals are generated in 8085 and what is the frequency of the internal
clock?
The 8085 has the clock generation circuit on the chip but an external
quartz crystal or LC circuit or RC circuit should be connected at the pins X1 andX2.
The maximum internal clock frequency of 8085 is 3.03MHz.
co m
Opcode(operation code) is the part of an instruction that identifies a
specific operation. Operand is a part of instruction that represents a value on which
the instruction acts.
ld .
o r
33. How the 8085 processor differentiates a memory access and I/O access?
tu w
The memory access and I/O access is differentiated using IO/M signal.
The 8085 processor asserts IO/M low for memory operation and high for I/O
operations.
. j n
w w
34. When the 8085 processor checks for an interrupt?
In the second T-state of the last machine cycle of every instruction, the
w
8085 processor checks whether an interrupt request is made or not.
co m
For synchronous data transfer scheme, the processor does not check
the readiness of the device after a command have been issued for read/write
ld .
operation. For this scheme the processor will request the device to get ready and then
r
read/write to the device immediately after the request.
o
tu w
40. What is asynchronous data transfer scheme?
In asynchronous data transfer scheme, first the processor sends a
j n
request to the device for read/write operation. Then the processor keeps on polling the
.
status of the device. Once the device is ready, the processor executes a data transfer
w
instruction to complete the process.
w
w
41. What are the internal devices of 8255?
The internal devices of 8255 are port-A, port-B, port-C. The ports can be
programmed for either input or output function in different operating modes.
co m
ld .
The baud rate is the rate at which the serial data are transmitted. Baud rate
tu w
46. What are the tasks involved in keyboard interface?
j n
The tasks involved in keyboard interfacing are sensing a key actuation,
.
Debouncing the key and generating key codes( Decoding the key). These tasks are
w w
performed software if the keyboard is interfaced through ports and they are performed
by hardware if the keyboard is interfaces through 8279.
w
47. How a keyboard matrix is formed in keyboard interface using 8279?
The return lines, RL0 toRL7 of 8279 are used to form the columns of keyboard
matrix. In decoded scan lines SL0 t0SL3 of 8279 are used to form the rows of
keyboard matrix. In encoded scan mode, the output lines of external decoder are used
as rows of keyboard matrix.
co m
ld .
A device which contains the microprocessor with integrated peripherals like
o r
memory, serial ports, parallel ports, timer/counter, interrupt controller, data
acquisition interfaces like ADC, DAC is called micro controller.
tu w
52. List the features of 8051 micro controllers?
.
•
•j nSingle supply +5v operation using HMOS technology.
4096 bytes program memory on-chip.
w w •
•
128 data memory on chip.
4 register banks
w •
•
2 multiple modes, 16 bit timer/counter
Extensive Boolean processing capabilities.
• 64KB external RAM size.
• 32 bi-directional I/O lines.
•
53. Explain the operating mode 0 of 8051 serial port?
In this mode serial data enters and exists through RXD, TXD outputs the
shift clock. 8-bits are transmitted or received:8-data bits(LSB first). The baud rate is
fixed at 1/12 the oscillator frequency.
54. Explain the operating mode 2 of 8051 serial port?
In this mode 11 bits are transmitted (through TXD) or received (through
(RXD): a start bit(0), 8 data bits( LSB first), a programmable 9th data bit and a stop
bit(1).
On transmit, the 9th data bit can be assigned the value 0 or 1. On receive, the 9th data
bit go into the RB8 in special function register SCON, while the stop bit is ignored.
The baud rate is programmable to either 1/32 or 1/64 the oscillator frequency.
co m
RXD): a start bit(0), 8 data bits(LSB first), a programmable 9th data bit and a stop
bit(1).It is same as mode 2 except the baud rate. The baud rate in mode 3 is variable.
ld .
56. Explain the interrupts of 8051 micro controller?
•
o r
External interrupt 0 (IE0) – Highest priority
•
•
Timer interrupt 0 (TF0)
tu
External interrupt 1 (IE1) w
•
• j n
Timer interrupt 1 (TF1)
.
Serial port Interrupt
w w
Receive interrupt (RI)
Transmit interrupt (TI)
- lowest priority
w
57. How many bytes of internal RAM and ROM supported by 8051 micro controller?
128 bytes of internal RAM and 4 bytes of ROM.
61. What are the use of scratch pad area of internal RAM of 8051?
co m
In internal RAM 80 bytes constitutes the scratch pad area. The scratch
pad bytes can be programmed as a general purpose registers.
ld .
o
62. What are the flags supported by 8051 controller?
r
•
•
Carry flag
Auxiliary carry flag
tu w
•
• j n
Over flow flag
.
General purpose user flag
w
•
•
w
Register bank select bit one
Register bank select bit zero
w • Parity flag
66. Write a program to mask the 0th and 7th bit using 8051?
co m
MOV A,#data
ld .
ANL A,#81
MOV DPTR,#4500
o r
LOOP:
MOVX @DPTR,A
SJMP LOOP
tu w
. j n
67. List the addressing modes of 8051?
w
•
•
w
Direct addressing
Register addressing
w •
•
Register indirect addressing
Implicit addressing
• Immediate addressing
• Index addressing
• Bit addressing
co m
MOV A,# data
ld .
SWAP A
o r
MOV A,#9F
tu w
72. Write a program to subtract two numbers & exchange the digits using 8051?
. j n
MOV R0,#40
SUBB A,R0
w w SWAP A
w
73. What are the different types of Address decoding Techniques?
Absolute decoding/Full decoding
Linear decoding/Partial decoding
74. Comparison between full address decoding and Partial address decoding?
Full address decoding Partial address decoding
1. All higher address lines are decoded to 1. Few higher address lines are decoded
select the memory or I/O device. to select the memory or I/O device.
2. More hardware is required to design 2. Hardware required to design decoding
decoding logic. logic is less and sometimes it can be
eliminated.
3. Higher cost for decoding circuit. 3. Less cost for decoding circuit.
4. No multiple addresses. 4. It has a disadvantage of multiple
addresses. (Shadow addresses)
5. Used in large systems. 5. Used in small systems.
co m
peripheral is ready or not. If READY pin is high, the peripheral is ready otherwise
8085 enters in to wait state.
ld .
76. What is a Non-maskable interrupt?
o r
w
It is unaffected by any mask or interrupt enable. Eg: TRAP
tu
j n
77. What is a Data pointer register?
.
The data pointer register (DPTR) consists of a high byte(DPH) and a low
w w
byte (DPL) functions to hold 16 bit address. It may be manipulated as a 16-bit data
register or as independent 8-bit registers. It serves as a base register in indirect jumps,
w
look up table instructions and external data transfer.
co m
ld .
81. What is IMR(Interrupt mask register)?
o r
IMR stores the masking bits of the interrupt lines to be masked. This
w
register can be programmed by an operation command word (OCW).
tu
j n
82. What is priority resolver?
.
It determines the priorities of the bits set in the Interrupt request
w w
register (IRR).The bit corresponding to the highest priority interrupt input is set in the
ISR during INTA input.
w
83. What is the use of IRR?
The interrupt request register is used to store all the interrupt levels
which are requesting the service. The eight interrupt inputs sets corresponding bits of
the Interrupt Request Register upon the service request.
co m
STAX rp – Store the contents of Accumulator register (A) in memory location whose
ld .
LDAX rp – Load Accumulator register (A) with the contents of memory location
whose address is specified by BC or DE register pair.
o r
memory block B2?
tu w
87. Write an assembly language program to transfer data from memory block B1 to
. j n
MVI C,0AH; Initialize counter
LXI H, 2200H; Initialize source memory pointer
co m
ld .
LXI rp, data(16) – Load 16 –bit immediate data to specified register pair or
o r
stack pointer. The rp is 16 – bit register pairs such as BC, DE, HL or stack pointer.
91. Write the difference between LDA and STA instruction?
tu w
LDA – Load data in to Accumulator register(A) directly from the address specified
j n
STA – Store the contents of Accumulator register(A) to the address specified with in
the instruction.
.
w w
92. What are the types of rotate instructions?
co m
It interchanges the low and high order nibbles of the Accumulator (bits 0-3
and bits 4-7)
ld .
96. What is SCON?
o r
tu w
SCON is the serial port control register , which contains not only the mode
selection bits (SM0 – SM2 ,REN), but also the 9th data bit for transmit and receive
j n
(TB8 and RB8) and the serial port interrupt bits (TI and RI).
.
SM0 – Serial port mode control bit 0
w w
SM1 – Serial port mode control bit 1
SM2 – Serial port mode control bit 2
97. How we calculate the Baud rate for serial port in mode 0?
Baud Rate = Oscillator frequency/12
m
the arithmetic instructions (Addition, Subtraction, Multiplication and Division)
co
ld .
16 - Marks Questions
o r
Block diagram
tu w
1. With Neat diagram, explain the Architecture of 8085?
. j n
Explaination
w w
2. Explain the instruction sets of 8085?
• Data transfer instructions
w •
•
Arithmetic instructions
Logical instructions
• Branching instructions
• Machine control instructions
co m
ld .
6. Write the Assembly language program to sort a set of numbers in Ascending order?
Program
Output
o r
tu w
7. Write an Assembly language program to find the largest number in an array?
. j n
Program
Output
w w
8. With neat block diagram, explain the Architecture of 8279?
w Block diagram
Explanation
co m
• Scanned sensor matrix
ld .
• Strobed input
Display modes
o r
•
•
tu w
Left entry (Type writer mode)
Right entry (Calculator mode)
. j n
14. Explain the operating modes of 8255?
co m
Types
ld .
Explanation
o r
Diagram
tu w
21. How 8279 is interfaced with 8085?
. j nExplanation
w w
22. How stepper motor is interfaced with 8085?
Diagram
w Explanation
23. Explain about Servo motor interfacing?
26. Write an Assembly language program to generate square wave using Digital to
Analog interface?
•
co m
•
Program
Output
ld .
27. Compare A/D and D/A interfacing?
o r
w
28. Explain the Serial communication in 8051?
tu
. j n
29. Explain the Architecture of 8051?
w w Block diagram
Explanation
30. Write an Assembly language program to add two 16-bit numbers using 8051?
w • Program
• Output