Go Down

Topic: Is Arduino code interpreted? Fez Panda .NET x ? (Read 3210 times) previous topic - next topic

WilliamK Govinda

Guys, just trying to understand one thing. Is the Arduino code interpreted?

I wonder about this, as the Arduino board I'm looking at is 16Mhz 8 bits, while Fez Panda is 72Mhz 32 bits.


BUT, Fez Panda runs .NET interpreted code, so you don't actually get 72Mhz from what I could tell, right?

I will check the list of .NET C# functions Fez Panda supports without interpretation, so I know how it will run against an Arduino Mega, for instance.

Thanks, Wk


Arduino is native code. No interpreter involved. Probably means that 72Mhz FEZ thing is more like a 1Mhz AVR if it's having to run a load of MS bloat as well ;)

WilliamK Govinda

That's what I was thinking. ;-) And it has more RAM, BUT, with .NET on the thing been interpreted, its like 1 byte...  ;D Sorry, couldn't resist.

I was just wondering about it. I don't like MS anyway. What I like about the Arduino is that its REALLY open-source, no MS BS involved...

Thanks, that's exactly what I needed to know. :cool:


WilliamK Govinda

Humm, but lets be fair, it does have native calls too, I just couldn't find a list yet...  ::)


Here's some extra info:


How does .NET Micro Framework work? Is it fast?
.NET Micro Framework is a very large set of libraries and a core CLR (interpreter).When you write an application in Visual Studio and run it, Visual Studio will transfer your code to the device and store it in a reserved region. This region of the chip is reserved for your managed application. Note that your application is only what you write, it doesn't include the NETMF libraries since they are already stored on the device via the firmware.

Lets say you write a program to read XML files. Your program will be simple. The complex work is done in FAT file system and XML libraries. Those libraries are already included in the framework (in the firmware).

Now, is it fast? Yes, it is fast depending on if you write your code right. It is a fact that managed code runs much slower than native code. Managed code runs checks at runtime, so for example when you access an array in C/C++, you can easily go over the array boundary undetected and overwrite some random memory. This is an extremely difficult bug to catch. Modern managed languages like C# check every time you access an array to see if you are within the boundaries or not. Such checks are great but they have their performance penalties. The managed application is also interpreted, which also runs slower than native code. So if you're making a function that encrypts data, it will run too slow. Why? Because all the encryption code is interpreted. This is why NETMF includes a large set of libraries to accomplish many things including cryptography, for our example. When you try to encrypt the data, you will simply be passing your data onto the internal code which is not interpreted and it runs very fast.

Someone can comment and say, I can toggle a pin faster on an 8bit micro than I can on NETMF devices! This is correct, but what kind of project only toggles a pin? Make a decently sized project and then compare speed. Try our example from earlier, read an XML file from a USB thumb drive and parse it. 8bit devices will probably not be capable of doing so and if they did it will be slower than NETMF. In short, use the built-in functions as much as you can and your project will run fast.

So, where can I get a list of those functions that runs faster?  :(



Oct 16, 2010, 09:41 pm Last Edit: Oct 16, 2010, 09:44 pm by floresta Reason: 1
Guys, just trying to understand one thing. Is the Arduino code interpreted?
It is compiled, as opposed to interpreted.  Read the first two sentences here http://en.wikipedia.org/wiki/Interpreted_language for the difference.


Leon Heller

The FEZ boards should be able to use a conventional ARM compiler, they appear to have a JTAG connector for programming and debugging.
Leon Heller

Go Up