On Wed, 17 Dec 2008 11:06:52 -0800, "Bob Blick" said: > > On Wed, 17 Dec 2008 11:24:40 -0700, "Vitaliy" said: > > > > > Why "about once per second"? I don't see the clock specified anywhere. > > Default clock is 4MHz, so that's 1 cycle per microsecond, and an > "if(!--i)" loop with i as an integer takes probably 12 cycles. So "about > 1 second" is more like "about .768432 second" Sorry, I really didn't explain that very well. "if(!--i)" takes 65536 passes each time to be true, and then the LED toggle takes place. Since the decrementing of i, testing, and looping of main takes about 12 cycles, it takes 65536 * 12 cycles between each toggling of the LED. -Bob -- http://www.fastmail.fm - Access all of your messages and folders wherever you are -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist