Processor Architecture
Unit - 3Interrupt and its types Q 1) What is mean by interrupt?A 1)Interrupt:Interrupt is a hardware mechanism in which, the device notices the CPU that it requires its attention. Interrupt can take place at any time. So when CPU gets an interrupt signal trough the indication interrupt-request line, CPU stops the current process and respond to the interrupt by passing the control to interrupt handler which services device. In interrupt, the device notices the CPU that it requires its attention. An interrupt is not a protocol, its a hardware mechanism. In interrupt, the device is serviced by interrupt handler. Interrupt can take place at any time. In interrupt, interrupt request line is used as indication for indicating that device requires servicing. In interrupts, processor is simply disturbed once any device interrupts it. Q 2) What is mean by polling?A 2)Polling:In polling is not a hardware mechanism, its a protocol in which CPU steadily checks whether the device needs attention. Wherever device tells process unit that it desires hardware processing, in polling process unit keeps asking the I/O device whether or not it desires CPU processing. The CPU ceaselessly check every and each device hooked up thereto for sleuthing whether or not any device desires hardware attention. Each device features a command-ready bit that indicates the standing of that device, i.e., whether or not it’s some command to be dead by hardware or not. If command bit is ready one, then it’s some command to be dead else if the bit is zero, then it’s no commands. Whereas, in polling, CPU steadily checks whether the device needs attention. Whereas it isn’t a hardware mechanism, its a protocol. While in polling, the device is serviced by CPU. Whereas CPU steadily ballots the device at regular or proper interval. While in polling, Command ready bit is used as indication for indicating that device requires servicing. On the opposite hand, in polling, processor waste countless processor cycles by repeatedly checking the command-ready little bit of each device. Q 3) Write sequence of steps that occurs during interrupt processing.A 3)The sequence of steps that occurs during interrupt processing are he contents of flag register the CS and IP are pushed on to the stack. To disable single steps and INTR interupts the TF and IF are cleared. The program then jumps to the beginning or starting adsress of ISS. When the IRET executes last line that are also ISS last line the CS and IP flag contents are popped from stack and placed in appropriate registers. Once the flags are restored then Tf and IF values are also restored to their previos values. Then it continues the process which was doing before interrupt. Q 4) Write a five source of interrupt and explain it.A 4)Internal interrupts External interrupt Exceptions Non-maskable interrupts Software interrupts There are many sources for interrupts varying from simply asserting an external pin to error conditions within the processor that require immediate attention. Internal interrupts:Internal interrupts are those that are generated by on-chip peripherals such as serial and parallel ports. With an external peripheral, the device will normally assert an external pin which is connected to an interrupt pin on the processor. External interrupts:External interrupts are the common method of connecting external peripherals to the processor. They are usually provided through external pins that are connected to peripherals and are asserted by the peripheral. Exceptions:Many processor architectures use the term exception as a more generic term for an interrupt. While the basic definition is the same (an event that changes the software flow to process the event) an exception is extended to cover any event, including internal and external interrupts, that causes the processor to change to a service routine. Typically, exception processing is normally coupled with a change in the processor’s mode. This will be described in more detail for some example processors later in this chapter. The range of exceptions can be large and varied. A MC68000 has a 256 entry vector table which describes about 90 exception conditions with the rest reserved for future expansion. An 8 bit micro may have only a few. Software interrupt:The advantage of an interrupt is that it includes a mecha-nism to change the program flow and in some processor architectures, to change into a more protected state. This means that an interrupt could be used to provide an interface to other software such as an operating system. This is the function that is provided by the software interrupt. It is typically an instruction or set of instructions that allows a currently executing software sequence to change flow and return using the more normal interrupt mechanism. With devices like the Z80 this function is provided by the SWI (software interrupt instruction). With the MC68000 and PowerPC architectures, the TRAP instruction is used. Non-maskable interrupt:A non-maskable interrupt (NMI) is as its name suggests an external interrupt that cannot be masked out. It is by default at the highest priority of any interrupt and will always be recognised and processed. In terms of a strict definition, it is masked out when the ISR starts to process the interrupt so that it is not repeatedly recognised as a separate interrupt and therefore the non-maskable part refers to the ability to mask the interrupt prior to its assertion. Enabling and disabling interrupts:To enable means to allow interrupts at this time. Conversely, to disable means to postpone interrupts until a later time. On the ARM Cortex-M processor there is one interrupt enable bit for the entire interrupt system. The processor services interrupts and exceptions only between the end of one instruction and the beginning of the next. When the repeat prefix is used to repeat a string instruction, interrupts and exceptions may occur between repetitions. Thus, operations on long strings do not delay interrupt response. Certain conditions and flag settings cause the processor to inhibit certain interrupts and exceptions at instruction boundaries. Q 5) Write a short note on internal interrupt and External interrupt.A 5)Internal interruptsInternal interrupts are those that are generated by on-chip peripherals such as serial and parallel ports. With an external peripheral, the device will normally assert an external pin which is connected to an interrupt pin on the processor. With internal peripherals, this connection is already made. Some integrated processors allow some flexibility concerning these hardwired connections and allow the priority level to be adjusted or even masked out or disabled altogether. External interrupts:External interrupts are the common method of connecting external peripherals to the processor. They are usually provided through external pins that are connected to peripherals and are asserted by the peripheral. For example, a serial port may have a pin that is asserted when there is data present within its buffers. The pin could be connected to the processor interrupt pin so that when the processor sees the data ready signal as an interrupt. The corresponding interrupt service routine would then fetch the data from the peripheral before restoring the previous processing. Q 6) Write short note on non maskable interrupt.A 6)A non-maskable interrupt (NMI) is as its name suggests an external interrupt that cannot be masked out. It is by default at the highest priority of any interrupt and will always be recognised and processed. In terms of a strict definition, it is masked out when the ISR starts to process the interrupt so that it is not repeatedly recognised as a separate interrupt and therefore the non-maskable part refers to the ability to mask the interrupt prior to its assertion. Q 7) What is mean by interrupt register.A 7)An interrupt control register, or ICR, is a hardware register in a computer chip used to configure the chip to generate interrupts—to raise a signal on an interrupt line—in response to some event occurring within the chip or a circuit connected to the chip.IMR ICR ISR IPR ICR:An interrupt control register, or ICR, is a hardware register in a computer chip used to configure the chip to generate interrupts—to raise a signal on an interrupt line—in response to some event occurring within the chip or a circuit connected to the chip. An Interrupt Control is usually used in Micro controllers to generate interrupts signals which tells the CPU to pause its current task and start executing another set of predefined activities. ISR: ISR is an integrated intelligence and operations function that can be defined as a coordinated acquisition, processing, and provision of accurate, relevant, timely information and intelligence to support a commander's decision making process. Priority of InterruptsA priority interrupt is a system which decides the priority at which various devices, which generates the interrupt signal at the same time, will be serviced by the CPU. The system has authority to decide which conditions are allowed to interrupt the CPU, while some other interrupt is being serviced. Generally, devices with high speed transfer such as magnetic disks are given high priority and slow devices such as keyboards are given low priority.\ When two or more devices interrupt the computer simultaneously, the computer services the device with the higher priority first. Q 8) Explain about 16x2 LCD and KEY.A 8)Interfacing 16 x 2 LCD and keyboard 16 x 2 character lcd display is very basic module which is commonly used in electronics devices and projects. It can display 2 lines of 16 characters. Each character is displayed using 5×7 or 5×10 pixel matrix. Interfacing 16×2 LCD with 8051 using Keil C is bit complex because there is no powerful libraries in Keil C. To solve this problem we have developed a LCD library which includes commonly used features, you just need to include our header file and use it. You can download the header file at the bottom of this article. In Embedded system design, matrix keypad (4x4, 4x3, 3x3 or 5x5) is used for key in the user inputs. Similarly character LCD display [16x2, 16x4, 20x2 or 20x4 LCDs] is used for indicating the system status / parameters. This intractable is about interfacing 16×2 LCD and 4x4 matrix keypad with Arduino microcontroller. Parts and componentsArduino Uno board 16x2 LCD 1 K ohm potentiometer 4x4 matrix keypad The 16x2 is very common type LCD, with two rows, and each row displays 16 characters of either 5x7 or 5x8 dot matrix characters. The LCD is available in a 16 pin package. It consists of back light and contrast adjustment function and each dot matrix has 5×8 dot resolution. The 16x2 LCD display is connected to the Arduino (A0,A1,A2,A3,A4,A5) analog IO pins, where those pins are configured as digital in / out, where LCD operates at 4 bit data mode. If the display is not visible, adjust the Contrast pot (1K), to make it visible. Matrix key pad is arranged by push button switches in rows and columns. In a simple technique, the 16 keys of matrix keypad is connected with 8 digital IOpins of Arduino. Usually the keypad scan procedure is the key is decoded through Column selection / Row read. Write HIGH to Column One. And keep rest of the Column to LOW. Scan (Read) the Row One to Row Four, to find the key. Repeat until a key press (are multiple) is identified. The Row pins are connected to 5,4,3 and 2nd digital IO pins of Arduino. The Column pins are connected to 6,7,8 and 9th digital IO pins of Arduino. Q 9) Explain interfacing relay and buzzer.A 9)Interfacing relay and buzzerIn this circuit we show the relay and buzzer interfacing with micro controller. The relay is a switching device that use to control the high voltage DC/AC through 5v/9v/12v DC. The relay work on elector mechanical system. In this device a coil is present which generate the magnetic field when the 5v DC is provided. A iron rod is present near the coil which one point connected to the spring. The spring force the rod. In this circuit we show the relay and buzzer interfacing with micro controller. The relay is a switching device that use to control the high voltage DC/AC through 5v/9v/12v DC. The relay work on elector mechanical system. In this device a coil is present which generate the magnetic field when the 5v DC is provided. A iron rod is present near the coil which one point connected to the spring. The spring force the rod opposite direction of coil. In bottom side of rod two poles are present, one present near the coil and second present other side of coil. In normal condition the rod connected to the pole second. When the supply is provided to the coil it attract the rod and it connected to the pole one and connected to the pole one until the coil is magnetized. The controlling device like AC bulb, fan etc is connected to the rod and first pole with supply. So when we give the 5v the relay your bulb is ON and it ON continuously until the 5v supply is present. The relay require the more current so it connect to the transistor. Here we use the NPN transistor so it ON when positive supply is given to the base. The coil also store the DC so the stored can be damage the transistor by give the back current so we use the diode in reverse bias to protect the back current. The present LED use to indicate the relay condition. The buzzer is use to give the sound. Its positive terminal (red wire) is connected to the 5v supply and ground terminal (black wire) is connect to the ground through PNP transistor. PNP transistor is ON when ground is given to the base.Here we connect a switch to the P1.0, connect the relay P2.0 and connect the buzzer to the P2.1. When we press the switch the buzzer give the sound until the switch is pressed. The first time press the switch the relay is start and work as a dipper. After pressing the switch the relay will stop. Again press the switch the relay start the dipper. Q 10) Write principle behind interfacing LED.A 10)Principle behind Interfacing LED The main principle of this circuit is to interface LEDs to the 8051 family micro controller. Commonly, used LEDs will have voltage drop of 1.7v and current of 10mA to glow at full intensity. This is applied through the output pin of the micro controller.is very commonly used electronic display module and having a wide range of applications such as calculators, laptops, mobile phones etc. Q 11) Write a short notes on external hardware interrupt.A 11)The external interrupts are the interrupts received from the (external) devices interfaced with the microcontroller. They are received at INTx pins of the controller. These can be level triggered or edge triggered. In level triggered, interrupt is enabled for a low at INTx pin; while in case of edge triggering, interrupt is enabled for a high to low transition at INTx pin. The edge or level trigger is decided by the TCON register. Setting the IT0 and IT1 bits make the external interrupt 0 and 1 edge triggered respectively. By default these bits are cleared and so external interrupt is level triggered. For a level trigger interrupt, the INTx pin must remain low until the start of the ISR and should return to high before the end of ISR. If the low at INTx pin goes high before the start of ISR, interrupt will not be generated. Also if the INTx pin remains low even after the end of ISR, the interrupt will be generated once again. This is the reason why level trigger interrupt (low) at INTx pin must be four machine cycles long and not greater than or smaller than this. Following are the steps for using external interrupt : Enable external interrupt by configuring IE register. Write routine for external interrupt. The interrupt number is 0 for EX0 and 2 for EX1 respectively.
0 matching results found