Dennis Crawley wrote : > Is it normal that the capture module varies ~1 unit the > capture of an stable sqare signal in all the range of > frecuencies? > 4000Hz 250 and 251 > 2000Hz 500 and 501 > 800Hz 1250 and 1251 > What this capture means? > There is something wrong in my interrupt routine? Dont have to be. And there isn't realy something called "stable" here, there will always be a slight variation, even if it's "small"). Now if your capture is on "the edge", it will sometimes fall in one side, sometimes on the other, just as a tossed coin. By adjusting the freq of the square signal a little, it might be possible to get a stable reading, then adjust a little more, and it will begin to jitter around the next "edge". > > Since I don't have a stable wave generator to test it, I've > > done a simple ON-OFF 50% duty oscillator with a 16F873. > > Using Andy Warren loop generator (625 Inst-cy) achieves > > full precision in MPLAB simulator, so I use some crystals > > to change the frequency and I've obtained these captures: - By using a pencil and paper (like MPSIM does) you can always get "full" precision. - Using real hardware you can never get "full" precision. - A crystal is not "stable". It has always a jitter. Jan-Erik. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu