Delay Command Down To Nano Seconds

Post your requests and ideas on the future development of mikroC PRO for PIC.
Post Reply
Author
Message
loedown
Posts: 1
Joined: 20 May 2018 01:00

Delay Command Down To Nano Seconds

#1 Post by loedown » 20 May 2018 01:05

All in the title, can the command be added thank you?

User avatar
marko.stankovic
mikroElektronika team
Posts: 108
Joined: 18 Dec 2017 15:44

Re: Delay Command Down To Nano Seconds

#2 Post by marko.stankovic » 22 May 2018 07:55

Hi,

You can use the Delay_Cyc command

Code: Select all

void Delay_Cyc(char Cycles_div_by_10);
Creates a delay based on MCU clock. Delay lasts for 10 times the input parameter in MCU cycles.
Note that Delay_Cyc is library function rather than a built-in routine; it is presented 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 3 and 255.

For example, if your MCU clock is 100MHz, one clock cycle is 10ns.

Code: Select all

Delay_Cyc(1);  /* Delay of 100ns */
Best regards,
Marko Stankovic.

Post Reply

Return to “mikroC PRO for PIC Wish List”