DEPARTMENT OF ELECTRICAL AND …chettinadtech.ac.in/storage/14-12-31/14-12-31-10-23-41...Ans:a)...

34
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING MICROPROCESSOR AND MICRO CONTROLLER 8085 PROCESSOR UNIT I- 2 Marks -QUESTIONS AND ANSWERS 1.Define microcomputer. A system designed using microprocessor as its CPU is called a microcomputer. 2. What is the function of microprocessor in a system? The microprocessor is the master in the system, which controls all the activity of the system. It issues address and control signals and fetches the instruction and data from memory. then it executes the instruction to take appropriate action. 3.List the applications of microcomputer. Personal computing, calculators, small business system, control applications and instrumentation systems. 4.What do you meant by 8-bit and 16-bit processor. Mention some systems in each type. The processors are classified into 8-bit and 16-bit depending on the basic data size handled by the ALU of the processor. 8-bit microprocessors: 8085,Z80, Motorola 6800 16-bitmicroprocessors: 8086,Z8000, MC68000 5.What is ALE? 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. 6.Explain the function of IO/M in 8085? The IO/M is used to differentiate memory access and I/O access. For IN and OUT instruction it is high. For memory reference instructions it is low. 7.What is a flag? (APRIL/MAY-04) Flag is a flip-flop used to store the information about the status of the processor and the status of the instruction executed most recently. There are five flags in 8085.They are sign flag, zero flag, auxiliary carry flag, parity flag and carry flag. 8. What are the hardware interrupts of 8085?give its priority. The hardware interrupts in 8-85 are TRAP, RST 7.5,RST 6.5 and RST 5.5.The TRAP has the highest priority, followed by RST 7.5,RST 6.5, RST 5.5 and INTR. 9.What is assembly language? The language in which the mnemonics are used to write a program is called assembly language. The mnemonics are short hand form of the instructions and which the manufacturers of microprocessor give.

Transcript of DEPARTMENT OF ELECTRICAL AND …chettinadtech.ac.in/storage/14-12-31/14-12-31-10-23-41...Ans:a)...

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING MICROPROCESSOR AND MICRO CONTROLLER

8085 PROCESSOR UNIT I- 2 Marks -QUESTIONS AND ANSWERS

1.Define microcomputer. A system designed using microprocessor as its CPU is called a microcomputer. 2. What is the function of microprocessor in a system?

The microprocessor is the master in the system, which controls all the activity of the system. It issues address and control signals and fetches the instruction and data from memory. then it executes the instruction to take appropriate action. 3.List the applications of microcomputer.

Personal computing, calculators, small business system, control applications and instrumentation systems. 4.What do you meant by 8-bit and 16-bit processor. Mention some systems in each type. The processors are classified into 8-bit and 16-bit depending on the basic data size handled by the ALU of the processor. 8-bit microprocessors: 8085,Z80, Motorola 6800 16-bitmicroprocessors: 8086,Z8000, MC68000 5.What is ALE? 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. 6.Explain the function of IO/M in 8085? The IO/M is used to differentiate memory access and I/O access. For IN and OUT instruction it is high. For memory reference instructions it is low. 7.What is a flag? (APRIL/MAY-04) Flag is a flip-flop used to store the information about the status of the processor and the status of the instruction executed most recently. There are five flags in 8085.They are sign flag, zero flag, auxiliary carry flag, parity flag and carry flag. 8. What are the hardware interrupts of 8085?give its priority. The hardware interrupts in 8-85 are TRAP, RST 7.5,RST 6.5 and RST 5.5.The TRAP has the highest priority, followed by RST 7.5,RST 6.5, RST 5.5 and INTR. 9.What is assembly language? The language in which the mnemonics are used to write a program is called assembly language. The mnemonics are short hand form of the instructions and which the manufacturers of microprocessor give.

10.What is processor cycle (Machine cycle)? The processor cycle is the basic operation performed by the processor. To execute an instruction, the processor will run one or more machine cycles in a particular order. 11. What is instruction cycle? (APRIL/MAY-04) The sequence of operations that a processor has to carry out while executing the instruction is called instruction cycle. Each instruction cycle of a processor inturn consists of a number of machine cycles. 12.What is the need for timing diagram? The timing diagram provides information regarding the status of various signals, when a machine cycle is executed. The knowledge of timing diagram is essential for system designer to select matched peripheral devices like memories, latches, ports etc. 13.What is interrupt acknowledge cycle? (APRIL/MAY-05) The interrupt acknowledge cycle is a machine cycle executed by 8085 processor to get the address of the interrupt service routine in order to service the interrupted device. 14.How many instructions are available in 8085 instruction set? The 8085 instruction set consists of 74 basic instructions and 246 total instructions. 15.what is addressing? The method of specifying the data to be operated by the instruction is called addressing. 16. Differentiate immediate addressing and implied addressing.

Immediate addressing Implied addressing The data is specified in the instruction itself. The data will be a part of the program instruction. E.g. MVI B, 05

The instruction operates on a data available in a pred4efined register. E.g. CMA –complement the content of accumulator.

17. What is the function performed by SIM instruction?APR/MAY2008 The SIM (set interrupt mask0 instruction is used to mask the hardware interrupts RST 7.5,RST 6.5 and RST 5.5.The execution of SIM instruction outputs the content of the accumulator to define interrupt mask bits and also used to output serial data on the SOD line. 18.What is the function performed by RIM instruction? The RIM (Read Interrupt mask) instruction is used to check whether an interrupt is masked or not. It is also used to read data from SID line. 19.What is the function of HLT and NOP instruction? (APRIL/MAY-05) HLT- used to suspend program execution.

NOP-used for producing software delay and reserve memory spaces for future software modifications.

20.what is the need for port?NOV/DEC2007 The I/O devices are generally slow devices and their timing characteristics do not match with processor timings. Hence the I/O devices are connected to system bus through the ports. The port is nothing but a buffered IC which is used to hold the data transmitted from the microprocessor to I/O device or vice-versa. 21. What is an interrupt? Interrupt is a signal send by an external device to the processor so as to request the processor to perform a particular task or work. 22.Differentiate software interrupt and hardware interrupt.

Software interrupt Hardware interrupt These are program instuctions. These instructions are inserted at desired location in a program

It is initiated in a processor by an appropriate signal at the interrupt pin.

It is initiated by the main program It is initiated by an external device

The software interrupts cannot be disabled or masked

Hardware interrupts except TRAP can be disabled or masked.

23.What is vectored and Non-vectored interrupt? When an interrupt is accepted, if the processor control branches to a specific address defined by the manufacturer then the interrupt is called vectored interrupt. In non-vectored interrupt there is no specific address for storing the interrupt service routine. Hence the interrupter device should give the address of the interrupt service routine. 24.What is polling?( NOV/DEC – 06) Polling is a scheme or algorithm to identify the devices interrupting the processor. Polling is employed when multiple devices interrupt the processor through one interrupt pin of the processor. 25. What are the different types of polling? The polling can be classified into software and hardware polling. In software polling the entire polling process is govern by a program. In hardware polling, the hardware takes care of checking the status of interrupting devices and allows one by one to the processor.

POSSIBLE 16 MARK QUESTIONS:

1. Explain the Architecture and pin diagram of 8085 (APRIL/MAY-05,) (APRIL/MAY-08) Ans: Introduction (2 marks)

Block Diagram & description (6 marks) Register structure & description (4 marks)

2. Explain Machine cycles and timing diagrams of 8085 (APRIL/MAY-04)

Ans:a) i) memory read and write cycle steps (8 marks)

ii) timing diagram &explanation (8 marks)

3. Pin details of 8085 – Explain Ans:a) i)40 pins with their names (8 marks) ii) Functions of Pins and explanation (8 marks)

4. Indicate the machine cycles and T-states for LXI , LHLD Ans:a) i)Opcode fetch , memory read and write cycle steps (8 marks) ii) timing diagram &explanation (8 marks)

5. Explain MEMORY INTERFACING of 8085.

1.Types of memory (2) 2. MEMR and MEMW signals are derived from IO/ M , RD and WR signals of mP 8085(6)

3.Typical memory Read and Memory Write Cycles (6) 6. Explain I/O INTERFACING of 8085 (NOV/DEC-06)

1. two broad categories in which data transfer schemes (4) 2. memory mapped I/O scheme (4) 3. I/O mapped I/O scheme (4) 4. Difference in features between memory mapped I/O scheme and I/O mapped I/O

scheme. 7. Explain INTERRUPTS available in 8085 and its types

1.interrupt pins of 8085. (4) 2. 8085 supports two types of interrupts—hardware and software interrupts. (8) 3. interrupt circuit diagram for 8085 and explanation (4)

PROGRAMMING OF 8085 PROCESSOR 1. What are the three enhanced versions of 8085? The 8085 has three enhanced versions, namely the 8085AH , 8085AH-1 and 8085AH-2 These enhanced processors are designed using the HMOS(high density MOS) technology. 2. What is architecture? The microprocessor has a set of instructions designed internally to manipulate data and communicate with peripherals. This process of data manipulation and communication is determined by the logic design of the microprocessor called the architecture. 3. Explain Address Bus. The address bus is a group of 16 lines, A0 to A15. This bus is used to carry 16-bit address. The address bus is unidirectional the MPU uses the address bus to perform the function of identifying a peripheral or a memory location. 4. Explain Data Bus. (APR/MAY 05) The data bus is a group of eight lines used for data flow (i.e) either a instruction , an address or a number. This bus is bi-directional. Data flow in both directions between the MPU and

memory and peripheral devices. The MPU uses the data bus to perform the function of transferring binary information. 5. Explain Control Bus The control bus consists of various signal lines that carry synchronization signals. This bus consists of individual lines that provide a pulse to indicate an MPU operation. The control bus is used to perform the function of providing timing signals. 6.What are the limitations of MPU? The limitations of MPU are,

The low order address bus of the 8085 microprocessor is multiplexed with the data bus Appropriate control signals need to be generated to interface memory and I/O with

8085 7. Explain the five flags in the ALU of 8085 microprocessor

S-SIGN FLAG The sign flag is set if the result of the bit D7 is one Z-ZERO FLAG This flag is set if the ALU operation is zero and is reset if ALU operation is not zero AC-AUXILARY CARRY FLAG

This flag is set when a carry is generated during an arithmetic operation and is passed on from one digit to another

P-PARITY FLAG If the result of an arithmetic or logical operation has an even number of 1’s then the parity flag is set. If it has odd number of 1’s then the parity flag is reset.

CY-CARRY FLAG If the result of an arithmetic operation has a carry then the carry flag is set otherwise it is reset.

8. What is the purpose of Accumulator? (APR/MAY 06) Accumulator is the major register to hold data for manipulation. Any arithmetic and logical operation involves one data to be held by the accumulator. 9.What is status register? The status register is used to store the result of certain bits performed during the execution of a program. Status register is also called as a flag register. 10.How is clock frequency generated in 8085 microprocessor? The 8085 clock frequency can be generated by a crystal, a LC tuned circuit or an external clock circuit. 11. Write the classification of instruction set in 8085. The classifications of instruction set in 8085 are.

Arithmetic instructions Data transfer instructions Logical instructions

Branching instructions Machine control instructions

12. List out some move instructions in 8085 microprocessor? Some move instructions in 8085 microprocessor are, Mov r1,r2 , mov r,m , mvi r,data8 , mov m,r , mvi m,data8 13. Specify some load and store instructions(APR/MAY 08) Load and store instructions are, LDA address 16 , LHLD address 16 , LXL rp , data 16 , LDAX rp , STA address 16 , SHLD address 16 , STAX rp , data 16 , XCHG 14. Give some rotate instructions of 8085 microprocessor 8085 microprocessor rotate instructions are, RLC ,RRC ,RAR, RAL 15. What will be the condition of flags after logical AND or OR operation? After logical AND operation the carry flag is RESET (0),auxillary carry flag is SET(1) and depending on the result other flags are altered. After logical OR operation the carry flag and auxillary carry flag are RESET (0). Depending on the result of OR operation other flags are altered. 16.What is DAD and what are the flags affected by this instruction? DAD refers to double addition .This instruction is used to perform addition of 16-bit data. On execution of this instruction only carry flag is affected. 17.Explain NOP and PSW NOP – No operation The NOP is a dummy instruction, it neither achieves any result nor affects any CPU register. This is used for producing software delay and reserve memory space for future software modifications. PSW –Program Status Word The flag register and accumulator together is called PSW. Flag register is low order register and accumulator is high order register. 18.List the instructions that can be used to clear accumulator. The instructions that are used to clear the accumulator are MVI A,00H , SUB A , ANI 00H , XRA A. 19.What is the difference between conditional and unconditional branching instructions? (NOV/DEC – 06) In unconditional branch instructions the program control is transferred to branch address without checking any flag condition. But in conditional branch instructions a flag condition is checked and only if the flag condition is true, program control is transferred to branch address otherwise next instruction is executed. 20. Explain HLT and RET instruction

HLT – Halt When the HLT instruction is executed the processor suspends program execution and bus will be in idle state. RET –Return to main program This instruction is placed at the end of subroutine program in order to return to the main program. When this instruction is executed the top of stack is poped to program counter . 21. Write a simple delay subroutine program DELAY: DCX D MOV A,D ORA E JNZ DELAY RET 22. Write a simple program to produce a delay of 10ms LXI SP,5000H LXT D,04EIH CALL DELAY HLT 23.What is the need for timing diagram? The timing diagram provides information regarding the status of various signals , when a machine cycle is executed. The knowledge of timing diagram is essential for system designer to select matched peripheral devices like memories , latches , ports etc., to form a microprocessor system 24. What is fetch and execute cycle? The instruction cycle of an instruction can be divided into fetch and execute cycles. The fetch cycle is executed to fetch the opcode from memory. The execute cycle is executed to decode the instruction to perform the work instructed by the instruction. 25. What is the purpose of instruction fetch? The purpose of an instruction fetch is to read the contents of a memory location containing an instruction addressed by the program counter and to place it in the instruction register.

PERIPHERAL INTERFACING UNIT II- 2 Marks -QUESTIONS AND ANSWERS

1.What are the operating modes of 8255? The port of 8255 can be programmed to work in any one of the following operating modes as input or output port. Mode-0 : simple I/O port Mode-1 :handshake I/O port. Mode-2 : bi-directional I/O port

2.What are the functions performed by port-C of 8255

The port-C pins are used for handshake signals. Port-C can be used as an 8-bit parallel I/O port in mode-0 It can be used as two numbers of 4-bit parallel port in mode-0 The individual pins of port-C can be set or reset for various control applications.

3.What is USART? The device which can be programmed to perform synchronous or asynchronous serial communication is called USART(Universal Synchronous Asynchronous Receiver Transmitter).The INTEL 8251 is an example of USART. 4.What are the functions performed by INTEL 8251?APR/MAY2008 The INTEL 8251 is used for converting parallel data to serial or vice versa.the data transmission or reception can be either asynchronous or synchronous. The 8251 can be used to interface MODEM and or synchronously. The 8251 can be used to interface MODEM and establish serial communication through MODEM over telephone lines. 5.What are the control words of 8251 and what are its functions? The control words of 8251 are mode word and command word. The mode word informs 8251 about the baud rate, character length, parity and stop bits .The command word can be send to enable the data transmission and reception. 6.What are the information that can be obtained from the status word of 8251? The CPU to check the readiness of the transmitter or receiver and to check the character synchronization in synchronous reception can read the status word. It also provides information regarding various errors in the data received .The various error conditions that can be checked from the status word are the parity error, overrun error and framing error. 7.What is baud rate? (APR/MAY –’05) The baud rate at which the serial data are transmitted. Baud rate is defined as 1/(the time for a bit cell).In some systems one bit cell has one data bit, then the baud rate and bits/sec are same. 8.What are the different types of data transfer scheme? The different types of data transfer transfer scheme are

