just to add: when doing a simple framecounter i get around 1200 updates per second on the mini, and ~8000 on the stm32 versions
- but thats without any other code running
Opps, sorry, I should have added that for an ATmega328 (Arduino Nano), you'd want to use one of the internal counters. You'd poll the counter at some interval, get the result, and then forward the result. I would also do at least some sort of simple averaging (like the last four or eight samples). I'm assuming that for the light application, a response time of 1/10 to 1 second would be fine.
If very a very fast response time is needed below ~1/10th to 1/100th of a second, then all of the delays (including something like a UART transmit delay), would need to be considered.
And, again, the .NET micro framework isn't meant to be a speed demon. IMHO, .NET Micro does what it was meant to do, and it does it surprisingly well.
Atmel App Note: AVR205: Frequency Measurement Made Easy with Atmel tinyAVR and Atmel megaAVR
http://www.atmel.com...ges/doc8365.pdf
ATmega328 doc:
http://www.atmel.com...ges/doc8161.pdf
IMHO, if you want something with a very fast response time, then use an FPGA. I've done countless counters/timers/etc in FPGAs. And, with an FPGA, you can respond to within a cycle to any change. Plus, tons of options for filtering and error checking.
That's another reason I like/love C#, it's similar to Verilog for FPGA. So, I can switch between Verilog, C# for Windows, C# for a Micro, and keep my syntax and style "similar". IMHO, before, doing hardware and doing "C with MFC" or VB6 was a PITA.
BTW: My C program, written with MFC back in the mid 90's works great without any problems on Win8. Yea, it was pretty "simple". Regardless, it still works. Mainly because I used the basic MFC stuff and kept it simple.
Hence, one of the great things about using .NET - portability! In 5+ years, when a faster, better ARM and Netduino are available, it will be simple/trivial to port any user code.