| ??? 12/26/07 20:16 Read: times |
#148738 - the reason for circular buffers Responding to: ???'s previous message |
The ADC holds the result in the ADC SFRs until it finishes next conversion. Also, the UART holds the received byte on SBUF until the end of next byte reception.
Then, is there any difference from direct polling of the ADC flag or RI in the main loop? discussing the UART only, same applies to all other The reason for circular buffers is that, when using interrupts (i.e. not foolishly suffering from interruptifobia) and circular buffers the average main loop time must be less than the average character separation time. When using polling the maximum main loop time must be less than the minumum character separation time. Thus, if e.g. the main loop occasionally does a time consuming process polling will fall apart, but circular buffered interrupts will not. Erik |



