Forrest Christian wrote: > Yes, I knew I forgot to mention something like that... I'm counting a > signal on the order of 10Mhz.... and the comparator output has to be > really fast - much faster than you could implement even in a very tight > loop of assembly. > > -forrest Trade code size for speed. Implement the counter as a state machine so that for any given point only a single bye needs to be checked. You know for example that after the MSbyte has crossed some threshold it will test the same the next time. Even to the extent that the last 64 or 128 cycles are a piece of straight line code that flips the output at the end and starts at some indexed location. It might be surprising what could be done. Walter.. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist