You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm not understanding how it works FDwfDigitalOutDividerSet(). From the C doc I saw that It sets the divider of the internal clock for the counter. Here it sets the frequency in Hz of the counter?
If it's so, it works properly only is you set as frequency the maximum frequency (i.e. 1e8 Hz). With lower frequency, It behaves differently.
For example, if you put the frequency of the counter to 10 kHz, and low and high counter to 5 and 5, I expect to see a square wave with a period of 1 ms, (0.1 * 5 + 0.1 *5 = 1), but I get a square wave of period 2ms.
FDwfDigitalOutEnableSet(pin, true);
FDwfDigitalOutDividerSet(pin, (int) 1e4); // Frequency of counter
FDwfDigitalOutCounterInitSet(pin, true, 0);
FDwfDigitalOutCounterSet(pin, 5, 5);
FDwfDigitalOutConfigure(true);
By the way, If I set the counter frequency to the max, everything works fine, but the sum of the values of the counters cannot exide unsigned int maximum (I think because c function has that limitation).
am I missing something about FDwfDigitalOutDividerSet() ?
Thk in advance,
Michele
The text was updated successfully, but these errors were encountered:
Hi,
I'm not understanding how it works FDwfDigitalOutDividerSet(). From the C doc I saw that It sets the divider of the internal clock for the counter. Here it sets the frequency in Hz of the counter?
If it's so, it works properly only is you set as frequency the maximum frequency (i.e. 1e8 Hz). With lower frequency, It behaves differently.
For example, if you put the frequency of the counter to 10 kHz, and low and high counter to 5 and 5, I expect to see a square wave with a period of 1 ms, (0.1 * 5 + 0.1 *5 = 1), but I get a square wave of period 2ms.
By the way, If I set the counter frequency to the max, everything works fine, but the sum of the values of the counters cannot exide unsigned int maximum (I think because c function has that limitation).
am I missing something about FDwfDigitalOutDividerSet() ?
Thk in advance,
Michele
The text was updated successfully, but these errors were encountered: