Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Delay_ms
Vdelay_ms
Delay_Cyc
105
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Specifics
mikroPASCAL PRO for AVR
CHAPTER 3
Prototype
procedure Delay_ms(time_in_ms: const longword);
Returns
Nothing.
Description
Creates a software delay in duration of time_in_ms milliseconds (a constant).
Range of applicable constants depends on the oscillator frequency.
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
Delay_ms(1000);  // One second pause 
Prototype
procedure Vdelay_ms(time_in_ms: word);
Returns
Nothing.
Description
Creates a software delay in duration of time_in_ms milliseconds (a variable).
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 pre-
sented in this topic for the sake of convenience.
Requires
Nothing.
Example
pause := 1000;
// ...
Vdelay_ms(pause);  // ~ one second pause
Prototype
procedure Delay_Cyc(Cycles_div_by_10: byte);
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 pre-
sented 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