Jump to content
Sign in to follow this  
VisSim Forum Archives

How can I delay for 1 microsec on my F2808? I need a 1 microsec pulse on a GPIO out.

Recommended Posts

Submitted by Anders89 on Tue, 03/22/2011 - 20:43.

 

You can use the externFunction block to create a small delay loop by putting the following C loop into it:

  { int a; for (a=0;a<10;a++) asm("NOP");}

Note that though the chip clock is 100 MHz, the loop count is only to 10. That is because one loop iteration takes 10 ticks due to an 8 tick pipeline stall + 1 tick NOP + 1 tick inc/compare loop counter.
Then write a 0 to the GPIO above the NOP delay, and write a 1 to the GPIO below it. VisSim generates code for parallel flows in top down order, so you will get a 1 microsec low pulse.

See attached diagram below (you must be logged in to see it).

gpio1msec.vsm

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...