Set up the timer to increment an up counter, when the counter >=3D a=20 number you select, could increment another counter, cascading until you=20 accumulate the number of timer periods you need, then reset counter()=20 and set flag you have arrived. This sort of thing can be done with down=20 counters also. Sorry my explanation isn't very ellagant, but hope the=20 message gets through. :) On 2/20/2012 3:49 PM, KPL wrote: > Now i'm wondering what would be the best way to calculate frequency > itself, without overflowing 4-byte integer, with maximum possible > precision. > > CNT=3D131129 > TMR=3D355708 > Freq=3D=3D5000000*CNT/TMR=3D1843211.28566127 > > CNT can be quite large number, so multiplied by 5e6 it can overflow. I > would like to get maximum significant digits, not for precision but > for resolution. Are there any tricks? > > I see I can define frequency as a byte*6 variable, for example - but > seems like I am getting weird results. is JALv2 able to deal with such > numbers? > > > On Mon, Feb 20, 2012 at 21:25, KPL wrote: > =20 >> Who knows. There was no more info. >> I think this one came from here: >> http://futurlec.com/ICCrystalsMain.shtml >> but since I have no proper tools to test them, I can not say all of >> them are bad. Probably that's just that one. Unfortunately I had it >> solderet in a small plug-in development board, where it is difficult >> to replace. >> >> >> On Mon, Feb 20, 2012 at 19:41, John Gardner wrote: >> =20 >>> Crystals are designed for specific operating modes. >>> Sure you got that right? =C2 Just a thought.... >>> -- >>> http://www.piclist.com PIC/SX FAQ& list archive >>> View/change your membership options at >>> http://mailman.mit.edu/mailman/listinfo/piclist >>> =20 >> >> >> -- >> KPL >> =20 > > > =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .