Larry Bradley escreveu: .... > As to the pulse width, I've tried that, and also using the CCP module in = capture mode. The "test the bit in a loop" gives the best results. > > Larry .... Some PICs have a TMR1 with GATE input, which is the best way to measure pulses (not total period, just the low or high part). For instance if you want to measure the "high" width: 1) Stop TMR1; 2) Clear TMR1; 3) Set TMR1 to run when GATE is "high"; 3) Wait for the signal (tied to the GATE pin) go "low"; 4) Start TMR1; 5) Wait for the signal go "high" (may be a very sloppy loop); 6) Wait for the signal go "low" (may be a very sloppy loop); 7) Stop TMR1 and read the result. This way you will get a resolution of one Tcy, but each semi-cycle must be longer than the time you take to detect a transition. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist