beautypg.com

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

Page 180

background image

170

Timer/Counter Output Models

Programming Considerations

The output_value determines the number of pulses output. When this I/O model

is used, the io_out( ) function call does not return until all pulses have been
produced. This process ties up the application processor for the duration of the

pulsecount.
For pulsecount output, the data type of the output value for the io_out( ) function
is an unsigned long. An output value of 0 forces the output signal to its normal

state.

Syntax

pin

output pulsecount [invert] [clock (

const

-

expr

)]

io

-

object

-

name

[=

initial-output-level

];

pin

Specifies either pin IO_0 (using the multiplexed timer/counter) or IO_1 (using

the dedicated timer/counter).

invert

Causes the signal to be inverted, normally high with low pulses. By default,

the signal is normally low with high pulses.

clock (

const-

expr)

Specifies a clock in the range 1 to 7, where 1 is the fastest clock and 7 is the

slowest clock. The default clock for pulsecount output is clock 7. The
io_set_clock( ) function can be used to change the clock.
Specifying clock 0 for the io_set_clock( ) function results in an unspecified

number of counts, because 0 is not a valid clock for pulsecount output.

See Appendix A,

Timer/Counter Periods and Resolution

, on page 187, for a

description of how the io_set_clock( ) function affects the resolution and range
of certain timer/counter I/O models.

io-object-name

A user-specified name for the I/O object, in the ANSI C format for variable
identifiers.

initial-output-level

A constant expression, in ANSI C format for initializers, used to set the state
of the output pin of the I/O object at initialization. The initial state can be 0

or 1. The default is 0.

Usage

unsigned long

output-value

;

io_out(

io-object-name

,

output-value

);