Scaled_delay( ) function, Syntax, Example – Echelon Neuron C User Manual
Page 150
130
Functions
}
scaled_delay( )
Function
The scaled_delay( ) function generates a delay that scales with the input clock for
the Neuron Chip or the Smart Transceiver.
The formula for determining the duration of the delay is the following:
delay
= (25.2 *
count
+ 7.2) *
S
(
delay
is in microseconds)
In the formula above, the scaling factor
S
is determined by the input clock, as
shown in Table 31.
Table 31. 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
—
See also the delay( ) and msec_delay( ) functions. The delay( ) function generates
a delay that is not scaled and is only minimally dependent on the input clock.
The msec_delay( ) function provides a scaled delay of up to 255 milliseconds.
Syntax
void scaled_delay (unsigned long
count
);
count
A delay value between 1 and 33333. The formula for
determining the duration of the delay is based on count
and the Neuron input clock (see above).
Example
IO_2 output bit software_one_shot;