Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    That's "mHz" (small m) -- millihertz, not megahertz. Commented Mar 24, 2015 at 16:49
  • Oops. Well, the 50 kHz limit still applies. He didn't specify his needed precision, but one degree precision would limit you to 2.7 kHz. Commented Mar 24, 2015 at 18:12
  • I think you can at least get a lot closer with the Due as in my answer, although I'm not sure if 50kHz is reachable. Using a 42MHz timebase gives just barely enough resolution, and 20us per cycle is just enough to get some calculation done. The most obvious problem is that the serial can't possibly send 50,000 reports per second, so there would have to be some aggregation/decimation there! Commented Mar 24, 2015 at 20:13
  • Good point, @hobbs. I should be more explicit that my limit is referring to the OP's code that uses the micros() function to do the timing. Using the timer directly can get you better resolution. Commented Mar 24, 2015 at 20:56