Polling and Interrupts

Polling and Interrupts:

In Polling and Interrupts of the microprocessor’s software simply checks each of the I/O devices every so often. During this check, the microprocessor tests to see if any device needs servicing. Fig. 5.1 shows the flow chart for polling subroutine.

This is a simple program which services I/O ports A, B, and C. The polling routine checks the status of I/O ports in proper sequence. It first transfers the status of I/O port A into the accumulator. Then the polling routine block checks the contents of accumulator to see if the service request bit is set. If it is, I/O port A service routine is called.

After completion of service routine for I/O port A, the polling routine moves on to test port B and the process is repeated. This test and service procedure continues until all the I/O port status registers are tested and all the I/O ports requesting service are serviced. Once this is done, the microprocessor continues to execute the normal programs.

Polling and Interrupts

The polling routine assigns priorities to the different I/O devices. Once the polling routine is started, the service request bit at port A is always checked first. Once port A is checked, port B is checked, and then port C. However, the order can be changed by simply changing the polling routine and thus the priorities.

Interrupt:

A more desirable method would be the one that allows the microprocessor to be executing its main program and only stop to service I/O devices when it is told to do so by the device itself.

In effect, the method, would provide an external asynchronous input that would inform the processor that it should complete whatever instruction that is currently being executed and fetch a new routine that will service the requesting device. Once this servicing is completed, the processor would resume exactly where it left off. This method is called interrupt method. Before going in detail about the interrupt, we will see the analogy to the interrupt concept.

An analogy to the interrupt concept is the classroom, where the professor will serve as the CPU and the students as I/O ports. The classroom scenario for this interrupt analogy will .be such that the professor is busy in writing on the blackboard and delivering his lecture.

The student raises his hand when he wants to ask a question (student requesting for service). The professor then Completes his sentence and acknowledges student’s request by saying “Yes” (Professor acknowledges the interrupt request). After acknowledgment from the professor, student asks the question and professor gives answer to the question (professor services the interrupt) and resumes his respective work.

MORE RELATED ARTICLE

Leave a Reply

Your email address will not be published. Required fields are marked *

COPYRIGHT © 2014 TO 2018 EEEGUIDE.COM ALL RIGHTS RESERVED | HOME | SITEMAP | CONTACT US | ABOUT US | PRIVACY POLICY | Frontier Theme