06-16-2008 04:03 PM
06-16-2008 05:44 PM
I'm pretty sure this'll explain it:
Your board has a 20 MHz timebase for its counters. When generating output pulsetrains, it can only divide this down to integer #'s of cycles for the low time and the high time respectively. You're fine to generate 1, 2, or 5 MHz pulsetrains as you get (low,high) times of (10,10), (5,5), (2,2) respectively.
When you request 4 MHz, you need to divide the 20 MHz timebase down by 5 total. So you get 2 low and 3 high or vice versa.
Incidentally, your request for 3 MHz may give you a square wave with equal high and low times, but it can't be at exactly 3 MHz. Most likely, the driver picks the closest possible freq of 3.3333... MHz by dividing down by 6. But you *do* get a square wave because (low, high) = (3,3).
-Kevin P.