??? 07/02/04 19:37 Read: times |
#73545 - RE: Polling Responding to: ???'s previous message |
I know that µ-controllers are a lot faster than a typical serial port. If one assumes an average of 4 clock cycles per instruction and a 10 MHz clock, that gives you 400 ns (0.4 µs) per instruction. Compare this to a 9600 baud serial port. Assuming 8-N-1 = 9 bits per byte of data, one can expect 937.5 µs per byte transmitted. This implies that one could expect a little over 2300 instructions to execute in the time it takes to transmit or receive one byte of data. This makes the assertion that one can poll frequently enough seem quite reasonable.
Nonetheless, doesn't it seem just a bit haphazard to trust that your never going to execute more than 2300 instructions before the next poll? And wouldn't it be easier to just use the hardware interrupt rather than implementing something in software to ensure a poll in no more than every 2000 instructions? |