Synchronous u data transfer scheme. Asynchronous data transfer scheme Interrupt driven data transfer scheme.

9.What are the different types of DMA data transfer scheme?

The different types of DMA data transfer scheme are Cycle stealing DMA Block or burst mode DMA Demand transfer mode DMA

10. What is the need for interrupt controller? The interrupt controller is employed to expand the interrupt inputs. It can handle the interrupt request from various devices and allow one by one to the processor. 11.List some of the features of INTEL 8259?

It manage eight interrupt request The interrupt vector addresses are programmable The priorities of interrupts are programmable. The interrupt can be masked or unmasked individually.

12.Write the various functional blocks of INTEL 8259? The various functional blocks of 8259 are control logic, read/write logic, data bus buffer, interrupt request register, in service register, interrupt mask register, priority resolver and cascade buffer. 13.How 8259 is programmed? The 8259 is programmed by sending initialization command words(ICW’s) and operational command words(OCW’s). 14.What are the features of 8259 that can be programmed using OCW’s? the OCW’s are used to program the following features of 8259

masking of individual interrupts specific on nonspecific end of interrupt priority modes

15.what are the different scan modes of 8279? The different scan modes of 8279 are decoded scan and encoded scan and encoded scan. In decoded scan, the output of scan lines will be similar to a 2-to-4 decoder. In encoded scan mode, the output of scan lines will be binary count, and so an external decoder should be used to convert the binary count to decoded output. 16.What are the classification of computers according to the size?

Micro computers Mini computers Mainframe computers Super computers

17.What are the different programmed data transfer schemes used in microprocessor?

The various data tranfer schemes are Synchronous data transfer Asynchronous data transfer(hand shaking) Interrupt driven data transfer

18.State any four special purpose peripherals.

Programmable CRT controller Programmable Floppy disc controller

Programmable Keyboard and display interface

19.What are the two various modes of DMA transfer?

Burst mode Cycle stealing

20.What is meant by control word?

The content of control register is called as control word or command word. It specifies the various mode of operations ,I/O functions of the port etc.

21. Mention the components that are necessary to interface keyboard/display using the 8279. The components are,

The 8279 programmable keyboard/display interface A matrix keyboard with 20 keys; one matrix of 16 keys (4x4) and the other with

four keys (1x4) Six seven-segments LEDs in groups of two. A 3 to 8 decoder to generate additional scan lines. A 2981A , a current driver for anodes and transistors as current drivers for

cathodes. 22. What are the functions performed by the keyboard and display interfacing using 8279? The functions performed are,

Keyboard scanning Keyboard debouncing Key code generation Informing the key entry to CPU Storing display codes Sending display code to LED Display refreshing

23. What is the maximum number of key codes that can be generated by 8279? In scanned keyboard mode the maximum size of keyboard matrix array that can be interfaced to 8279 is 8x8 , which consists of 64 keys. In addition the 8279 has two control keys called shift and control. For each key press, an 8 bit code is generated and stored in FIFO (keyboard RAM 8279). The key code consists of row and column number of the key in binary along with the status of shift and control key . Hence with 64 contact keys and shift and control key, a maximum of 256 key codes can be generated by 8279. 24. What are the programmable display features of 8279? The 8279 can be used for interfacing LEDs or 7 segment LEDs. In decoded scan, 4 numbers of 7-segment LEDs can be interfaced and in encoded scan , a maximum of 16 numbers of 7-segment LEDs can be interfaced. The 8279 can be programmed for left entry or right entry. 25. What are the different scan modes of 8279?APR/MAY2008 The different scan modes of 8279 are decoded scan and encoded scan. In decoded scan mode, the output of scan lines will be similar to a 2 to 4 decoder . In encoded scan mode, the output of

scan lines will be binary count and so an external decoder should be used to convert the binary count to decoded output. 26. Name the sections in the block diagram of USART. The block diagram of USART consists of five sections. They are,

Read/Write logic Transmitter section Receiver section Data bus buffer section Modem control section

27. Explain the function of signal SYNDET/BRKDET in receiver section in a) Asynchronous mode and b) Synchronous mode a) Asynchronous mode In this mode, the signal SYNDET/BRKDET will indicate the intentional break in the data transmission. If the RXD line remains low for more than 2 character time then this signal is asserted HIGH to indicate the break in the transmission. b) Synchronous mode In this mode , signal SYNDET/BRKDET will indicate the reception of synchronous character. If the 8251A finds a synchronous character in the incoming string of data bits then it asserts SYNDET signal as HIGH. 28. What are the functions performed by INTEL 8251. The INTEL 8251A is used for converting parallel data to serial or vice versa. The data transmission or reception can be either synchronous or asynchronous. The 8251A can be used to interface MODEM and establish serial communication through MODEM over telephone lines. 29. What are the control words of 8251A and what are its functions? The control words of 8251A are mode word and command word. The mode word informs 8251 about the baud rate , character length, parity and stop bits. The command word can be sent to enable the data transmission and/or reception. 30. How are the functions of 8255A classified ?

The functions of 8255A is classified into two modes. They are, Bit set/reset mode(BSR mode) a) I/O mode

The BSR mode is used to set or reset the bits in portc . The I/O mode is divided into three modes; mode 0 , mode1 and mode2. 31. Explain the different types of modes in I/O mode.

The different types of modes are mode 0, mode1, mode2. Mode 0: In this mode all ports function as simple I/O ports Mode 1:

This mode is a hand shake mode whereby ports A and/or B use bits from port c as handshake signals. In the handshake mode two types of I/O data transfer can be implemented , status check and interrupt.

Mode 2: In this mode portA can be set up for bi-directional data transfer using handshake signals from portc and portB can be set up either in mode0 or mode1.

32. Explain the functions of control section in programmable peripheral interface (8255A)

There are six lines in control section . They are, RD(Read): This enables read operation. When the signal is low the MPU reads data from selected I/O port of the 8255A. WR(Write): This control signal enables the write operation. When the signal goes low the MPU writes into a selected I/O port or control register. RESET(Reset): This is an active high signal ; it clears the control register and sets all ports in the input mode. CS, Ao,A1: These are device select signals. CS is connected to a decoded address and A1 are connected to MPU address lines A0,A1.

33.Mention the steps that are necessary to communicate through 8255A with the peripherals. (APR/MAY –’05)

The steps are, a) Determine the address of port A,B and C of the control register according to the

chip select logic and address lines Ao and A1. b) Write a control word in the control register c) Write I/O instructions to communicate with peripherals through ports A,B and C.

34.Explain the simple input or output mode (mode 0) of 8255A.

In this mode ports A and B are used as two simple 8 bit I/O ports and as two 4 bit ports . Each port can be programmed to function as simply an input port or an output port. The input/output features in mode 0 are,

a. Outputs are latched b. Inputs are not latched c. Ports do not have handshake or interrupt capability.

35.Explain the bit set/reset (BSR) mode of 8255A.

The BSR mode is connected only with the eight bits of port c, which can be set or reset by writing an appropriate control word in the control register. A control word with bit D7=0 is recognized as a BSR control word and it does not alter the transmitted control word with bit D7= 1; thus the I/O operations of ports A and B are not affected by a BSR control word. In the BSR mode , individual bits of port C can be used as an ON/OFF switch.

36. Explain the function of the output control signals in mode1.

The functions of output control signals are a. OBF (Output Buffer Full) This is an output signal that goes low when the MPU writes data into the output latch of the 8255A. This signal indicates to an output peripheral that new data are ready to read. It goes high after the 8255A receives an ACK from the peripheral. b. ACK(Acknowledge) This is an input signal from a peripheral that must output a low , when the peripheral receives the data from the 8255A ports. c. INTR (Interrupt Request) This is an output signal and it is set by the rising edge of the ACK signal. This signal can be used to interrupt the MPU to request the next data and reset by the falling edge of WR. d. INTE (Interrupt Enable) This is an internal flip-flop to a port and needs to be set to generate the INTR signal. The two flip-flops INTE A and INTE B are controlled by bits PC6 and PC2 respectively through the BSR mode. e. PC 4,5 These two lines can be set up either as input or output.

