I have an application where the sampling interval is critical. I need it to be exactly 10Hz.
The datasheet for the AD7793 gives 10Hz as one of the sampling intervals given a 64kHz input frequency, but the sample rate is actually slower than this (something like 9.99Hz). If you look at the spreadsheet "AD7785-AD7792-3-4-8-9_filter_model.xls" provided on the AD website, it looks like the magic external clock frequency required to get 10.000Hz sampling with FS0-3 set to 12 is exactly 64070Hz. However, this still does not give 10Hz sampling! It gives, as I have measured it, about 9.99844Hz. This might seem a small difference, but for my application this will cause a drift between the sampling and the master RTC over a period of days.
Note that I am achieving these odd-ball drive frequencies by disciplining a nominal 64kHz PWM-generated output using the application's RTC as a reference. This is the same RTC against which I am measuring the sampling intervals mentioned above. The drive frequency to the AD7793 therefore alternates between 64.00kHz and 64.22kHz over intervals of a few seconds, with the long-term average matching the desired frequency (e.g. 64070Hz).
The solution? With a drive frequency of 64080Hz, I get a measured sampling rate of exactly 10Hz within the measuring limits imposed by my 4096Hz RTC signal.
Does anyone have any ideas?
I notice that the filter model has an offset of 7 in the denominator of the sampling frequency formula. If the offset is instead 8, then the formula matches my experiences. Is the AD-provided filter model incorrect?