Page 1 of 1

Creating 1uS delay

Posted: Sat Feb 18, 2012 4:45 am
by Ron
Hi,

I want to create a 1uS delay while running at 19.6608MHz.

I know I how to use delay_10us(1); and I think there is delay_100us(1);.

I do not think there is a 1us delay function.

How do I calculate how long an instruction takes to execute?

I imagine NOP can be used so please start with this.

How many NOP statements are required for 1us delay?

Can you provide example with different commands that take up different number of clock cycles please.

How/where can I find out how many cycles each command takes?


Thank you,

Ron

Re: Creating 1uS delay

Posted: Sat Feb 18, 2012 12:00 pm
by medelec35
Hi Ron,
You can try

Code: Select all

delay_us(1);
Martin