Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/03/04 20:40
Read: times


 
#73586 - RE: Polling
Responding to: ???'s previous message
Hi Dan,

Okay. I've read and deliberated your posting. Let me be clear about this. I do believe you, simply because you've obviously had experience with this that I have not. Nonetheless, I do not understand a couple of points.

I understand the point that not all I/O must be done concurrently with other processes. And it seems pretty clear that if I/O is not done concurrently, the need for an interrupt is aleviated. But you seem to be asserting that polling was a better choice in your circumstance because, "... the sheer overhead of servicing interrupts introduce[d] too many cycles to be able to keep up." Herein, I believe, is the crux of my confusion. On the one hand you have polling wherein you must use at least one instruction to decide whether to service the serial port buffer (e.g.,If RI == 1;). This compares to a hardware interrupt which requires zero instructions to decide that you need to service the serial port buffer. It seems to me that as the data throughput increases, the need for interrupts increases. But this is the opposite of your experience.

So, this is my interpretation/guess concerning your experience. Since your program did nothing else but service the serial port buffer ("And by the way, the system had absolutely nothing else to do until it received a packet."), your entire program was, in effect, the SPI routine. The cycles that would have been eaten up by harware vectoring you to a starting address, and the subsequent cycles used returning control, would have been wasted cycles since the routine they would have vectored you to and from was the program itself.

So it seems that this is a good example of the circumstance I was asking about. If the main program is a dedicated serial port service routine, then there is no need for interrupt vectoring. Moreover, using the hardware vectoring becomes a waste of cycles thereby making polling the preferrable approach. Stated simpler, if the whole program is a serial port routine, using hardware interrupts is a waste.

But, would you say that if the program is not dedidcated exclusively to servicing the serial port, it is probably better to use the interrupt? Or, is it possible that there are circumstances wherein polling within a larger context (program) might still be preferrable to using interrupts? And how would one quantify it?

List of 29 messages in thread
TopicAuthorDate
UART Without Serial Interrupt?            01/01/70 00:00      
   Polling            01/01/70 00:00      
      RE: Polling            01/01/70 00:00      
         RE: Polling            01/01/70 00:00      
            RE: Polling            01/01/70 00:00      
               RE: Polling            01/01/70 00:00      
                  RE: Polling            01/01/70 00:00      
                     RE: Polling            01/01/70 00:00      
                        RE: Polling            01/01/70 00:00      
                           RE: Polling            01/01/70 00:00      
                              RE: one step further            01/01/70 00:00      
                                 RE: one step further            01/01/70 00:00      
                                 another step further            01/01/70 00:00      
                                    RE: another step further            01/01/70 00:00      
                                       RE: another step further caveats            01/01/70 00:00      
                                          RE: another step further caveats            01/01/70 00:00      
                     RE: Polling -- long            01/01/70 00:00      
            RE: Polling            01/01/70 00:00      
               RE: Polling            01/01/70 00:00      
   RE: UART Without Serial Interrupt?            01/01/70 00:00      
      RE: UART Without Serial Interrupt?            01/01/70 00:00      
         RE: UART Without Serial Interrupt?            01/01/70 00:00      
         RE: UART Without Serial Interrupt?            01/01/70 00:00      
            RE: UART Without Serial Interrupt?            01/01/70 00:00      
   RE: UART Without Serial Interrupt?            01/01/70 00:00      
   When is polling preferable?            01/01/70 00:00      
      RE: When is polling preferable?            01/01/70 00:00      
   RE: UART Without Serial Interrupt?            01/01/70 00:00      
   Advantage of polling            01/01/70 00:00      

Back to Subject List