UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
4,411 Views
Registered: ‎10-24-2011

xupv5-lx110t short delay function

Jump to solution

i write a short delay function in microblaze using c code,but it doesn't work ,I don't know why,below is my delay function

void Dly_ms(int ms)
{
   int ii,jj;
   if (ms<1) ms=1;
   for(ii=0;ii<ms;ii++)
   for(jj=0;jj<13352;jj++);    //busclk:80MHz--1ms
}

there is no difference between ms=10 and ms=10000,why?who can help me .or give me another way to insert a short time delay

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
5,912 Views
Registered: ‎01-03-2008

Re: xupv5-lx110t short delay function

Jump to solution

Most compilers will see this code as NOOP and optimize it complete out to save memory and improve speed.  Some compilers have options to not do this optimization, but you really should be using a timer function for this behavior.

 

Also, there are dedicated Embedded Processing forums here and you should post any follow ups in the correct forum for the best audience.

------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
5,913 Views
Registered: ‎01-03-2008

Re: xupv5-lx110t short delay function

Jump to solution

Most compilers will see this code as NOOP and optimize it complete out to save memory and improve speed.  Some compilers have options to not do this optimization, but you really should be using a timer function for this behavior.

 

Also, there are dedicated Embedded Processing forums here and you should post any follow ups in the correct forum for the best audience.

------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
Adventurer
Adventurer
4,400 Views
Registered: ‎10-24-2011

Re: xupv5-lx110t short delay function

Jump to solution

Thank you.I see.and also you advice

0 Kudos