On Aug 31, 2004, at 5:20 AM, Olin Lathrop wrote: > Given that, what's the best way to teach someone to time 5mS on a PIC? > This > is 1000s of instruction cycles even at a modest clock rate, so I think > a > busy loop shouldn't be the first recommendation. > > Huh? There's always a busy loop somewhere. Either you're waiting for enough instruction cycles to go by, or waiting for the clock tick to increment "enough", or you're waiting for an interrupt to happen. It seems to be a pretty common mistake for beginners in embedded programming not to realize that the CPU always is doing SOMETHING. Unlike a multiprocessing system, you can't just tell it to go off and do something else for a while. (this is also seem when people finish their application, and don't know what to have the PIC do after it's all over...) BillW _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist