Divisor=1 Divisor=1
TimerBaseClock
Value=1 Value=256
0 4 MHz 2000000.0 7812.50
1 12 MHz 6000000.0 23437.50
2 48 MHz (Default) 24000000.0 93750.00
Divisor=1 Divisor=256
Value=1
Value=256
3 1 MHz /Divisor 500000.0 7.629
4 4 MHz /Divisor 2000000.0 30.518
5 12 MHz /Divisor 6000000.0 91.553
6 48 MHz /Divisor 24000000.0 366.211
Mode 7 Frequency Ranges
Note that the clocks above apply to the U3 hardware revision 1.21. With hardware revision 1.20
all clocks are half of those values.
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 waits for the internal clock to roll. For
example, if the output frequency is 100 Hz, that means the period is 10 milliseconds, and thus
after the command is received by the device it could be anywhere from 0 to 10 milliseconds
before the start of the frequency output.
2.9.1.8 Quadrature Input (Mode 8)
Requires both timers, where Timer0 will be quadrature channel A, and Timer1 will be
quadrature channel B. Timer#Value passed has no effect. The U3 does 4x quadrature
counting, and returns the current count as a signed 32-bit integer (2’s complement). The same
current count is returned on both timer value parameters.
Writing a value of zero to either or both timers performs a reset of both. After reset, a read of
either timer value will return zero until a new quadrature count is detected. If a timer is reset
and read in the same function call, the read returns the value just before the reset.
2.9.1.9 Timer Stop Input (Mode 9)
This mode should only be assigned Timer1. On every rising edge seen by the external pin, this
mode increments an 8-bit register. When that register matches the specified timer value (stop
count value), Timer0 is stopped. The range for the stop count value is 1-65535. Generally, the
signal applied to Timer1 is from Timer0, which is configured as output. One place where this
might be useful is for stepper motors, allowing control over a certain number of steps.
Once this timer reaches the specified stop count value, and stops the adjacent timer, the timers
must be reconfigured to restart the output.
When Timer0 is stopped, it is still enabled but just not outputting anything. Thus rather than
returning to whatever previous digital I/O state it had, it goes to input (which has a 100 kΩ pull-
up). That means the best results are obtained if Timer0 was initially configured as input (factory
default), rather than output-high or output-low.
The read from this timer mode returns the number of edges counted, but does not increment
past the stop count value.
35