On 13/07/2011 10:10, dipten wrote: > However the problem now is: how to synchronize with some arbitrary input > waveform or arbitrary frequency (changed to square wave using comparator)= .. > > Can any one please suggest me a scheme? Count between two rising (or falling) edges to measure very low frequencies= .. Count using onboard HW counter and read & reset at fixed time interval=20 to measure higher frequencies Use XOR between your current O/P (internal Squarewave at 0 or 90=20 degrees) 1 or 0 and software low pass filter to retard or increase the=20 start time of scanning the 256 table. Read up on how PLLs work. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .