N
nivparsons
I have a counter running at 2^20 HZ, driven by a clock about 100 times
faster. (Osc_1)
I also have an incoming rerference pulse every 10ms. (Osc 2 derived)
I'd like to sync my fast counter so that it agrees with the reference,
but freq too low for a PLL or DCM etc.
So far, I have 2 counters, cntr_1 effectively assumes the time for
10ms increments and then counts at the 2^20 rate. cntr_2, the one
Ineed to sync, free runs, but is compared every sync pulse (just
after) withthe updated cntr_1. The prescaler for cntr_2 is then incr
or decr by 1 so it slows down or speeds up until it is close (1/2 lsb,
I have extra bits) to cntr_1 value.
This works, but if Ilose the 10ms sync pulses, then both cntrs free
run, whereupon any drift due to clock freq diffs, in osc1 and osc2,
will accumulate.
I can't "pull" the oscillator (osc1) unfortunately, otherwise a simple
solution presents itself.
Is there a better way?
Niv.
faster. (Osc_1)
I also have an incoming rerference pulse every 10ms. (Osc 2 derived)
I'd like to sync my fast counter so that it agrees with the reference,
but freq too low for a PLL or DCM etc.
So far, I have 2 counters, cntr_1 effectively assumes the time for
10ms increments and then counts at the 2^20 rate. cntr_2, the one
Ineed to sync, free runs, but is compared every sync pulse (just
after) withthe updated cntr_1. The prescaler for cntr_2 is then incr
or decr by 1 so it slows down or speeds up until it is close (1/2 lsb,
I have extra bits) to cntr_1 value.
This works, but if Ilose the 10ms sync pulses, then both cntrs free
run, whereupon any drift due to clock freq diffs, in osc1 and osc2,
will accumulate.
I can't "pull" the oscillator (osc1) unfortunately, otherwise a simple
solution presents itself.
Is there a better way?
Niv.