37. What are the signals present in the control section of the programmable interval timer(8254)?

The control section of the programmable interval timer has four signals. They are i. RD (Read)

ii. WR (Write) iii. CS(Chip Select) iv. Address lines A0 and A1.

In the peripherals I/O mode , RD and WR signals are connected to IOR and IOW . In memory mapped I/O , these are connected to MEMR (Memory read) and MEMR(Memory write). Address lines A0 and A1 of the MPU are usually connected to lines A0 and A1 of the 8254 and CS is connected to a decoded address.

38. Mention the steps that are necessary to initialize a counter. The steps that are necessary to initialize a counter are,

i. Write a control word into the control register ii. Load the low order byte of a count in the counter register

iii. Load the high order byte of a count in the counter register These steps start the counter and provide appropriate output according to the control word. 39.Explain the methods available to read the value of the count in progress. There are two methods to read the value of the count in progress.

One method involves reading a count after inhibiting (stopping) the counter to be read. In this method , counting is stopped (or inhibited) by controlling the gate input or the clock input of the selected counter , and two I/O read operations are performed by the MPU. The first I/O operation reads the low order byte and the second I/O operation reads the lower order byte and the second I/O operation reads the high order byte.

The second method involves reading a count while the count is in progress. In this method an appropriate control word is written into the control register to latch a count in the output latch and two I/O read operations are performed by the MPU.

40.Give the classifications of modes in programmable interval timer. (NOV/DEC-’07)

There are six different modes in programmable interval timer. They are, Mode 0:Interrupt on terminal count Mode1 : Hardware retriggerable one shot Mode2 : Rate generator Mode 3 : Square-wave generator Mode 4 : Software – triggered strobe Mode5 : Hardware – triggered strobe 41.What are the two major segments of programmable keyboard/display interface ?

The 8279 programmable keyboard / display interface is a 40 pin device with two major segments , keyboard and display. The keyboard segment can be connected to a 64 –contact key matrix. Keyboard entries are debounced and stored in the internal FIFO(First In First Out) memory; an interrupt signal is generated with each entry. The display segment can provide a 16 character scanned display interface with devices such as LEDs. This segment has 16 x 8 R/W memory (RAM) which can be used to read/write information for display purposes. The display can be set up in either right entry or left entry format. 42. what are the major sections in the block diagram of 8279?

The block diagram of 8279 has four major sections. They are , a. Keyboard section b. Scan section c. Display section d. MPU interface section 43. Explain the keyboard section of 8279. (NOV/DEC-’06)

The section has eight lines (RL0-RL7) that can be connected to eight columns of a keyboard plus two additional lines shift and CNTL/STB(control/strobe). The status of the shift and the control key can be stored along with a key closure. The keys are automatically debounced and the keyboard operates in two modes ; two-key lockout and N-key rollover. In the two key lockout mode if two keys are pressed simultaneously only the first key is recognized . In the N-key roll over mode, simultaneous keys are recognized and their codes are stored in the internal buffer. It can be set up so that no key is recognized until only one key remains pressed. 44. Write about the scan section and display section of 8279.

Scan section : The scan section has a scan counter and four scan lines(SL0-SL3). These four scan lines can be decoded using a 4 to 16 decoder to generate 16 lines for scanning. These lines can be connected to the rows of a matrix keyboard and the digit drivers of a multiplexed display. Display section:

The display section has eight output lines divided into two groups A0-A3 and B0-B3. These lines can be used either as a group of eight lines or as two groups of four , in conjunction with the scan lines for a multiplexed display. The display can be blanked by using the BD line. This section includes 16x8 display RAM. The MPU can read from or write into any of these registers. 45. Explain the MPU interface section of 8279. (APR/MAY –’05)

The MPU interface section includes eight bi-directional data lines (DB0-DB7), one interrupt request line (IRQ) and six lines for interfacing , including the buffer address line(A0) When A0 is high , signals are interpreted as control words or status. When A0 is low , signals are interpreted as data. The IRQ line goes high whenever data entries are stored in the FIFO. This signal is used to interrupt the MPU to indicate the availability of data. 46. What does the initialization commands of programming the 8279 specify?

The initialization commands specify, b. Left or right entry and key rollover c. Clock frequency prescaler d. Starting address and incrementing mode of the FIFO RAM e. RAM address to read and write data and incrementing mode f. Blanking format

47. Mention the components that are necessary to interface keyboard/display using the 8279.

The components are: The 8279 programmable keyboard/display interface A matrix keyboard with 20 keys; one matrix of 16 keys (4x4) and the other with

four keys(1x4) Six seven segment LEDs in groups of two A 3 to 8 decoder to generate additional scan lines A 2981A , a current driver for anodes and transistors as current drivers for

cathodes. 48. What are the functions performed by the keyboard and display interface using 8279? (APR/MAY –’04)

The functions performed are, Keyboard scanning Keyboard debouncing Key code generation Informing the key entry to CPU Storing display codes Sending display code to LED Display refreshing

49. What is the maximum number of key codes that can be generated by 8279?

In scanned keyboard mode the maximum size of keyboard matrix array that can be interfaced to 8279 is 8x8, which consists of 64 keys. In addition, the 8279 has two control keys

called shift and control. For each key press , an 8 bit code is generated and stored in FIFO(keyboard RAM of 8279). The key code consists of row and column number of the key in binary along with the status of shift and control key. Hence with 64 contact keys and shift and control key , a maximum of 256 key codes can be generated by 8279. 50. What are the programmable display features of 8279? (APR/MAY –’04) The 8279 can be used for interfacing LEDs or 7 segment LEDs. In decoded scan , 4 numbers of 7 segment LEDs can be interfaced and in encoded scan , a maximum of 16 numbers of 7-segment LEDs can be interfaced. The 8279 can be programmed for left entry or right entry. 51. What are the different scan modes of 8279?

The different scan modes of 8279 are decoded scan and encoded scan. In decoded scan mode , the output of scan lines

IMPORTANT 16 MARK QUESTIONS: 1. Interface a ADC chip with 8085 processor through 8255 ports and write an ALP to use

BSR mode to START conversion and STATUS CHECK mode to read output data. Explain the complete circuit and programs. Use I/O mapped I/O configuration. (APR/MAY –’04)

Ans: ADC with 8085 I) Pin and features of ADC (4 ) ii) Circuit diagram(Interfacing ADC 0808 with 8085) (6 ) iii) Hardware explanation , I/O mapped I/O configuration(8) 2. Describe any typical automatic process control system using 8085. Use necessary block

diagram, flow charts, algorithms and programs to explain the whole system operation. (APR/MAY- ’08)

Ans: I) Block Diagram (4 )

ii) Circuit diagram(Interfacing ADC 0808 with 8085) (6 ) iii) Hardware explanation , (flowchart ,algorithms, and programs)(8)

3. Describe with MODE 0 and MODE 3 configurations of 8254 timer in detail (APR/MAY- ’07) 1.Modes in Timers (4)

2.Mode 0: Interrupt in terminal count.(4) 3.Mode 3: Square wave Rate generator (4) 4.Interfacing and Explanation (4) 4. Show the control word format of 8255 and explain how each bit is programmed

(APR/MAY- ’04) 1. Features of 8255 (PPI) (2 Marks) 2.Block diagram (4 marks)

3.Operation modes (4 marks) 4.I/O mode format & explanation (2 marks)

5.BSR control used format (2 marks)

5. Explain the advantages of using the following chips in micro processor based systems, (i)USART (ii)PIC (iii)KEYBOARD & DISPLAY CONTROLLER (APR/MAY-’04)

Ans: i) Introduction (USART) (2 marks) ii) Block diagram and Block description (4 marks)

(ii)PIC priority modes six types (2 Marks) i) fully nested ii) special fully nested iii) Rotating priority 1) special masked polled 2) Explanation (2 marks)

iii)KEYBOARD & DISPLAY CONTROLLER

1.Block Diagram (2) 2.Types of Display Available(2) 3.Types of keys availableandExplanation about all blocks in the block diagram (2)

6.Describe the DMA interface in detail (NOV/DEC-’06) 1.Block Diagram (8)

2.Explanation about all blocks in the block diagram (8) 7. Explain the function of 8279 (APR/MAY-’05) 1.Block Diagram (4)

2.Types of Display Available(4) 3.Types of keys available (4) 4.Explanation about all blocks in the block diagram (4)

8.Explain the working of 8254 timer and write a program using it to generate a square wave form of period 3msec (APR/MAY-’08) 1.Modes in Timers (4)

2.Mode 0: Interrupt in terminal count.(4) 3.Mode 3: Square wave Rate generator (4) 4.Interfacing and Explanation (4) 9.. Discuss how 8251 is used for serial communication of data (NOV/DEC-’07) 1.Block Diagram (4)

Types of data transfer (4) Explanation about all the blocks. (4) Explain the control Word Register, Status Register (4)

UNIT - III 8086 MICROPROCESSOR 2 Marks -QUESTIONS AND ANSWERS

1. What are the modes in which 8086 can operate?

The 8086 can operate in two modes and they are minimum (or uniprocessor) mode and maximum (or multiprocessor) mode. 2. What is the data and address size in 8086? The 8086 can operate on either 8-bit or 16-bit data. The 8086 uses 20 bit address to access memory and 16-bit address to access 1/0 devices. 3. Explain the function of IO/M in 8086. The signal IO/M is used to differentiate memory address and 1/0 address When the processor is accessing memory locations MI 10 is asserted high and when it is accessing 1/0 mapped devices it is asserted low. 4. Write the flags of 8086. The 8086 has nine flags and they are 1. Carry Flag (CF) 6. Overflow Flag (OF) 2. Parity Flag (PF) 7. Trace Flag (TF) 3. Auxiliary carry Flag (AF) 8. Interrupt Flag (IF) 4. Zero Flag (ZF) 9. Direction Flag (DF) 5. Sign Flag (SF) 5. How do 8086 interrupts occur An 8086 interrupt can come from any of the following three sources External signals Special instructions in the program Condition produced by instruction

6. What are the 8086 interrupt types Dedicated interrupts

Type 0: Divide by zero interrupt Type 1: Single step interrupt Type 2:Non maskable interrupt Type 3: Breakpoint Type 4: Overflow interrupt

Software interrupts Type 0-255

7. What is interrupt service routine Interrupt means to break the sequence of operation. While the CPU is executing a program an interrupt breaks the normal sequence of execution of instructions & diverts its execution to some other program. This program to which the control is transferred is called the interrupt service routine. 8. What is the purpose of segment registers in 8086? There are 4 segment registers present in 8086. They are 1. Code Segment (CS ) register 2. Data Segment (DS ) register

3. Stack Segment (SS ) register 4. Extra Segment (ES ) register The code segment register gives the address of the current code segment. ie. It will points out where the instructions, to be executed, are stored in the memory. The data segment register points out where the operands are stored in the memory.

The stack segment registers points out the address of the current stack, which is used to store the temporary results. If the amount of data used is more the Extra segment register points out where the large amount of data is stored in the memory. 9. Define pipelining?

In 8086, to speedup the execution of program, the instructions fetching and execution of instructions are overlapped each other. This technique is known as pipelining. In pipelining, when the n th instruction is executed, the n+1 th instruction is fetched and thus the processing speed is increased. 10. Discuss the function of instruction queue in 8086? In 8086, a 6-byte instruction queue is presented at the Bus Interface Unit (BIU). It is used to prefetch and store at the maximum of 6 bytes of instruction code from the memory. Due to this, overlapping instruction fetch with instruction execution increases the processing speed. 11. What is the maximum memory size that can be addressed by 8086? In 8086, an memory location is addressed by 20 bit address and the address bus is 20 bit address and the address bus is 20 bits. So it can address up to one megabyte (2^20) of memory space. 12. What is the function of the signal BHE in 8086? BHE signal means Bus High Enable signal. The BHE signal is made low when there is some read or write operation is carried out. ie . When ever the data bus of the system is busy i.e. whenever there is some data transfer then the BHE signal is made low. 13. List the various addressing modes present in 8086? There are 12 addressing modes present in 8086. They are, (a) Register and immediate addressing modes _ Register addressing modes _ Immediate addressing mode (b) Memory addressing modes. _ Direct addressing modes _ Register indirect addressing modes _ Based addressing modes _ Indexed addressing modes _ Based Indexed addressing modes _ String addressing modes (c) I/O addressing modes _ Direct addressing mode _ Indirect addressing mode (d) Relative addressing mode

(e) Implied addressing mode 14. How single stepping can be done in 8086? By setting the Trace Flag (TF) the 8086 goes to single-step mode. In this mode, after the execution of each instruction s 8086 generates an internal interrupt and by writing some interrupt service routine we can display the content of desired registers and memory locations. So it is useful for debugging the program. 15. State the significance of LOCK signal in 8086? If 8086 is working at maximum mode, there are multiprocessors are present. If the system bus is given to a processor then the LOCK signal is made low. That means the system bus is busy and it cannot be given of any other processors. After the use of the system bus again the LOCK signal is made high. That means it is ready to give the system bus to any processor. 16. What are the functions of bus interface unit (BIU) in 8086? (a) Fetch instructions from memory. (b) Fetch data from memory and I/O ports. (c) Write data to memory and I/O ports. (d) To communicate with outside world. (e) Provide external bus operations and bus control signals. 17. What is the clock frequency of 8086? 8086 8086-2 8086-4 Internal clock Frequency 5 MHz 8MHz 4MHz External Clock Frequency 15MHZ 24MHZ 12MHZ 18. What are the two modes of operations present in 8086? i. Minimum mode (or) Uniprocessor system ii. Maximum mode (or) Multiprocessor system 19. Explain the process control instructions STC – It sets the carry flag & does not affect any other flag CLC – it resets the carry flag to zero &does not affect any other flag CMC – It complements the carry flag & does not affect any other flag STD – It sets the direction flag to 1 so that SI and/or DI can be decremented automatically after execution of string instruction & does not affect other flags CLD – It resets the direction flag to 0 so that SI and/or DI can be incremented automatically after execution of string instruction & does not affect other flags STI – Sets the interrupt flag to 1. Enables INTR of 8086. CLI – Resets the interrupt flagto0. 8086 will not respond to INTR. 20. What are the three classifications of 8086 interrupts? (1) Predefined interrupts (2) User defined Hardware interrupts (3) User defined software interrupts.

What are the functions of status pins in 8086? S2 S1 S0 0 0 0 ---- Interrupt acknowledge 0 0 1 ---- Read I/O 0 1 0 ---- Write I/O 0 1 1 ---- Halt 1 0 0 ---- Code access 1 0 1 ---- Read memory 1 1 0 ---- Write memory 1 1 1 ---- inactive S4 S3 0 0 --I/O from extra segment 0 1 --I/O from Stack Segment 1 0 --I/O from Code segment 1 1 --I/O from Data segment S5 --Status of interrupt enable flag S6 --Hold acknowledge for system bus S7 --Address transfer. 21. What are the two schemes employed for I/O addressing.

The two schemes employed for I/O addressing are Isolated I/O and Memory I/O. 22. What kind of I/O is used for IN and OUT instructions?

For 8086 based systems, isolated I/O is used with IN and OUT instructions. The IN and OUT instructions are of two types: direct I/O instructions and variable I/O instruction 23. How many bytes are needed to store the starting addresses of ISS for 8086 P?

8086 P can implement 256 different interrupts. To store the starting address of a single ISS (Interrupt Service Subroutine), four bytes of memory space are required—two bytes to store the value of CS and two bytes to store the IP value. Thus to store the starting address of 256 ISS, in all 256 × 4 = 1024 bytes = 1 KB will be required 24. What are meant by interrupt pointer and interrupt pointer table?

The starting address of an ISS in the 1 KB memory space is known as the interrupt pointer or interrupt vector corresponding to that interrupt. The 1 KB memory space needed to store the starting addresses of all the 256 ISS is called the interrupt pointer table. 25. Write down the steps, sequentially carried out by the systems when an interrupt occurs.

When an interrupt occurs (hardware or software), the following things happen: The contents of flags register, CS and IP are pushed on to the stack. TF and IF are cleared which disable single step and INTR interrupts respectively. Program jumps to the starting address of ISS. At the end of ISS, when IRET is executed in the last line, the contents of flag register, CS and IP are popped out of the stack and placed in the respective registers. When the flags are restored, IF and TF get back their previous values. IMPORTANT 16 MARK QUESTIONS: 1.a) Explain in detail the architecture of 8086 microprocessor? (8) b) Describe the segment memory concept in 8086? (4)

Ans:a) Architecture of 8086 i) two units of architecture (2 marks) ii) functional block diagram (4 marks) iii) flag register of 8086 (2 marks) Ans: b) The segment memory concept in 8086 (4) i)code segment (64 K) (20000H – 2FFFFH) ii)data segment (64 K) (40000H – 4FFFFH) iii)stack segment (64 K) (60000H – 6FFFFH) iv)extra segment (64 K) (80000H – 8FFFFH) 2. Sketch read/write timing diagrams for the 8086 processor. (16)

Ans: read/write timing diagram of 8086 i) Timing diagram read cycle (4 Marks) (minimum & maximum modes) ii) Explanation (4 Marks) iii) Timing diagram of write cycle (4 Marks) (minimum & maximum modes) iv) Explanation (4 marks) 3. Explain in detail about the Addressing Modes of 8086 (16) Ans. Addressing mode definition (4)

1.Direct Addressing (2) 2.Register Indirect Addressing (2) 3.Based Addressing (2) 4.Indexed Addressing (2) 5.Based Indexed Addressing (2) 6.Based Indexed with displacement (2)

4. Mention the groups in which the instruction set of 8086 can be categorized. (16) Ans. The instruction set of 8086 can be divided into the following number of groups, namely:

1.Data transfer instructions (2) 2.Arithmetic instructions and.Logic instructions (2) 3.Shift instructions and Rotate instructions (2) 4.Flag control instructions and Compare instructions (2) 5.Jump instructions (2) 6.Subroutines and subroutine handling instructions (2) 7.Loop and loop handling instructions (2) 8.Strings and string handling instructions. (2)

5. Draw and explain the memory mapped I/O scheme for 8086 (16)

1.Diagrams (4) 2.Memory Interfacing (4) 3.Memory mapped I/O interfacing (4) 4.Isolated I/O mapping (4)

6. Mention and tabulate the different types of interrupts that 8086 can implement.(16)

Ans. 8086 can implement seven different types of interrupts. (4) 1.NMI and INTR are external interrupts implemented via Hardware.(4)

2.INT n, INTO and INT3 (breakpoint instruction) are software interrupts implemented through Program.(4)

3.The ‘divide-by-0’ and ‘Single-step’ are interrupts initiated by CPU (4)

MICRO CONTROLLER-8051 UNIT IV- 2 Marks -QUESTIONS AND ANSWERS

1.What is micro controller?

Micro controller is a microprocessor with limited number of RAM, ROM, I/O ports and timer on a single chip i.e. all the required hardware for a system is combined together on a single chip.

2. Mention any two real time micro controllers. Micro oven Washing machine

3.Give any two differences between microprocessor and micro controller. Microprocessor Micro controller Register-oriented architecture Memory-oriented architecture It do not have internal ROM, RAM and I/O port

It contains RAM, ROM and I/O in a single chip

4.What are the bits used in the program status word of 8031 micro controller?

The various status bits used are the carry bit, auxiliary carry bit, overflow bit, parity bit, general purpose flag bit and register select bank control bits.

5.What is the use of PSEN signal used in IC 8031? It is the control signal that enables the external program memory. When the device executes the program from external program memory PSEN is activated. During the execution of internal program memory PSEN is not activated.

6.What are the registers used for timer operations?APR/MAY2008 The registers used for timer operation are TH0, TH1, TL0, TL1, TMOD, TCON and IE.

7.What is the difference between mode 0 and mode 1 timer operation of IC8031? In mode 0 13 bits register is used whereas in mode1 16 bits register is used.

8.What is meant by transition activated interrupts? In transition-activated interrupts, the timer control register bits are set when the transition at the INT input (changes from logic 1 to 0 or vice versa).

9.What are the use of MOVC and MOVX instruction?NOV/DEC2007 MOVC-used to move the data from code (program) memory to accumulator. MOVX-used to move the data from external memory to the accumulator.

10. Give any two differences between LCALL and ACALL instruction.

Long call (LCALL) Absolute call (ACALL) 3 byte instruction 2byte instruction Issues 11 bit absolute addressing It addresses full 64 Kbytes

11.List some assembler directives used by the compiler of 8031.

ORG EQU DFB

12.What is meant by power down mode? (NOV/DEC 05) In 8096 micro controller the upper 16 bytes of RAM is called power down RAM because these locations receive their power from the Vpd pin in the power down mode. Hence in the power down only these locations are alive. 13.Specify the functions of various ports in 8096. Port 0 – input port, used for A to D converter inputs. Port 1- bi directional ports Port 2- input, output as well as bi-directional pins Port 3,4- bi directional ports used to expand the memory. 14.Why the ALU used in 8096 is called as RALU?

Here the ALU can access all the registers in the RAM memory and no need for accumulator. Hence this memory is termed as RALU. 15.Give any four features of 8096.

Contains full duplex serial port Watch dog timer to recover from errors Programmable 8-source priority interrupt system. Hardware multiply and divide instruction

16. What is cross assembler? (NOV/DEC 04) Assemblers which run on one CPU but which generate object code for another CPU are called cross assemblers. 17. What is the basic difference between counter and time? In the case of timer operation counter is connected to the internal clock where as in counter operation it is connected to the external clock having different baud rates. 18.What is use of DPTR in 8031 micro controllers?APR/MAY2008 It consists of a high byte and low byte data of a 16-bit external data RAM address. It is accessed as a 16 bit register or 2,8 bit registers. 19.What was the first developed microprocessor? The first developed Intel microprocessor was 4-bit 4004 processor.

20.Mention any few 8-bit and 16-bit micro controllers. 8 bit micro controllers-Intel 8051,PIC 16C56,motorolo 6805,TMS 7500. 16 bit micro controllers- H81532,Intel 8096,MCS-96 family. 21.What are the input units used to generate digital data inputs?

DIP switches and thumb switches are the 2 different input units used to give digital input to the processor. 22.What are the three different types of DIP switches?

Piano DIP switches Slide DIP switches Tristate DIP switches

23.What does thumb switches mean? These are rotary mechanical devices that convert the displayed decimal numbers to binary mechanical positions and are read electronically by an electronic counter or a microprocessor. 24. What is the function of watchdog timer? A Watch dog timer resets the PIC if the chip ever malfunctions and deviates from its normal operation. 25. What is data memory space? (APRIL/MAY 05) The processor can read data from this memory space and can write data to this memory space. It cannot execute program instructions from this memory space. 8051 internal RAM is in this memory space. 26. What is called down loaded program? The 8051 can input a block of data through its serial communications port, load that data into memory, and then execute that data as a program. It is used to change the program operating in a remote microprocessor based controller. 27. What is scratch pad? It is an 8-bit register. It is incremented just before data is stored by using the push or call instructions or the interrupt. 28. What is port latch? The port latch allows storing data going out of the port or coming to the port. 29. What are the differences between 8052 and 8051?

The 8052 have 8K bytes of onboard ROM and 256 bytes of on board RAM. The 8052 allow the programmer to write larger programs and programs which use more variable data. The 8052 cost more than 8051.

