2 8085 microprocessor
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • good and helpful
    Are you sure you want to
    Your message goes here
  • Good
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
11,439
On Slideshare
11,439
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
502
Comments
2
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 8085 MICROPROCESSOR used to store data temporarily during the execution of a program and are accessible to the user through instructions.• Control Unit: The control unit provides the necessary timing and control signals to all the operations in the microcomputer. It controls the flow of data between the microprocessor and memory and peripherals.• Memory: Memory stores such binary information as instructions and data, and provides that information to the microprocessor whenever necessary. To execute programs, the microprocessor reads instructions and data from memory and performs the computing operations in its ALU section. Results are either transferred to the output section for display or stored in memory for later use. Read-Only memory (ROM) and Read/Write memory (R/WM), popularly known as Random- Access memory (RAM). o The ROM is used to store programs that do not need alterations. The monitor program of a single-board microcomputer is generally stored in the ROM. This program interprets the information entered through a keyboard and provides equivalent binary digits to the microprocessor. Programs stored in the ROM can only be read; they cannot be altered. o The Read/Write memory (R/WM) is also known as user memory. It is used to store user programs and data. In single-board microcomputers, the monitor program monitors the Hex keys and stores those instructions and data in the R/W memory. The information stored in this memory can be easily read and altered.• I/O (Input/output): It communicates with the outside world. I/O includes two types of devices: input and output; these I/O devices are also known as peripherals.• System Bus: The system bus is a communication path between the micro- processor and peripherals: it is nothing but a group of wires to carry bits.Q. What are different applications of Microprocessor?Applications of Microprocessor include • Actuator control systems: speed, velocity, acceleration control of electric motor, fluid power actuators.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 2
  • 2. 8085 MICROPROCESSOR • Control system for home appliances: microwave oven, washing machine, refrigerator, heating system, air conditioner (AC), etc. • Control system for computer peripherals: Disk drives, printers, keyboard, modem and so on • Automobile control system: Engine control, locking system, monitoring systems • Traffic control systems: Road, air and ocean traffic, navigation, etc. • Machine control systems: Robotics, mobile robotics, crane, Automated Guided Vehicle (AGV), Numeric Control (NC) machine • Production lines: Assembly lines, packaging systems, bottling plant, etc.Q. Explain 8085 Bus structure.Address Bus: • The address bus is a group of 16 lines generally identified as A0 to A15. • The address bus is unidirectional: bits flow in one direction - from the microprocessor to peripheral devices. • The microprocessor uses the address bus to perform the first function: identifying a peripheral or a memory location.Data Bus: • The data bus is a group of eight lines used for data flow. • These lines are bi-directional - data flow in both directions between the microprocessor and memory and peripheral devices. • The microprocessor uses the data bus to perform the second function: transferring binary information. • The largest number that can appear on the data bus is 11111111.Control Bus: • The control bus carries synchronization signals and providing timing signals. • The MPU generates specific control signals for every operation it performs. • These signals are used to identify a device type with which the MPU wants to communicate.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 3
  • 3. 8085 MICROPROCESSORFlagsThe flag register in the microprocessor is a special purpose register in which theindividual bit values represent the standing of a result byte. The flag bits areautomatically modified in accordance with the result. The flag bits in many situationsare important than result itself. The programmer, when necessary, uses the testedand recorded flag bits. A thorough understanding of flags is essential in writingassembly language programs.There are five flag bits: Zero (Z), Carry (CY), Sign (S), Parity (P), and Overflow (V)flags.Flag Set i.e. 1 Reset i.e. 0Z Result is zero Result is non-zeroCY Carry is generated Carry is not generatedS Result is negative Result is positiveP Result has even number of 1s Result has odd number of 1sV Overflow occurs Overflow does not occurInstruction Decoder or Microcode EngineThis is the main unit, which is responsible for decoding the instructions. Theinstructions (OPCODE) fetched from the memory are placed in the IR. Once theOPCODE enters into the microprocessor, it must be decoded in order to generatecontrol signals for ‘what to do next’. A unique set of control signal is generatedaccording to the instruction types. For instance, if it is an instruction (OPCODE) foraddition, then addition related control signals are produced. If the OPCODE is acomparison instruction, then addition related control signals are produced.Stack and Stack Pointer (SP)Stack is a user-defined memory space, which includes many locations within thememory space of the microprocessor. These memory locations are special in thesense that when interrupts occur, the microprocessor stores the current content ofthe various registers and flags in the stack in order to attend the interrupt.Microprocessor is presently doing some task (executing some codes). In themeantime, the interrupt has occurred. The microprocessor must listen, or attend, tothe interrupt while suspending the present task. Attending to interrupt impliesexecution of another sub-task or sub-program corresponding to interrupt. The sub-task is referred to as subroutine. The control, or the Program Counter, will hold theaddress of another location corresponding to this interrupt.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 8
  • 4. 8085 MICROPROCESSORFigure shows the logic pinout of the 8085 microprocessor. All the signals can beclassified into six groups: (1) address bus, (2) data bus, (3) control and statussignals, (4) power supply and frequency signals, (5) externally initiated signals, and(6) serial I/O ports.ADDRESS BUSThe 8085 has 16 signal lines (pins) that are used as the address bus; however,these lines are split into two segments: A15-A8 and AD7-AD0. The eight signal lines,A15-A8, are unidirectional and used for the most significant bits, called the high-orderaddress, of a 16-bit address. The signal lines AD7-AD0 are used for a dual purpose,as explained in the next section.MULTIPLEXED ADDRESS / DATA BUSThe signal lines AD7-AD0 are bidirectional: they serve dual purpose. They are used asthe low-order address bus as well as the data bus. In executing an instruction,during the earlier part of the cycle, these lines are used as the low-order addressbus. During the later part of the cycle, these lines are used as data bus.CONTROL AND STATUS SIGNALSThis group of signals includes two control signals (RD and WR), three status signals(IO/M, S1, and S0) to identify the nature of the operation, and one special signal(ALE) to indicate the beginning of the operation. These signals are as follows: • ALE – Address Latch Enable. This is positive going pulse generated every time the 8085 begins an operation (machine cycle); it indicates that the bits on AD7-AD0 are address bits. This signal is used primarily to latch the low-order address from the multiplexed bus and generate a separate set of eight address lines, A7-A0. • RD - Read. This is Read control signal (active low). This signal indicates that ¯¯ the selected I/O or memory device is to be read and data is available on the data bus. • WR - Write. This is a Write control signal (active low). This signal indicates ¯¯ that the data on the data bus are to be written into a selected memory or I/O location. • IO/¯¯ - This is a status signal used to differentiate between I/O and memory M operations. When it is high, it indicates an I/O operation; when it is low, it indicates a memory operation. • S1 and S0 – These are status signals, similar to IO/¯¯ , can identify various M operations, but they are rarely used in small systems.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 11
  • 5. 8085 MICROPROCESSORPOWER SUPPLY AND CLOCK FREQUENCYThe power supply and frequency signals are as follows: • Vcc - +5 V power supply • Vss – Ground Reference • X1, X2 – A crystal is connected at these two pins. • CLK (OUT) – Clock Output. This signal can be used as the system clock for other devices.EXTERNALLY INITIATED SIGNALS INCLUDING INTERRUPTSThe 8085 has five interrupt signals that can be used to interrupt program execution.These are listed in the table below. Interrupt Request: This is used as a general purpose interrupt. INTR (Input) It has lowest priority. Interrupt Acknowledge: This is used to acknowledge an INTA (Output) ¯¯¯¯ interrupt. RST 7.5 (Inputs) Restart Interrupts: These are vectored interrupts that transfer RST 6.5 the program control to specific memory locations. Among RST 5.5 these three priority order is 7.5, 6.5, 5.5 TRAP (Input) This interrupt has highest priority.TRAP is the only non-maskable interrupt i.e. it cannot be enabled or disabled byprogram. Other interrupts (INTR and Restart interrupts) are maskable i.e. they canbe enabled or disabled using programs.In addition to the interrupts, three pins – RESET, HOLD, and READY- acceptexternally initiated signals as input. This signal indicates that a peripheral such as DMA (Direct HOLD (Input) Memory Access) controller is requesting the use of address and data buses. Hold Acknowledge: This signal acknowledges the HOLD HLDA (Output) request. READY is used by the microprocessor to check whether a peripheral is ready to accept or transfer data. If READY is high READY (Input) then the peripheral is ready for data transfer. If not the microprocessor waits until READY goes high. RESET ¯¯ ¯¯¯¯¯ IN When the signal on this pin goes low, microprocessor is reset. RESET OUT This signal indicates that microprocessor is being reset.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 12
  • 6. 8085 MICROPROCESSORSERIAL I/O PORTSThe 8085 has two signals to implement the serial transmission: SID (Serial InputData) and SOD (Serial Output Data). In serial transmission, data bits are sent over asingle line, one bit at a time, such as the transmission over telephone lines.Q. What do you understand by Instruction and Program?Instruction means a command in binary that is recognized and executed by themicroprocessor to accomplish a task.Program is a set of instructions written in a specific sequence for microprocessor toaccomplish a given task.Q. What do you understand by Machine Language and AssemblyLanguage? • Microprocessors recognize and operate in binary numbers. Each microprocessor has its own set of instructions. An instruction is combination of 0s and 1s. • To communicate with the microprocessor, one must give instructions in binary language. This language is called machine language. • But it is very difficult and error prone to write programs in machine language because it is just a series of 0s and 1s and instructions are not easily comprehended by just looking at the pattern. • To overcome this difficulty, computer manufacturers have devised English-like words to represent the binary instructions of microprocessor. Programmers can write programs using these words. This language is called assembly language. • For example 0011 1100 is an instruction in machine language that increments the number in accumulator by one. The same instruction is represented by INR A in assembly language.Q. What do you mean by low level language and high level language? • The machine language and assembly language are microprocessor specific languages. • Therefore they are called as low level languages. • The programs written in these languages are not transferrable from one machine to another. • To overcome this limitation, such general purpose languages as BASIC, FORTRAN, and C have been devised. A program written in these languages is machine independent. Such languages are called high level languages.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 13
  • 7. 8085 MICROPROCESSORQ. Explain the term mnemonic. • Microprocessor instructions are in the binary form. Since the program written in binary instructions is difficult to understand, each manufacturer of a microprocessor has devised a symbolic code for each instruction. This symbolic code is called mnemonic. • The mnemonic for a particular instruction consists of letters that suggest the operation to be performed by that instruction. • For example, the binary code 0011 1100 (3CH in hexadecimal) of the 8085 microprocessor is represented by the mnemonic INR A. This instruction increments accumulator contents by one. • Similarly, the binary code 1000 0000 (80H) is represented by mnemonic ADD B. ADD stands for addition and B represents the contents in register B. This instruction performs addition of contents of B and contents of accumulator.Q. Explain the terms Opcode and operand. • An instruction is a command to the microprocessor to perform a given task on specified data. • Each instruction has two parts: one is the task to be performed, called the operation code (Opcode), and the second is the data to be operated on, called the operand. • The operand (or data) can be specified in various ways. It may include 8-bit (or 16-bit) data, an internal register, a memory location, or address. In some instructions, the operand is implicit.Q. Explain the term Assembler. • Writing programs in machine language is very difficult and error prone to write programs in machine language because it is just a series of 0s and 1s and instructions are not easily comprehended by just looking at the pattern. • To overcome this difficulty, computer manufacturers have devised English-like words to represent the binary instructions of microprocessor. Programmers can write programs using these words. This language is called assembly language. • Assembler is a computer program which translates an assembly language program to machine language program. • Programmer writes program in assembly language in the form of mnemonics. He then enters that assembly language program into assembler by using the ASCII keyboard. Assembler converts this program into binary machine code. • Since machine language is machine dependent, each microprocessor has its own assembler.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 14
  • 8. 8085 MICROPROCESSORArithmetic operationsThese instructions perform arithmetic operations such as addition, subtraction,increment and decrement.Logical operationsThese instructions perform various logical operations such as AND, OR, EX-OR,Compare, Compliment, etc.Branching operationsThese instructions alter the sequence f program execution either conditionally orunconditionally.Machine Control operationsThese instructions control machine functions such as Halt, Interrupt, etc.Q. How are 8085 instructions classified according to word size?The 8085 instruction set is classified into following three groups according to wordsize or byte size. • 1-byte instructions • 2-byte instructions • 3-byte instructionsONE-BYTE INSTRUCTIONSA 1-byte instruction includes the Opcode and the Operand in the same byte. Forexample Task Opcode Operand Binary Code Hex CodeCopy contents of accumulator MOV C, A 0100 1111 4FHin register CTWO-BYTE INSTRUCTIONSIn a 2-byte instruction, the first byte specifies the operation code and the secondbyte specifies the operand. For example Task Opcode Operand Binary Code Hex CodeLoad 8-bit data byte in the MVI A, 32H 0011 1100 3Eaccumulator 0011 0010 32© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 16
  • 9. 8085 MICROPROCESSORTHREE-BYTE INSTRUCTIONIn a 3-byte instruction, the first byte specifies the Opcode, and the following twobytes specify the 16-bit address. Note that the second byte is the low-order addressand the third byte is the higher-order address. For example Task Opcode Operand Binary Code Hex CodeLoad contents of memory LDA 2050H 0011 1010 3A2050H into A 0101 0000 50 0010 0000 20Q. Explain these terms: SSI, MSI and LSI. • SSI (small-scale integration): the process of designing a few circuits on a single chip. The term refers to the technology used to fabricate discrete logic gates on a chip. • MSI (medium-scale integration): the process of designing more than a hundred gates on a single chip. • LSI (large-scale integration): the process of designing more than a thousand gates on a single chip.Q. Explain Fetch Cycle and Write Cycle.Fetch Cycle: The microprocessor fetches the OPCODE or data from the memory orinput devices as follows. The content of the PC, the address is placed in the MAR.The content of the MAR is then transferred to the decoder, which is interfaced or inbuilt with the memory device. The decoder decodes the address, and selects theappropriate location according to the address supplied to it. The content of thespecified address is read and transferred into the microprocessor. If the item read isan OPCODE, then it is placed in the Instruction Register, and if the item read is data,then it is placed in the Data Register. This is a fetch cycle or memory read cycle. Inparticular following events are carried out within a fetch cycle: • Send address through address bus • Decode the address • Read the content of the specified location • Transfer the content of the specified location in the memory to the micro- processor.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 17
  • 10. 8085 MICROPROCESSORWrite Cycle: Write cycle is one that interprets writing operation. Microprocessor cansend data to a specific location of the memory or to an output device. During writingoperation, the microprocessor transfers the contents of the PC to the memorydecoder through MAR. The microprocessor uses WR (write) signal for writing into ¯¯the memory.Q. What do you mean by addressing modes? Explain the different types ofaddressing modes in Intel 8085 with examples. • Every instruction of a program has to operate on a data. • The method of specifying the data to be operated by the instruction is called Addressing.The 8085 has the following 5 different types of addressing. 1. Immediate Addressing 2. Direct Addressing 3. Register Addressing 4. Register Indirect Addressing 5. Implied AddressingImmediate Addressing: • In immediate addressing mode, the data is specified in the instruction itself. The data will be a part of the program instruction. • For example MVI B, 3EH - Move the data 3EH given in the instruction to B register.Direct Addressing: • In direct addressing mode, the address of the data is specified in the instruction. The data will be in memory. • For example LDA 1050H - Load the data available in memory location 1050H in to accumulator.Register Addressing: • In register addressing mode, the instruction specifies the name of the register in which the data is available. • For example MOV A, B - Move the content of B register to A register.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 18
  • 11. 8085 MICROPROCESSORRegister Indirect Addressing: • In register indirect addressing mode, the instruction specifies the name of the register in which the address of the data is available. Here the data will be in memory and the address will be in the register pair. • For example MOV A, M - The memory data addressed by H L pair is moved to A register.Implied Addressing: • In implied addressing mode, the instruction itself specifies the data to be operated. • For example CMA - Complement the content of accumulator.Q. What is meant by interfacing of microprocessor? • A microprocessor would not be of much use by itself. To perform useful work it needs to be connected to other electronic components. For example, for a computer to work, a microprocessor must be interfaced to main memory, a graphic subsystem, disk memory, the keyboard and USB ports, etc. • There are two types of interfacing o Memory interfacing o I/O interfacing • Memory interfacing: While executing an instruction, there is a necessity for the microprocessor to access memory frequently for reading various instruction codes and data stored in the memory. The primary function of a memory interfacing circuit is to aid the microprocessor in reading and writing a data to the given register of a memory chip. • I/O Interfacing: We know that keyboard and Displays are used as communication channel with outside world. So it is necessary that we interface keyboard and displays with the microprocessor. This is called I/O interfacing. • INTEL has developed some programmable peripheral devices for processors like 8085 for interfacing purpose. The peripheral devices includes o 8255 – Parallel Communication Interface (PPI) o 8251 – Serial communication Interface (USART- Universal Synchronous/Asynchronous Receiver/Transmitter) o 8257 – DMA Controller o 8279 – Keyboard/Display Controller o 8259 – Programmable Interrupt controller o 8254 – Programmable Timer© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 19
  • 12. 8085 MICROPROCESSORQ. What do you mean by Microcontrollers? • Microcontroller is a device that includes microprocessor, memory, I/O ports and other peripherals on a single chip, fabricated using VLSI technology. • A digital computer typically consists of three major components: the Central Processing Unit (CPU), program and data memory, and Input/output (I/O) system. • The CPU controls the flow of information among the components of the computer. It also processes the data by performing digital operations. • A microprocessor is a CPU that is compacted into a single chip semiconductor device. • A computer built around a microprocessor is called a microcomputer. The choice of I/O and memory devices of a microcomputer depends on the specific application. • A microcontroller is an entire computer manufactured on a single chip. Microcontrollers are usually dedicated devices embedded within an application. • Microprocessor itself is not a computer. For a microprocessor to act as control system, additional chips are necessary, e.g. memory devices for program and data storage and input/output ports to allow it to communicate with the external world. The microcontroller is the integration of a microprocessor with memory and input/output interfaces, and other peripherals such as timers, on a single chip.Q. Differentiate between Microcontroller and Microprocessor. Microcontroller MicroprocessorInbuilt RAM and ROM Do not have inbuilt RAM and ROMInbuilt timer Do not have inbuilt timerI/O ports are available I/O ports are not available, requires extra devices like 8155 or 8255Inbuilt serial port Do not have inbuilt serial port, requires extra devices like 8250 or 8251Separate memory to store program and Program and data are stored in samedata memoryMany multifunctional pins on the IC Less multifunctional pins on the ICBoolean operation i.e. operation on Boolean operation is not possible directlyindividual bits is possible directlyFew instructions to read/write data Many instructions to read/write datafrom/to memory from/to memory© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 20
  • 13. 8085 MICROPROCESSORPort 0 (P0.1/AD0-P0.7/AD7)Pins 32 to 39 make up the 8-bit bidirectional I/O port. Additionally it is used as loweraddress bus.Port 1 (P1.0-P1.7)Pins 1 to 8 make up the 8-bit bidirectional I/O port.Port 2 (P2.0/A8-P2.7/A15)Pins 21 to 28 make up the 8-bit bidirectional I/O port.Additionally it is used as higher order address bus.Port 3 (P3.0-P3.7)Pins 10 to 17 make up the 8-bit bidirectional I/O port. Additionally each of theseeight pins also has an alternate function, as detailed in the table below. Pin Name Alternate Function P3.0 RXD Serial input line P3.1 TXD Serial output line P3.2 ¯¯¯¯ INT0 External interrupt 0 P3.3 ¯¯¯¯ INT1 External interrupt 1 P3.4 T0 Timer 0 input P3.5 T1 Timer 1 input P3.6 WR ¯¯ External data memory write P3.7 RD ¯¯ External data memory readRSTThe reset input is on pin 9. This pin is used for resetting the 8051EA¯¯The external access, on pin 31, is used for enabling or disabling the on-chip ROM.When this pin is high, the 8051 executes instructions in internal ROM. When it islow, the 8051 will always execute instructions in external memory.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 24
  • 14. 8085 MICROPROCESSORALEThe address latch enable is on pin 30. The ALE is used for latching the low byte ofthe address into an external register.PSEN (Program Store Enable)¯¯¯¯The program store enable is an output signal on pin 29. This signal is used forfetching instructions from external code memory.XTAL1, XTAL2These are the pins for clock connection.© Rohan Desai- Automobile Dept- New Polytechnic, Kolhapur Page 25