The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Submitted by Joe on Tue, 03/22/2011 - 20:35
I need a 1 microsec output pulse on a GPIO out pin. I will need to set the pin low, delay 1 microsec, then set it high. I know there is a NOP instruction which takes 1 tick. How to I use that?
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).
Unable to find an attachment - read this blog
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…