But what is the maximum sampling the modern MCU can handle? Like can it handle 500,000 Hz Or is there a limit like 250,000 Hz sampling.
My current favourite,
Teensy 4.0, can do
1,000,000 samples/sec continuously writing them to an SD card (in binary form); 2,500,000 samples/sec when interleaving the two ADCs. Although the ADCs have nominally 12 bit precision, only 10 bits or so are noise-free on this board.
Teensy 4 also have a (actually two) native USB 2.0 High Speed (480 Mbit/s) interface, that I've verified can do well over 200,000,000 bits/sec (25 Mbytes/sec) in one direction.
Then again, it is an NXP i.MX RT1062 running at 600 MHz. Costs only $24, though, and comes with Teensyduino, an Arduino add-on for programming it in the Arduino environment.
Obviously, the exact capabilities vary from MCU to MCU. Some have only one ADC, some have several (in which case they can often be interleaved, so that one takes a sample while the other is still in the process of conversion), possibly multiplying the maximum sample rate (even from a single source signal).
Teensy LC (NXP MKL26Z64VFT4, ~ $13 but no stock right now, USB Full Speed 12 Mbit/s) runs at 48 MHz, and has a single 16-bit ADC (about 12-13 effective bits), but I haven't checked the maximum sample rate on it (but see
pedvide's ADC library). I'd
expect it to be somewhere between 100,000 and 400,000 samples per second (using HIGH_SPEED and ADACK_6_2), though, if that helps.
In general, I do like microcontrollers with native USB interfaces, because of the increased bandwidth – even USB 1.1 Full Speed (12 Mbit/s) on 8-bit AVRs like ATmega32U4 can do over a million bytes per second over USB Serial – and implementation options: if you want a custom keyboard/mouse/joystick, you don't even need any OS drivers at all, just program the microcontroller USB endpoints, connect the buttons/sensors/etc., and It Just Works.
(I have looked at various data acquisition ADCs that have very nice properties, so you definitely do not
have to use the
internal ADC on the MCU. A SPI bus running at a few MHz, over digital isolators like Si866x, and a small isolated DC-DC controller followed by some serious smoothing and a linear regulator, and you can have a fully isolated analog sensor frontend. I'd love to have one of those, myself, just for fun.)
As I've mentioned before in other threads here, the aforementioned Teensies are excellent for hobbyist and development tests, but not that suitable for basing your commercial products on. Definitely good for one-off projects; they're well designed, and the
forum is friendly and knowledgeable, and the developer (Paul Stoffregen of PJRC) participates there a lot. Only the bootloader (which you can buy separately in a pre-programmed chip) and the exact board files are proprietary.
For hobbyist and one-off purposes, I know for a fact that it is a good fit for interfacing to various kinds of sensors (Teensy 4.1 if collecting data to an SD card) and displays and such, because that's what I typically use them for. But I am only a hobbyist, not an EE, and do not develop any products; just gadgets I or my friends or colleagues need for a project or another. Stuff like Pt100 temperature sensors, high-frequency current monitoring for SBC current draw (to see short spikes, since they often do not have much (enough) capacitance on their main voltage buses), OLED and IPS TFT display modules, buttons and joysticks, and such.