User manual

Table Of Contents
152
mikoC PRO for PIC32
MikroElektronika
Prototype
void VDelay_Advanced_ms(unsigned time_in_ms, unsigned Current_Fosc_kHz);
Description Creates a software delay in duration of time_in_ms milliseconds (a variable), for a given oscillator
frequency. Generated delay is not as precise as the delay created by Delay_ms.
Parameters Time_ms: delay time in milliseconds
Current_Fosc_kHz: desiredoscillator frequency
Returns Nothing.
Requires Nothing.
Example
pause = 1000;
fosc = 10000;
VDelay_Advanced_ms(pause, fosc); // Generates approximately one second
pause, for a oscillator frequency of 10 MHz
Notes Note that VDelay_Advanced_ms is library function rather than a built-in routine; it is presented in
this topic for the sake of convenience.
Prototype
void Delay_Cyc(unsigned int x, unsigned int y);
Description Creates a delay based on MCU clock. Delay lasts for x*16384 + y MCU clock cycles.
Parameters x: NumberOfCycles divided by 16384
y: remainder of the NumberOfCycles/16384 division
Returns Nothing.
Requires Nothing.
Example
Delay_Cyc(1, 10); /* 1x16384 + 10 = 16394 cycles pause */
Notes Delay_Cyc is a library function rather than a built-in routine; it is presented in this topic for the sake
of convenience.
Prototype
void Delay_Cyc_Long(unsigned long CycNo);
Description Creates a delay based on MCU clock. Delay lasts for CycNo MCU clock cycles.
Parameters CycNo: number of cycles
Returns Nothing.
Requires Nothing.
Example
Delay_Cyc_Long(16394); // 16394 cycles pause
Notes Delay_Cyc_Long is a library function rather than a built-in routine; it is presented in this topic for
the sake of convenience.
VDelay_Advanced_ms
Delay_Cyc
Delay_Cyc_Long