0

It seems in certain applications, for example signal processing, Arduino and other micro-controllers in general run into the overflow error when they're trying to store even moderate amounts of data. It would seem the obvious answer would be to simply take this data, push it onto the computer, and deal with it there instead, where you have much more available computing power. Is this possible with Arduino, or am I missing something that makes it not feasible?

4
  • 1
    You're missing a reasonable definition of "push". – Ignacio Vazquez-Abrams Jun 1 '16 at 0:26
  • 1
    Sure, if you have a better computer at hand, and a communication channel that can keep up with the data rate, it can indeed be a good idea to hand it off unprocessed. Or processed just enough to reduce the data rate to what the communication channel can handle. – Chris Stratton Jun 1 '16 at 1:00
  • In theory yes. In practice, depends on your requirements and implementation. – Paul Jun 1 '16 at 10:46
  • A good example video: youtube.com/watch?v=ruuxn2u3yao (he's using an Teensy LC rather than an Arduino, but yeah, it's a microcontroller). – Paul Jun 1 '16 at 13:52
1

One of the "features" of most microcontrollers/microprocessors is that they don't have a whole heap of RAM - this keeps costs down, and lets the manufacturers keep everything on one chip (unlike your PC).

However to "push" data to somewhere that can process it, you need to have a fast communications channel. SPI is quite fast, but you don't generally talk to PCs using SPI. Serial communication is slower, but if it gets converted into a USB interface (such as on a Uno) you can get respectable speeds talking to a PC. Something like 115200 baud is usually reliable, which lets you transmit 11520 bytes per second.

However it depends on what you want to send (ie. how many bytes), how you are going to indicate where one piece of data ends and the next one starts, maybe allow for error detection or correction, and so on.

Say, for example, it takes 5 bytes to send one piece of data (eg. 4 digits plus a delimiter). Now you are down to 11520/5 = 2304 pieces of data per second.

This may or may not be adequate for whatever-it-is you are trying to do.

4
  • I'm wondering if the Arduino's with built-in USB (Atmega32u4?) would be faster than "Uart". Polulu claims: Native full-speed USB (12 Mbps), which is quite fast. – Paul Jun 1 '16 at 10:50
  • Possibly, although I got my Uno to run the ASCII table sketch at 230400 baud. That's only 43.4 µs per byte, and you would probably have trouble acquiring data much faster than that. For example, anything requiring an analog read at default speed takes 104 µs. – Nick Gammon Jun 1 '16 at 21:24
  • Cool, if you do ADC with interrupts, you could send the value while waiting for the other to complete :) – Paul Jun 2 '16 at 4:32
  • 1
    That's right, so you won't take 104 + 43.4 µs. However you still have the limitation of the overall time. You can, though, run the ADC clock faster and still get acceptable results. – Nick Gammon Jun 2 '16 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.