8052 has one extra 16 bit counter timer. 30. What is multiplexed address-data bus? (APRIL/MAY 06) Multiplexed address-data bus is used on 8051 single chip processor and it reduces the total number of pins needed for the address and data buses. 31. What are the two different types of instructions for reading data from I/O ports? The two different types of instructions are ,

Some instructions read data from the latch and

Others read data directly from the pin 32. What is Baud rate? NOV/DEC2007 The baud rate or signaling rate, tells how many bits are transmitted per second. 33. What is address-object transfer? It is a 3-byte instruction used to load 16 bits of address data into the data pointer. 34. What is real-time programming? The applications of micro controllers involve responding to events quickly enough to control the environment that generates the events, are generally termed as real-time programming.

35. Differences between Microprocessor and Micro controller:

MICROPROCESSOR MICROCONTROLLER

1.The microprocessor is concerned with rapid movement of code and data from external addresses to the chip

2. The microprocessor must have many additional parts to be operational

3. Microprocessors are intended to be general-purpose digital computers.

1.The micro controller is concerned with rapid movement of bits within the chip

2. The micro controller can function as a computer with the addition of no external digital parts

3. Micro controller are intended to be special purpose digital controllers.

IMPORTANT 16 MARK QUESTIONS:

1. With neat diagram explain the architecture of INTEL 8051/8031(NOV/DEC 06) Ans: functional block of 8051 (i) Introduction (4 ) (ii) Block Diagram & description (4 ) (iii) Register structure & description (4) (iv) Memories (4)

2. Explain the memory organization of 8051 along with their waveforms

Ans: (i)Different types of memory available in 8051 (4 ) (ii)ROM Internal and External memory and functions (4 ) (iii) RAM Internal and External memory and functions (4) (iv) Stack memory and its functions (4)

3. What are the 16 bit registers available in 8051? Explain each in detail (i)Different types of registers available in 8051 (4 ) (ii)stack pointer and functions (4 ) (iii) temporary register (4)

(iv) Stack memory and instruction register (4)

4. List out various operating modes for serial port in 8051 and explain each in brief (i)Different types of operating available in 8051 (4 ) (ii)PWM generation and functions (4 ) (iii) Timer functions (4) (iv) Counters and its functions (4)

5. Explain various interrupt registers available in 8051 and their priority (APRIL/MAY 08) (i)Interrupt Structure (4) (ii) Interrupt structure and sources diagram (4) (iii)Priority level structure and IE –register (4) (iv) External interrupts and single step operation (4)

6. Discuss in detail about the various types of instructions available in 8051 with examples(NOV/DEC 07) Types and definitions (6) 1.Data Transfer Instructions (2) 2.Arithmetic Instructions (2) 3.Logical Instructions (2) 4.Boolean variable Manipulation Instructions (2) 5.Program and Machine Control Instructions (2)

7. Write a program to arrange given set of numbers in ascending order and descending order (APRIL/MAY 08) Ans: ascending order and descending order 1.Algorithm (4) 2.Flow cahrt (4) 3.Program (6) 4.Input data (2)

MICRO CONTROLLER PROGRAMMING & APPLICATIONS

UNIT V- 2 Marks -QUESTIONS AND ANSWERS 1.What are the basic digital output units used in microcomputer? A simple system uses 7-segment LED displays for numbers and hexadecimal letters,18-segment LED display or 5 x 7 matrix LED displays for displaying numbers and letters of an alphabet. 2.Why the seven segment LED display is referred as static display? (Nov/Dec-05) In this circuit the current is passed through the display at all times, and hence it is referred as static display. 3.Give any two differences between memory mapped and peripheral mapped I/O interfacing.

Memory mapped I/O interfacing Peripheral mapped I/O interfacing Peripheral is identified by 16-bit memory address

Peripheral is identified with an 8-bit address

Data transfer is implemented by using memory related instructions such as STA, LDA, MOV M,R and MOV R,M.

Data transfer is implemented by IN and OUT instructions.

4.What are the interface devices used to connect output port and high power devices?

Integrated circuit buffers and transistor buffers are used as interface devices between the output port pins and high power devices. 5.What is the use of sample and HOLD IC?

Sample and hold circuit samples an input signal and hold s on to its last sampled value until the input is sampled again. 6.What is aperture time?

It is the delay required between HOLD command and an input analog transition, so that the transmission does not affect the held output. 7.State some applications of sample and HOLD circuit.

Automatic test systems Industrial process controls Arbitrary function generators Avionics equipment

8.What is the disadvantage in keyboard interfacing using ports?

The disadvantage in keyboard interfacing using ports is that most of the processor time is utilized in keyboard scanning and debouncing. As a result the computational speed of the processor will be reduced. 9.What is the advantage in using INTEL 8279 for keyboard and display interfacing?

When 8279 is used for keyboard and display interfacing, it takes care of all the task involved in keyboard scanning and display refreshing. Hence the processor is relieved from the task of keyboard scanning, debouncing, keyboard generation and display refreshing and the processor time can be more effectively used fro computing. 10.What is a programmable peripheral device? (Nov/Dec-07) If the functions performed by a peripheral device can be altered or changed by a program instruction then the peripheral device can be altered or changed by a program instruction then the peripheral device is called programmable device. 11.What is synchronous data transfer scheme?

In synchronous data transfer scheme, the processor does not check the readiness of the device after a command have been issued for read/write operation in this scheme the processor will request the device to get ready and then read/write to the device immediately after the request. 12.What is asynchronous data transfer scheme?

In asynchronous data transfer scheme, first the processor sends a 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 instruction to complete the process. 13.What is an interfacing circuit? (Nov/Dec-07)

An interfacing circuit is an electronic circuit, which is used to connect the peripherals to the computer.

14. What are the input devices used in single board microcomputer? The input devices used in single board microcomputer are hex keyboard, DIP

switches, ADC, floppy disc etc 15.What are the output devices used in single board microcomputer?

The output devices used in single board microcomputer are 7 segment LEDs, LCD display, Printer, Floppy disc , CRT terminal etc 16. How is an input and output device interfaced with 8085 microprocessor?

An input and output device is interfaced with 8085 microprocessor either as a peripheral I/O or as a memory mapped I/O. In the peripheral I/O, the instructions IN/OUT are used for data transfer, and the device is identified by an 8 bit address. In the memory mapped I/O, memory related instructions are used for data transfer, and the device is identified by a 16 bit address.

17. What is a port?

A Port is a buffered IC, which is used to hold the data transmitted from microprocessor to I/O device or vice-versa. 18. What is the need for port?APR/MAY08

The I/O devices are generally slow devices and their timing characteristics do not match with processor timings. Hence the I/O devices are connected to system bus through the ports. 19. Give some examples of port devices used in 8085 microprocessor based system. The various INTEL I/O port devices used in 8085 microprocessor-based systems are 8212,8155,8156,8255,8355 and 8755. 20.Can an input port and output port have the same port address?

Yes. They will be differentiated by control signals. The RD is used to enable the input port and the WR is used to enable the output port. 21. What are the different methods of interfacing I/O devices to 8085-based system?

The different methods of interfacing I/O devices are, a) Memory mapped I/O device b) Standard mapped I/O Device (or) Isolated mapping

22. What are the parts of seven segment LED?

Seven segment LED consists of seven light emitting diode segments and one segment for the decimal point. 23. Give some applications of seven segments LED They are used on calculators and other products, which only need limited display. It can give limited alphabetical information. 24 What are the two types of 7 segments LED?

The two types of 7 segments LED are, a) Common anode type b) Common Cathode type

25.Explain how the seven segment LEDs are interfaced to 8085 processor.

The seven segment LEDs are interfaced to 8085 processor using INTEL 8279 keyboard and display controller. The 8279 is a dedicated controller which takes care of keyboard scanning

and display refreshing. A maximum of 16 number of 7 Segment LEDs can be interfaced using one 8279 in 8085 based system as multiplexed display. 26. What is a multiplexed display?

The process of switching ON the display devices one by one for a specified time interval is called Multiplexed display. In microprocessor based systems six to eight 7 segment LEDs are interfaced to provide multiplexed display. At any one time only one 7 segment LED is made to glow. After few milliseconds the next & segment LED is made to glow and so on. Due to persistent of vision, it will appear as if the LEDs are glowing continuously. 27. Give some advantages of multiplexed display?

