Hi Ok, now that’s looking a lot more like a counter and the normal counter residuals. The slope isn’t quite 1/tau, but it’s pretty close to that. Very nice.
One question: One side of the counter is running on the FE5650. What is the other side of the counter running on? Are the reference and input the same in this case? Bob > On Jan 14, 2015, at 10:55 AM, Li Ang <[email protected]> wrote: > > Hi > Just now, I changed the way to calculate frequency and get a better > ADEV chart. > http://www.qsl.net/b/bi7lnq/freqcntv4/test/20150114/0114.gif > http://www.qsl.net/b/bi7lnq/freqcntv4/test/20150114/newway.tim > http://www.qsl.net/b/bi7lnq/freqcntv4/test/20150114/oldway.tim > > > Thanks to John Miles's reply in the thread about ADEV. > >> If you feed in frequency samples, it will convert them to phase-difference >> samples internally, so the >> program itself doesn't really care. The use of frequency data has a few >> drawbacks such as less accurate >> ADEV plots due to the counter's dead time between readings, but it's the >> easiest way to get started and is >> perfectly usable for many purposes. >> >> > Old way: > //reset counter every second to avoid the overflow issue > while (1) { > reset_fpga_counter(); > trigger_and_read_cnt(&refA, &sigA); > delay_1s(); > trigger_and_read_cnt(&refB, &sigB); > Freq = Calc_freq(refB - refA, sigB - sigA); > } > > > New way: > //The counter keeps running. The software takes care of the overflow issue. > No dead time. > trigger_and_read_cnt(&ref_prev, &sig_prev); > while (1) { > delay_1s(); > trigger_and_read_cnt(&ref_curr, &sig_curr); > ref_delta = (ref_curr > ref_prev) ? (ref_curr - ref_prev) : (0xffffffff > - ref_prev + ref_curr); > sig_delta = (sig_curr > sig_prev) ? (sig_curr - sig_prev) : (0xffffffff > - sig_prev + sig_curr); > > Freq = CalcFreq(ref_delta, sig_delta); > ref_prev = ref_curr; > sig_prev = sig_curr; > } > > > BTW: I've put the counter into a box. > http://www.qsl.net/b/bi7lnq/freqcntv4/pic/20150114_212857.jpg > more pictures: http://www.qsl.net/b/bi7lnq/freqcntv4/pic/ > _______________________________________________ > time-nuts mailing list -- [email protected] > To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts > and follow the instructions there. _______________________________________________ time-nuts mailing list -- [email protected] To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
