Main Site Documentation

How fast can I read from an analong input pin?


I want to do 64 samples/second of an analog pin on a Cobra. Is this possible??


easily! you can thousands a second of you want.


Using managed code? I’m using threads and do a thread.sleep(16) and after 64 time it shows anywhere between 1-2 seconds (using timespan). Is there a profiler for .net mf?


so what else are you doing at the same time? has many more samples/sec than you’re doing.

the issue with doing a thread.sleep of a fixed interval is that this will always lead to drift. GC kicks in occasionally and changes your run-time. A particular action like file IO takes a longer time than normal, changes your run-time. For a specific interval you need to approach it differently, but if “close enough” is ok then a sleep will be reasonably ok


NETMF is NOT real-time so you will never see exact count if you are doing this in C# but you can use RLP and the reading will be perfectly real-time.

This explains how to record audio at 8000 samples/sec