« Close

Datasheets and User Guides

App Notes

Software & Driver - Frequency Output (Mode 7)

Outputs a square wave at a frequency determined by TimerClockBase/TimerClockDivisor divided by 2*Timer#Value. The Value passed should be between 0-255, where 0 is a divisor of 256. By changing the clock configuration and timer value a wide range of frequencies can be output. The maximum frequency is 48000000/2 = 24 MHz. The minimum frequency is (750000/256)/(2*256) = 5.7 Hz.

The frequency output has a -3 dB frequency of about 10 MHz on the FIO lines. Accordingly, at high frequencies the output waveform will get less square and the amplitude will decrease.

The output does not necessarily start instantly, but rather has to wait for the internal clock to roll. For the Frequency Output mode, the start delay varies from 0.0 to TimerClockDivisor*256/TimerClockBase. For example, if TimerClockBase = 48 MHz and TimerClockDivisor = 256, the start delay will vary from 0 to 1.4 ms.


I am tasked with providing a frequency output that sweeps from 20 Hz to 10,000 Hz. I can dial in any of the frequencies individually. How can I code VBA to make it sweep as smooth as possible throughout the range?

To update smoothly you will want to use the timer update function, not the eTC_Config function. The "easy" function will completely reset the system causing a few milliseconds of inactivity. Using the timer update function will change the frequency within one period.