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

Page 142

Advertising
background image

132 Timer/Counter

Input

Models

Changes the maximum value for each period measurement for an edgelog

device declared with the single_tc option keyword. The maximum value may
range from 1 to 65535; the default value is 65535.

Example for a Series 3100 device with a 10 MHz input clock: An edgelog input

object using clock(3) and the default maximum period yields a 1.6 μs resolution
and does not overflow until 104.86 ms elapse. Using a value of 7500 for

io_edgelog_preload( ) results in the io_in( ) function call terminating if 12 ms
elapse with no input edges.

Syntax

pin

[input] edgelog [single_tc] [mux | ded] [clock (

const-expr

)]

io-object-name

;

pin

Specifies a Neuron input pin for the edgelog input object. The input pin can

be IO_4 through IO_7 if the single_tc option is specified, otherwise the input
pin must be IO_4.

single_tc

Optionally specifies that a single timer/counter should be used. If this
keyword is not specified, two timer/counters are used. If a single

timer/counter is specified, the application can only be loaded on a device

based on a Series 3100 or Series 5000 Smart Transceiver, a Neuron 3120
Chip, or a Neuron 3150B1 Chip (or newer).

mux | ded

Specifies whether the I/O object is assigned to the multiplexed or dedicated

timer/counter. This option is only necessary with the single_tc option when

the edgelog device is declared on pin IO_4. The multiplexed timer/counter is
always used on pins IO_5 through IO_7.

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 <echelon.h>). This function overrides the

resolution value specified for clock() within the I/O object declaration.

For an application running on a Series 5000 device, you can specify an

increased resolution for the timer base clock frequency by calling the

io_set_clock() function with a clock value in the range 0..15 (using one of the
TCCLK_* macros defined in <echelon.h>). This function overrides the

resolution value specified for clock() within the I/O object declaration.
See Appendix A,

Timer/Counter Periods and Resolution

, on page 187, for a

description of the timer resolution and maximum range for each specification

of the clock() value or each value of the TCCLK_* macros. See the

Neuron C

Reference Guide

for information about the io_set_clock() function.

Advertising