Example, Delay( ) function – Echelon Neuron C User Manual

Page 98

Advertising
background image

78

Functions

len

Specifies the length of the data buffer, 1 to 255 bytes. A

value of 0 represents 256 bytes.

Example

#include <stdlib.h>

unsigned data[SIZE];

void f(void)
{
long seed = 0x04C1;
long

crc;

crc = crc16_ccitt(seed, *data, SIZE);

}

delay( )

Function

The delay( ) function allows an application to suspend processing for a given

time. This function provides more precise timing than can be achieved with

application timers.

Table 29 lists the formulas for determining the duration of the delay.

Table 29. Delay Values for Various System Clock Rates

Series 3100

Input Clock

Series 5000

System Clock

Delay (in microseconds)

— 80

MHz

0.0375*(max(1,min(65535,count*16))*42+221)

— 40

MHz

0.075*(max(1,min(65535,count*8))*42+204)

— 20

MHz

0.15*(max(1,min(65535,count*4))*42+187)

40 MHz

0.15*(max(1,min(65535,count*4))*42+176)

— 10

MHz

0.3*(max(1,min(65535,count*2))*42+170)

20 MHz

0.3*(max(1,min(65535,count*2))*42+159)

— 5

MHz

0.6*(max(1,count)*42+139)

10 MHz

0.6*(max(1,count)*42+128)

6.5536 MHz

0.9155*((max(1,floor(count/2))*42+450)

5 MHz

1.2*((max(1,floor(count/2))*42)+155)

2.5 MHz

2.4*((max(1,floor(count/4))*42)+172)

1.25 MHz

4.8*((max(1,floor(count/8))*42)+189)

Advertising