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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/26/07 21:38
Read: times


 
#148746 - absolutely, just worst case is not as bad
Responding to: ???'s previous message
Secondly, the timing should be always designed according to the worst case. There is no room to consider on average. Circular buffers extend the minumum character separation time to those multiplied by the buffer size. This span is compared with the maximum main loop time.

Absolutely, always design to 'worst case'.

If you have a workloop that takes 1/2 character time most of the time and, say, every 2 seconds (e.g. on a timed ADC interrupt) do something that takes 2 character times you will die if you are polling and live happily ever after with a ring buffer of sufficient size.

So, when using a ring buffer, worst case is not as bad, but a worst case, of course, still exist. This, of course does not allow you to insert 111 character time long 'occasional' processes. There always is a worst case to design to.

This, actually is a typical ADC/UART case. If the ADC processing is lenghty and the ADC reads are 'rare' a ring buffer is just the recipe.

Erik

List of 34 messages in thread
TopicAuthorDate
Having problem on using interrupt            01/01/70 00:00      
   Answers            01/01/70 00:00      
      not so fast, Cristoph and to Ragu            01/01/70 00:00      
         Serial comm is slow.            01/01/70 00:00      
            if you read the OP            01/01/70 00:00      
               good interupts            01/01/70 00:00      
                  AAAAAARGH            01/01/70 00:00      
                     not AAAAAAAARGH            01/01/70 00:00      
                        OH YES            01/01/70 00:00      
                           do You ever avoid "non-debuggable"?            01/01/70 00:00      
                              always            01/01/70 00:00      
                                 nice            01/01/70 00:00      
                                    a trick for "long ISRs" better than a RTOS            01/01/70 00:00      
         Buffered RX            01/01/70 00:00      
            not much difference            01/01/70 00:00      
               You are right            01/01/70 00:00      
   Sucess with interrupts            01/01/70 00:00      
      Isn't it too short?            01/01/70 00:00      
         the reason for circular buffers            01/01/70 00:00      
            Worst case, instead of average            01/01/70 00:00      
               absolutely, just worst case is not as bad            01/01/70 00:00      
                  single, double and ring buffer            01/01/70 00:00      
                     single, double and ring buffer app dependent            01/01/70 00:00      
         and some more reasons to use (circular) buffers            01/01/70 00:00      
            buffer overflow error            01/01/70 00:00      
               Buffer overflow handling            01/01/70 00:00      
                  Buffering options            01/01/70 00:00      
                     Beauty contest !            01/01/70 00:00      
                        flexible is the best?            01/01/70 00:00      
                        Simplicity is always better            01/01/70 00:00      
                           simple is another word for            01/01/70 00:00      
                              Where is the borderline to stumble on            01/01/70 00:00      
                                 Copper Oxide            01/01/70 00:00      
               please exclude me from the 'we'            01/01/70 00:00      

Back to Subject List