Datasheet
Delay_Cyc
Clock_kHz
Clock_MHz
109
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Specifics
mikroC PRO for AVR
CHAPTER 3
Prototype
void Delay_Cyc(char Cycles_div_by_10);
Returns Nothing.
Description
Creates a delay based on MCU clock. Delay lasts for 10 times the input param-
eter in MCU cycles.
Note that Delay_Cyc is library function rather than a built-in routine; it is present-
ed in this topic for the sake of convenience. There are limitations for
Cycles_div_by_10 value. Value Cycles_div_by_10 must be between 2 and 257
Requires Nothing.
Example
Delay_Cyc(10); /* Hundred MCU cycles pause */
Prototype
unsigned Clock_kHz(void);
Returns Device clock in kHz, rounded to the nearest integer.
Description
Function returns device clock in kHz, rounded to the nearest integer.
This is an “inline” routine; code is generated in the place of the call, so the call
doesn’t count against the nested call limit.
Requires Nothing.
Example
clk = Clock_kHz();
Prototype
unsigned short Clock_MHz(void);
Returns Device clock in MHz, rounded to the nearest integer.
Description
Function returns device clock in MHz, rounded to the nearest integer.
This is an “inline” routine; code is generated in the place of the call, so the call
doesn’t count against the nested call limit.
Requires Nothing.
Example
clk = Clock_MHz();