User manual

153
mikoBasic PRO for PIC32
MikroElektronika
Prototype
sub procedure Delay_Cyc(dim x, y as 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.
Prototype
sub procedure Delay_Cyc_Long(dim CycNo as word)
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.
Delay_Cyc
Delay_Cyc_Long
Prototype
sub procedure VDelay_advanced_ms(dim time_ms, Current_Fosc_kHz as 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: 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 None.
VDelay_Advanced_ms