Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is my flowchart for programmed io and interrput drive io correct?

shivajikobardan

New Member
Source of my knowledge-: https://electronics.stackexchange.com/questions/204337/programmed-io-vs-interrupt-for-devices

https://slideplayer.com/slide/265620/



And my teacher.

So here is what I understand about



1) Programmed IO-:

Here CPU periodically executes instruction which reads READY pin



2) Interrupt driven IO-:

Here CPU checks interrupt at the end of each instruction cycle whereas IO device sends interrupt.

The original flowchart for these are as follows-:


Here is what I have made-:




First one is programmed io and second one is interrupt driven io. In interrupt driven io I mistakenly drew arrow from "CPU issues read command to IO module" to "hardware/CPU checks for interrupt at the end of each instruction cycle".


I just want to know if my understanding of flowchart is correct or not?
 

rjenkinsgb

Well-Known Member
Most Helpful Member
The interrupt one is pretty reasonable in itself, but by no means 100% accurate.

The programmed one is only one way of doing it - and by no means the ideal one!

eg. An interrupt based system can have a regular interrupt, often called a clock interrupt, where several different I/O devices or buffers are checked, and if the one being checked does not need any action at that instant, it's skipped (not waited for) and the other things checked in the same way, then the interrupt exits and the main program execution resumes.

Pure programmed I/O can be done in the same way; if a program runs in a fast enough "loop" through its normal functions without ever stalling, it can check for I/O actions needed or do them every time, again skipping forward rather than waiting if something is not ready in that pass through the loop.

Or a mixture of the two.

Pure programmed I/O as that flowchart shows (with no interrupts used) with where the program loops waiting for something to happen is very rare in the real world, usually it's restricted to simple example programs or applications that are themselves near trivially simple.

In the majority of applications the program must respond to user input and do other things at the same time, so perpetually sitting in a wait loop is not feasible.
 

rjenkinsgb

Well-Known Member
Most Helpful Member
Your first one matches the inner part of the left one, the programmed I/O.
The original has a bit extra to allow for multiple transfers, the outer loop.

Your interrupt one close, but is missing the error check (status check), to verify the interrupt was valid for the device to be read from.
(And again without the outer loop).
 

Latest threads

EE World Online Articles

Loading
Top