Manfred said:
even-numbered clock: 40 MHz
odd-numbered clock: 27.678...MHz
time value: like in Unix "timespec" - 16bit for ns, 16bit for s
I can't make this time value from the 27.678...MHz-clock, because the
duration of one clock is not equal to nanoseconds.
So I want to make the time value by an 40MHz-clock, but I need the value in
the 27.678...MHz-clock-domain.
OK, so your main problem is to get this 16 bit value accros the clock
boundary, from the area running on the fast clock to the area on the
slow clock.
Because this value is generated with a different clock, you cannot clock
it in without further measures. The best way is to create a single
data-valid signal and solve the meta-stability problem on that signal.
That means that the signal must be at least two 40 MHz clock periods
long (otherwise it can be missed, clocking it in at 27 MHz) and this
signal must be clocked in with two cascaded flip-flops (for the
meta-stability problem). Also make sure that the source of the
data-valid signal is a flip-flop, so the transistion across the clock
boundary is directly from flip-flop to flip-flop, without any logic in
between (again: to avoid meta-stability problems).
Perhaps you'll also need a kind of request signal (indicating "give me a
new value") going from the 27 MHz area to the 40 MHz area. If so, the
meta-stablity problem should be considered there as well.
Paul.