« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.9.2 - Timer Operation/Performance Notes

Note that the specified timer clock frequency is the same for all timers. That is, TimerClockBase and TimerClockDivisor are singular values that apply to all timers. Modes 0, 1, 2, 3, 4, 7, 12, and 13, all are affected by the clock frequency, and thus the simultaneous use of these modes has limited flexibility. This is often not an issue for modes 2 and 3 since they use 32-bit registers.

The output timer modes (0, 1, and 7) are handled totally by hardware. Once started, no processing resources are used and other U6 operations do not affect the output.

The edge-detecting timer input modes do require U6 processing resources, as an interrupt is required to handle each edge. Timer modes 2, 3, 5, 6, 9, 12, and 13 must process every applicable edge (rising or falling). Timer modes 4 and 8 must process every edge (rising and falling). To avoid missing counts, keep the total number of processed edges (all timers) less than 30,000 per second. That means that in the case of a single timer, there should be no more than 1 edge per 33 μs. For multiple timers, all can process an edge simultaneously, but if for instance both timers get an edge at the same time, 66 μs should be allowed before any further edges are applied. If streaming is occurring at the same time, the maximum edge rate will be less (7,000 per second), and since each edge requires processing time the sustainable stream rates can also be reduced.

2 comments

I'm a little confused by the 30000 edges/sec, 1 edge/33 usec specification (for single timer) or 2 edge/66 usec (two simultaneous edges on two separate timers).  I'm reading a U.S. digital MAE3 12 bit absolute magnetic rotary encoder that uses duty cycle to indicate angle.  The lowest pulse representing 0 deg is 1 usec (each tic of the encoder is 1 usec, the longest pulse is 4097 usec representing 359.91 deg).  As a result, at 0 deg, there would only be 1 usec between the initial rising edge of the signal and the falling edge.  Does this mean the LabJack is unable to read the encoder at pulse widths less than 33 usec?  I'm currently using DAQFactory with my labjack U6 and reading 4 of these encoders at the same time, and it appears to be working fine, even at small angles (I've checked the sensor using an external digital angle gauge).  I feel like I'm missing something here.  Am I getting false readings?

Correct. The Labjack can only process edges so quickly. If two edges come in on  a single line within 33us. The second could be missed. There is another option. You could use the Line-2-Line mode. This mode has very high resolution and is able to use hardware to capture both edges, so missing an edge is not an issue. The down side is that Line-2-Line is single shot operation meaning that you would have to read and rearm periodically.