Timer call in a microsecond

i want to call a timer in microsecond . is it possible in fez spider? send a source code

@ biren - Hi biren, a simple search on here will find all the relevant info you need…

.netmfw: http://wiki.tinyclr.com/index.php?title=SystemTimers


 void ProgramStarted()
            GT.Timer timer = new GT.Timer(100);
            timer.Tick += new GT.Timer.TickEventHandler(timer_Tick);

        void timer_Tick(GT.Timer timer)
            // do cruft here

That’s milliseconds not microseconds though, and IIRC I don’t think the ‘resolution’ of that timer is even reliably accurate to the exact number of milliseconds requested. Microseconds are one thousandth of a millisecond, or one millionth of a second - not sure how you’d be so accurate in NETMF.

@ RorschachUK - indeed and i doubt you will get anything reliable below 20 milliseconds.

Is it possible to set one of the CPU timers using RLP? Timer Interrupt Vector may be set to address of your function to call when it reachs the value you set, if it is also possible.
And your code should be finished in microseconds. If not, next interrupt fires before it is done. And your code calls continuously timer function, and stack overflows. You can disable timer when it interrupts, and re-enable after your code is done, but this makes your timing wrong. But whole native code may solve this issue. You can calculate what exact value is for timer.

I do not think that µs resolution will be possible on netmf. However coding in assembly, you are able to know precisely theruntime of a code block… may be you could have a look in this direction. The bottleneck is that your timer will not goes back on the managed side fast enough…

While FEZ is not real-time, it is possible to achieve microsecond “accuracy” under certain conditions.

What exactly are you trying to achieve?

Yes, using RLP it is possible to interact with the hardware timers. Note that the function that is called is a C function implemented in RLP, not a managed function implemented in the CLR. You could never call a managed function fast enough to respond on a microsecond scale.