User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
154
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.
Prototype
procedure Delay_Cyc_Long(CycNo : word);
Description Creates a delay based on MCU clock. Delay lasts for CycNo MCU clock cycles.
Parameters - CycNo: number of MCU cycles
Returns Nothing.
Requires Nothing.
Example
Delay_Cyc_Long(16384); // 16384 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
function Clock_kHz() : longint;
Description Returns device clock in kHz, rounded to the nearest integer.
This is an “inline” routine; the code is generated in the place of the call.
Parameters None.
Returns Device clock in kHz, rounded to the nearest integer.
Requires Nothing.
Example
clk := Clock_kHz();
Notes None.
Clock_kHz