beautypg.com

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

Page 188

background image

178

Timer/Counter Output Models

Syntax

pin

[output] stretchedtriac sync (

pin-nbr

) [clockedge (+)|(-)|(+-)]

frequency(

value

)

io-object-name

;


pin

An I/O pin. Stretched triac output can specify pins IO_0 or IO_1. If IO_0 is
specified, the sync pin can be IO_4 through IO_7. If IO_1 is specified, the

sync pin must be IO_4.

sync (

pin-nbr

)

Specifies the sync pin, which is the input trigger signal.

clockedge (+)|(-)|(+-)

(+) Causes the sync input to be positive-edge sensitive.
(-) Causes the sync input to be negative-edge sensitive. This is the default.
(+-) Causes the sync input to be both positive- and negative-edge sensitive.

frequency(

value

)

Specifies the frequency of the sync pin input. Valid values range from 40 to

70, with the most usual values’ being 50 (for 50 Hz input) or 60 (for 60 Hz
input).

io-object-name

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

Usage

unsigned short

control-value

;

io_out(

io-object-name

,

control-value

);

The io_out( ) function for a stretchedtriac I/O object uses a

control-value

parameter to specify duration of the triac trigger pulse. This 8-bit control value
allows you to stretch the triac trigger pulse to any width within the half-cycle

(between zero crossings). The control value is related to the number of clock

cycles between zero crossings, and depends on the AC frequency (50 or 60 Hz)
that the triac is controlling. Valid values are:

• 0-193 specifies an amount of stretching for 50 Hz control frequency
• 0-160 specifies an amount of stretching for 60 Hz control frequency

The 193 or 160 values represent a minimum stretching of the triac control signal

(the triac is pulsed on for the minimum time before the control signal’s zero
crossing – for example, a light is almost completely dim). A 0 value represents

maximum stretching of the triac control signal.
The io_set_terminal_count( ) function allows the application to change the
terminal count for the stretched triac I/O object at runtime. This function allows

a device to:

• Have a single application for both 50 Hz and 60 Hz power domains