2.9 - Timers/Counters
The U3 has 2 timers (Timer0-Timer1) and 2 counters (Counter0-Counter1). When any of these timers or counters are enabled, they take over an FIO/EIO line in sequence (Timer0, Timer1, Counter0, then Counter1), starting with FIO0+TimerCounterPinOffset. Some examples:
1 Timer enabled, Counter0 disabled, Counter1 disabled, and TimerCounterPinOffset=4:
FIO4=Timer0
1 Timer enabled, Counter0 disabled, Counter1 enabled, and TimerCounterPinOffset=6:
FIO6=Timer0
FIO7=Counter1
2 Timers enabled, Counter0 enabled, Counter1 enabled, and TimerCounterPinOffset=8:
EIO0=Timer0
EIO1=Timer1
EIO2=Counter0
EIO3=Counter1
Starting with hardware revision 1.30, timers/counters cannot appear on FIO0-3, and thus TimerCounterPinOffset must be 4-8. A value of 0-3 will result in an error. This error can be suppressed by a power-up default setting in LJControlPanel. If suppressed, a 0-3 will result in an offset of 4.
Timers and counters can appear on various pins, but other I/O lines never move. For example, Timer1 can appear anywhere from FIO4 to EIO1, depending on TimerCounterPinOffset and whether Timer0 is enabled. On the other hand, FIO5 (for example), is always on the screw terminal labeled FIO5, and AIN5 (if enabled) is always on that same screw terminal.
Note that Counter0 is not available with certain timer clock base frequencies. In such a case, it does not use an external FIO/EIO pin. An error will result if an attempt is made to enable Counter0 when one of these frequencies is configured. Similarly, an error will result if an attempt is made to configure one of these frequencies when Counter0 is enabled.
Applicable digital I/O are automatically configured as input or output as needed when timers and counters are enabled, and stay that way when the timers/counters are disabled.
See Section 2.8.1 for information about signal connections.
Each counter (Counter0 or Counter1) consists of a 32-bit register that accumulates the number of falling edges detected on the external pin. If a counter is reset and read in the same function call, the read returns the value just before the reset.
The timers (Timer0-Timer1) have various modes available:
Note that these clocks apply to the U3 hardware revision 1.21+. With hardware revision 1.20 all clocks are half of the values above.
The first 3 clocks have a fixed frequency, and are not affected by TimerClockDivisor. The frequency of the last 4 clocks can be further adjusted by TimerClockDivisor, but when using these clocks Counter0 is not available. When Counter0 is not available, it does not use an external FIO/EIO pin. The divisor has a range of 0-255, where 0 corresponds to a division of 256.
Note that the DACs (Section 2.7) are derived from PWM signals that are affected by the timer clock frequency. The default timer clock frequency of the U3 is set to 48 MHz, as this results in the minimum DAC output noise. If the frequency is lowered, the DACs will have more noise, where the frequency of the noise is the timer clock frequency divided by 216.
DAQ Devices
- UD Series (U3, U6, UE9)
- U3
- Start with the UD Driver
- User's Guide
- 1 - Installation on Windows
- 2 - Hardware Description
- 3 - Operation
- 4 - LabJackUD High-Level Driver
- 5 - Low-level Function Reference
- Appendix A - Specifications
- Appendix B - Enclosure and PCB Drawings
- Frequency List for U3 Timer Mode 7
- UD Driver for Windows with U3 Quick Reference
- U3 Base Class for the Exodriver
- U3 Firmware Revision History
- U6
- UE9
- Software Options
- U3
- U12
- T Series
All Support Guides
Search
Shopping Cart
Testimonials
-
I'd like to thank you for your support and really detailed information for troubleshooting the UE9. [...] I am pleased with your support as it is rather uncommon these days to get such detailed information about a product.
—Max, Rainbow Electronics, Switzerland


Comments
No comments yet. Speak up. We're listening.