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

Page 173

Advertising
background image

I/O Model Reference

163

Programming Considerations

The frequency of the square wave output is controlled by the

clock-expr

setting

and by the unsigned long

output-frequency

value passed to the io_out( ) function.

The pattern of this modulation frequency is controlled by an array of unsigned

long timing values, also passed to the io_out( ) function:

• The first value in this array controls the length of the first burst of

modulation frequency signal output—the output is active for this period.

• The second value in this array controls the length of an absence of the

modulation frequency signal—the output is idle for this period.

This pattern is then repeated by subsequent values in the array to produce a

sequence of frequency output bursts separated by idle periods. This array is

similar to the array generated by the edgelog input model.

The values in the

timing-table

array control the on and off time of the modulation

frequency output. This timing also is a product of the Neuron input clock, and is:

On/off period (μs) = (25.2 * value + 29.4) *

S

In the formula above, the scaling factor

S

is determined by the input clock, as

shown in Table 60.

Table 60. Determining S

S

Input Clock Rate
(Series 3100)

System Clock Rate
(Series 5000)

0.063 —

80

MHz

0.125 —

40

MHz

0.25

40 MHz

20 MHz

0.5

20 MHz

10 MHz

1

10 MHz

5 MHz

1.5259 6.5536

MHz

2 5

MHz

4 2.5

MHz

8 1.25

MHz

16 625

kHz

The square wave output state is always toggled, between idle (off) and active (on),

at the end of the io_out( ) function. Typically, the number of elements in the

timing-table

should always be an odd number, which will result in the output

being toggled to idle (turned off) at the end of the io_out( ) function. The last

Advertising