The advantages of multiplexed display are, a) Only one BCD to 7 segment decoder, IC 7447 is needed for all the 7 segment LEDs. b) In a current requirement of one 7 segment LED, 6 to 8 LEDs can be displayed or interfaced. c) The power requirements of the display devices are reduced to a very large extent.

28. Define memory mapped I/O. (Apr/May-06)

Microprocessor such as the 8085 and Z80 can address 256 out port ports and 256 input ports by use of output and input instructions in the microprocessor program. One way to expand beyond this number of ports is to define memory location as I/O ports. An instruction to write memory at such a location is interpreted by the external hardware as an output. An instruction to read memory is interpreted as an input. Defining I/O ports in this way is called memory mapped I/O.

29. Compare the memory mapped I/O and Standard mapped I/O

Memory mapped I/O Standard mapped I/O a) 16 bit address is allotted to an

I/O device b) The devices are accessed by

memory read or memory write cycle

c) All instructions related to memory can be used for data transfer

d) A large number of I/O ports can be interfaced.

a) 8 bit address is allotted to an I/O device

b) The devices are accessed by I/O 8 read or I/O write cycle

c) Only IN and OUT instructions can be used for data transfer d) Only 256 ports can be interfaced

30. What is the drawback in memory mapped I/O?

When I/O devices are memory mapped, some of the addresses are allotted to I/O devices and so the full address space cannot be used for addressing memory (i.e physical memory address space will be reduced). Hence memory mapping is useful only for small systems, where the memory requirement is less. 31. What is memory access time? (Apr/May-04) The memory access time is the time taken by the processor to read or write a memory location. During read operation it is the time between a valid address on the bus and end of read control signal. During write operation it is the time between a valid address on the bus and the end of write control signal.

32. If high-order lines are partially decoded, how can one determine whether it is peripheral I/O or memory mapped I/O?

To recognize the type of I/O, examine the control signal. If it is IOW(or IOR), it must be peripheral I/O, and if the control signal is MEMW(or MEMR), it must be a memory mapped I/O. 33. What is the current requirement of each seven segment LED?

The current requirement of each seven segment LED is 140mA to 200mA. 34. What is the disadvantage of using the ports and latches for LED display interfacing?

The disadvantage of using the ports and latches for LED display interfacing is that a considerable processor time is utilized for display refreshing. 35. When the peripherals and I/O devices are memory mapped in the system?

If the memory requirement of the system is less, then the peripherals and I/O devices are memory, mapped in the system. 36. What is a transducer?

It is a device, which converts a physical phenomenon into a voltage or current. 37. What are the two types of A/D converters? (Apr/May-08)

The two types of A/D converters are a) Continuous balance A/D converter b) Successive approximation A/D converter.

38. What is the difference between the continuous balance A/D converter and Successive approximation A/D converter? (NOV/DEC – 05)

The only difference between these two types is the algorithm they use to balance the unknown voltage with a known voltage. 39. What is the basic principle behind a D/A converter?

The basic principle is to generate a binary weighted voltage or current by switching a binary resistor network with a digital source. 40. What is the principle behind A/D converter?

The principle is to balance an unknown voltage against a known voltage generated from a digital source, which always hunts for closest match 41. How is input given to speech recognition circuit?

Speech recognition circuits allow human being to input data to the computer using conventional speech rather than a keyboard. 42. What is resolution in DAC? (Apr/May-06) The resolution in DAC is the smallest possible analog value that can be generated by the n-bit binary input. If the reference voltage in n-bit DAC is Vref, the resolution is (1/2n) x Vref Volts. 43. What are the internal devices of a typical DAC?

The internal devices of a DAC are R/2R resistive network , an internal latch and current to voltage converting amplifier. 44. What is settling or conversion time in DAC?

The time taken by the DAC to convert a given digital data to corresponding analog signal is called conversion time.

45. What is resolution and conversion time in ADC? (NOV/DEC – 07)

The resolution in ADC is the minimum analog value that can be represented by the digital data. If the ADC gives n-bit digital output and the analog reference voltage is Vref then the resolution (1/2n) x Vref volts. The conversion time in ADC is defined as the total time required to convert an analog signal into its digital equivalent. 46. Write A program to perfom multiplication of 2 nos using 8051?

MOV A,#data 1 MOV B,#data 2 MUL AB MOV DPTR,#5000 MOV @DPTR,A(lower value) INC DPTR MOV A,B MOVX @ DPTR,A

47. Write about CALL statement in 8051? There are two subroutine CALL instructions. They are *LCALL(Long CALL) *ACALL(Absolute CALL) Each increments the PC to the 1st byte of the instruction & pushes them in to the stack.

48. Write about the jump statement? There are three forms of jump. They are LJMP(Long jump)-address 16 AJMP(Absolute Jump)-address 11 SJMP(Short Jump)-relative address

49. Write program to load accumulator ,DPH,&DPL using 8051? MOV A,#30 MOV DPH,A MOV DPL,A

50.Write a program to find the 2’s complement using 8051? MOV A,R0 CPL A INC A

51.Write a program to add 2 8-bit numbers using 8051? MOV A,#30H ADD A,#50H

52.Write a program to swap two numbers using 8051? MOV A, #data SWAP A

53.Write a program to subtract 2 8-bit numbers &exchange the digits using 8051? MOV A,#9F MOV R0,#40 SUBB A,R0 SWAP A

54.Write a program to subtract the contents of R1 of Bank 0from the contents of R0 of Bank using 8051?

MOV PSW,#10 MOV A,R0 MOV PSW,#00 SUBB A,R1

55.What is the operation carried out when 8051 executes the instruction MOVC A, @A+DPTR?

Copy the code byte, found at the ROM address formed by adding A and the Dptr, to A. 56.Name any four bit manipulation instruction in microcontroller 8051?

ANL C,b –AND C and the addressed bit;put the result in C CPL b - Complement the addressed bit MOV C,b – Copy the addressed bit to the C flag SETB C – Set the C flag to 1

57.How can you perform multiplication using 8051 microcontroller? Multiplication operation uses two register A and B as both source and destination address for the operation. MUL AB This instruction multiply A by B. put the lower order byte of the product in A and the higher byte in B.

16 MARK QUESTION: 1)With neat diagram explain the ADC interface to 8051 (Nov/Dec-o4) i) ADC 0804 Pin diagram (2 marks) ii) Features (2 marks)

iii) typical interface ADC 0804 with microprocessor (4 marks) iv)LM35 with AD590 and 8051 (8 Marks)

2) Design an interface and write a program to connect a thumb wheel switch & a seven segment LED (Apr/May-05)

Ans: 4x4 key board interfacing with 8051 (i) thumb wheel interface (4 ) (ii)Matrix key board interface (4 ) (iii) Seven segment LED connected to port 1 of 8051 (4) (iv) Program (4 ) 3) Explain the Temperature sensor interfaced with 8051(Nov/Dec-05) (i) ADC 0804 Pin diagram (2 marks) ii) Features (2 marks)

iii) typical interface ADC 0804 with microprocessor (4 marks) (iv)LM35 with AD590 and 8051 (8 Marks)

4) Explain the operation of stepper motor control using 8051(Nov/Dec-05) Ans: Stepper motor control circuit (4)

(i) Stepper motor interface circuit (4)

(ii) Digital locking system and Excitation circuit (4)

(iii) Full step and Half step excitation sequence (4)

5) Explain the operation of DC motor control using 8051(Nov/Dec-05) Ans: i)circuit diagram for interfacing DC motor (4 marks) ii) circuit explanation (4 marks) iii)H bridge control circuit (4 marks) iv) control modes for motor control (4 marks) 6. With neat sketch explain the function of D/A converter interfaced with 8051 (i) Fundamental steps (4) (ii)Figure (4) (iii) Explain the functions. (4) (iv)Circuit diagram (4)