Dwayne Reid wrote: > Using the prescaler with TMR0 makes a 16 bit counter which is essentially > independent of the PIC core. > > Using the PIC core to generate the gate signal can be very deterministic. > If you make a loop that consumes 100,000 clock cycles, you will create a 100 > mS gate (assuming 4.00 MHz crystal) with accuracy determined by the crystal > used. > > In other words, this can function exactly like my old Fluke 1900A does. The application assumes a calibration for each equipment, generating a conversion factor from the reading pulses to what it should be in real, so if the PIC clock oscillator frequency doesn't change so much with temperature (ppm), it will be ok. The main idea is to gate "x" time using the prescaler, read it as the high 8 bits, and then gate "x/256" without prescaler, so it would be the lower 8 bits. For an external frequency of 20MHz, "x/256" gate needs to be a max of 12.8us, while "x" would be 3.27ms. Assuming a 20MHz PIC clock osc, 12.8us represents 256 instruction cycles, plenty to control the timming, I guess, Is that right? -------------------------------------------------------- Wagner Lipnharski - UST Research Inc. - Orlando, Florida Forum and microcontroller web site: http:/www.ustr.net Microcontrollers Survey: http://www.ustr.net/tellme.htm