this is my first post!
The ability to program in C# / NETMF recently drew my attention. The project I am prototyping now does nothing really fancy: move some stepper motors, readout some sensors, etc. All certainly easilly doable in NETMF and any of the GHI boards.
But, there one time critical operation I am worried about:
I need to trigger a camera, varying it’s shutter time on every frame. For this, the camera supports a so called “level trigger mode”. On rising edge exposure starts, on falling edge it stops, so the width of the pulse is the shutter time.
For my application shutter times will probably vary between 100uSec to 8ms. For the shortest shutter of 100uSec, being off by 1uSec is acceptable, but 5uSec (5%) would already be too noticeable.
I’ve digger though all docs I could find and figured the following options:
The OutputCompare class, with it’s new SetBlocking method. I’ve read the blocking function is more accurate. But how accurate? Down to one uSec?
Code it in RLP directly. I’ve found a post here saying that flipping a GPIO on/off through RLP takes about 1,25uSec. That is good. I combine that with RLPext.delay(uSec). But then, what is the accuracy of RLPext.delay? Is it down to the uSec?
Though flipping a GPIO is much faster with RLP, I guess the 1,25uSec are attributed to the time of the function calls. Can’t that be done much faster by just setting some register value directly? Is this doable?
Also: I’ve already found about the RLPext.delay() function. But I see no way to get the processors “tick count” in RLP. Shouldn’t that be available to RLP?
Use the PWM unit. Unfortunately I saw no way to generate a single pulse, I didn’t even find a method to turn the PWM unit completely off, to reconfigure it and re enable it when the camera is ready for the next exposure.
Can that be done? I’m hoping it must not be done though disposing the object - it sounds like a bad idea to create and dispose maybe around a hundred “PWM” objects per second.
Also: I’m not sure the PWM can be configured at the needed time spans of say 100uSec to 8ms.
So, I’d love to hear some thought’s from you guys.
I did not order a board yet. I’m eying a FEZ Cobra (currently out of stock), mainly because the board already has all I need or plan to play with (Ethernet, Serial, CAN). If needed, I could go with the ChipworkX.
PS: I had already almost given up NETMF after reading about it’s non RT nature, thread scheduling of 20ms, etc. It’s good that I looked more closely at the GHI docs and found about RLP.
@ GHI guys: I think you should explain the RLP feature more prominently on your website(s). This is in my eyes a very important feature that greatly expands the usability of your products.