User manual
mikroPascal PRO for PIC32
MikroElektronika
151
Prototype
procedure VDelay_ms(Time_ms : word);
Description Creates a software delay in duration of Time_ms milliseconds. Generated delay is not as precise as
the delay created by Delay_ms.
Parameters - Time_ms: delay time in milliseconds
Returns Nothing.
Requires Nothing.
Example
var pause : word;
...
VDelay_ms(pause); // ~ one second pause
Notes None.
VDelay_ms
Prototype
procedure VDelay_advanced_ms(time_ms, Current_Fosc_kHz: word);
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.
Note that Vdelay_ms is library function rather than a built-in routine; it is presented in this topic for
the sake of convenience.
Parameters - time_ms: delay time in milliseconds
- Current_Fosc_kHz: frequency in kHz
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 None.
VDelay_advanced_ms
Prototype
procedure Delay_Cyc(x: word; y: word);
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.
Delay_Cyc