0
\$\begingroup\$

I was looking through some of the atmel microprocessors, and I was wondering if you could use a microprocessor (say, the atsam91) as a coprocessor for a microcontroller (say, an esp32 wrover (240Mhz)), so if the microcontroller needed to do any processing-heavy arithmetic, it could simply send through the instructions to the ATSAM.

Is this possible?

And if so, how would the microcontroller send through the instructions and in what format?

\$\endgroup\$

closed as too broad by PeterJ, Voltage Spike, Finbarr, TonyM, Phil G Nov 4 at 15:23

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 7
    \$\begingroup\$ Yes it is possible, but what would be the point to use a 200 MHz SAM91 as a coprocessor for a 20MHz Arduino? Data can be transmitted via any interface both processors have, like UART, I2C or SPI over a command set of you want to use. It's just that most likely just transmitting the data back and forth takes longer than just calculating it on the SAM91 to begin with. Just use the SAM91 and throw out the Arduino. \$\endgroup\$ – Justme Oct 23 at 5:28
  • 1
    \$\begingroup\$ Generally, where dual processor systems make sense, it's actually the other way around: a program running on a "big" chip (especially one with an operating system) needs to do something with a time agility which the software stack on that lacks so the task gets delegated to a simpler chip that can focus on that alone. Not a few SoC chips used in phones and pi-like boards have what are effectively MCU's built in to help the main application processor cores. And then there are special purpose helpers like radio processors. \$\endgroup\$ – Chris Stratton Oct 23 at 5:54
  • 2
    \$\begingroup\$ Probably the closest to the situation you propose where a bigger chip takes work delegated by a smaller one is when people use an ESP8266 or embedded USB host chip (which is really an MCU) to give a simple Arduino capabilities it doesn't have. Generally the more sensible way to do such a project is, as in the first comment, to move the main program to the chip that has the capability, and remove the chip that lacks it from the project altogether. \$\endgroup\$ – Chris Stratton Oct 23 at 5:55
  • 3
    \$\begingroup\$ Fair enough and this could make sense, but please edit this and all relevant info to the question. Also what are these calculations are and how much data they need? \$\endgroup\$ – Justme Oct 23 at 6:10
  • 2
    \$\begingroup\$ This still does not really make sense. If you need calculation help, use a better computer to start with. \$\endgroup\$ – Chris Stratton Oct 23 at 15:08
1
\$\begingroup\$

"how would the microcontroller send through the instructions and in what format?" Simple way would be via serial communications. Faster way would be via SPI communications, which most Arduino would support using 8 MHz clock rate, so it's pretty quick.

If you look at an MP3 player module as an example, that is what is basically going on. The Arduino is sending the MP3 processor the commands to play this track, that track, stop, pause, etc. The MP3 processor then accesses the SD card, reads the info, does the MP3 decompression, and turns it into audio to drive speakers.

Format, that has to be worked out for the information going back and forth.

\$\endgroup\$
  • 2
    \$\begingroup\$ Much simpler way than any of that would be to only use one, better computer. There's no task yet stated that justifies having two or working out the communication and maintaining version compatibility between two. Perhaps there is a good reason, but nothing in the question yet states one. \$\endgroup\$ – Chris Stratton Oct 23 at 15:09
  • \$\begingroup\$ would the arduino send the instructions in the Assembly programming language?? \$\endgroup\$ – 3NiGMa Oct 23 at 22:03
  • \$\begingroup\$ It can send the directions in whatever format you program it to send in. Assembly seems doubtful tho, especially if you're send it commands like "multiply these two numbers and return the result. You'd probably want to send higher level language command and the data. The other processor would be running its own program to receive the command and then execute it. \$\endgroup\$ – CrossRoads Oct 26 at 22:18

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