Skip to main content
Skip table of contents

Timer#: IOType=42,44

Timer#, 4 Command Bytes: 

0

IOType=42,44, (46,48 U6 Only)

1

Bit 0: UpdateReset

2

ValueLSB

3

ValueMSB

4 Response Bytes: 

0

Timer LSB

1

Timer

2

Timer

3

Timer MSB

This IOType provides the ability to update/reset a given timer, and read the timer value.

  • Value: These values are only updated if the UpdateReset bit is 1. The meaning of this parameter varies with the timer mode.

  • Timer: Returns the value from the timer module. This is the value before reset (if reset was done).

Example

PY
# For reading the value of the Timer. It provides the ability to update/reset

import u3
d = u3.U3()
d.debug = True
d.configIO(NumberOfTimersEnabled = 1)
# Sent:  [0x49, 0xf8, 0x3, 0xb, 0x42, 0x0, 0x1, 0x0, 0x41, 0x0, 0x0, 0x0]
# Response:  [0x57, 0xf8, 0x3, 0xb, 0x50, 0x0, 0x0, 0x0, 0x41, 0x0, 0xf, 0x0]
# {'NumberOfTimersEnabled': 1, 'TimerCounterPinOffset': 4, 'DAC1Enable': 0, 'FIOAnalog': 15, 'EIOAnalog': 0, 'TimerCounterConfig': 65, 'EnableCounter1': False, 'EnableCounter0': False}
d.getFeedback(u3.Timer(timer = 0, UpdateReset = False, Value = 0, Mode = None))
# Sent:  [0x26, 0xf8, 0x3, 0x0, 0x2a, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x0]
# Response:  [0xfc, 0xf8, 0x4, 0x0, 0xfe, 0x1, 0x0, 0x0, 0x0, 0x63, 0xdd, 0x4c, 0x72, 0x0]
# [1917640035]
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.