I have made a project where I couldn’t understand why the code is executing so slow. Then I tried to made a blank project where I just put a GPIO High/Low in a while loop using .NET Framework . This is executing at only 4.65 kHz!
Why use a 120 MHz processor when it is so slowly? What is the other 119 MHz used for?
RLP is the solution for such algorithms. But if you detail what you are trying to crate we can tell you if NETMF is the right solution or not.
I have seen commercial designs where a little micro is added to handle the little but time sensitive things and then NETMF was used for the high level things, like the user interface and networking. This depends entirely on what you are making.
He is not running a ‘Real-Time’ system. This seems like a reasonable method to test how fast module runs. EDIT :- I didn’t see LARSC reply before posting. He IS trying to run a Real-Time system from NETMF. The G120 uProc does have dedicated motor control hardware peripheral but I do not know how to use it.
I tested this myself with slightly modified code and got 9KHz rather than 4.5KHz…I also measured about 33KHz when running a loop of a single integer addition or multiplication.
What I will say is that small functions like these are dominated by the interpreter overhead. More complex function such as say Bitmap.Flush() are much more comparable to the performance you would get when writing native code.
You can use RLP to boost the performance of critical code segments if you need.
The system I work with are divided into control of stepper motor, which must run in real time. The second part of the system is Bluetooth, Ethernet, GSM communication.
I do not know of RLP, it sounds useful. what is this and how is it used. Are there a thread which you can recommend.
RLP is a GHI specific way to use C code on a NETMF device.
You can create an elf file for the processor (by using yagarto tool chain.
You can then run these C functions from NETMF code.
When a RLC C function is running, the NETMF interpreter is stopped.
You can also create native C interrupts, which are as accurate as the processor allows.
These interrupts will also stop the NETMF interpreter (means all managed threads) until the ISR has exited.
BTW Yagarto seems to no longer be in development. You can download the latest version of the Tool Chain from sourceforge YAGARTO download | SourceForge.net
emIDE looks good and much nicer than YAGARTO, but im not sure how to configure it to generate ELF files for RLP. Has anyone used this yet? Maybe someone could submit an example emIDE solution to codeshare?