beautypg.com

Programming considerations, Syntax – Echelon I/O Model Reference for Smart Transceivers and Neuron Chips User Manual

Page 150

background image

140 Timer/Counter

Input

Models

Symbol

Description

Typical at 10 MHz

Note: If the measurement is new, t

ret

= 52 μs. If a new time is not being

returned, t

ret

= 22 μs.

Programming Considerations

For ontime input, the data type of the return value for the io_in( ) function is an
unsigned long.
The state of the input pin is latched in hardware every 50 ns for a Series 3100

device with a 40 MHz input clock, or every 12.5 ns for a Series 5000 device with
an 80 MHz system clock (the value scales inversely with clock speed). If no edges

occur during the measuring period, an overflow condition occurs. The next call to
the io_in( ) function after the overflow occurs returns the out-of-range value

(0xFFFF). The io_update_occurs event is not asserted as TRUE unless the

program uses the io_preserve_input( ) function after the io_select( ) when using
the multiplexed timer/counter, or in the reset task when using the dedicated

timer/counter.

Syntax

pin

[input] ontime [mux | ded] [invert] [clock (

const-expr

)]

io-object-name

;

pin

An I/O pin. Ontime input can specify one of pins IO_4 through IO_7 as the
input pin.

mux | ded

Specifies whether the I/O object is assigned to the multiplexed or dedicated
timer/counter. This keyword is used only when pin IO_4 is used as the input

pin.

The mux keyword assigns the I/O object to the multiplexed timer/counter.

The ded keyword assigns the I/O object to the dedicated timer/counter. The

multiplexed timer/counter is always used for pins IO_5 through IO_7.

invert

Causes the measurement of the low period of the input signal. By default,

measurement occurs on the high period of the input signal.

clock (

const-expr

)

Specifies a clock in the range 0 to 7, where 0 represents the fastest clock and

7 represents the slowest clock. The default value is clock 0.

You can change resolution for the timer base clock frequency by calling the

io_set_clock( ) function with a clock value in the range 0..7 (using one of the

TCCLK_* macros defined in ). This function overrides the
resolution value specified for clock() within the I/O object declaration.