is it possible to stack an Uno on say a Mega2560 piggy back style, have separate programs running on each of them and using outputs from one for inputs of the second one. I'm trying to run a NEMA34 stepper motor using cl86t drive. I would like to use one to strickly only operate the motor and the second to perform the math and control the first one. reason being, the pulse on time duration is from 1000 to 3000 microseconds and the off time is one to three microseconds. the Mega runs the motor well enough, but when I start adding more responsibility to it, it seems to slow things down?
It is a common beginners mistake to think of using two Arduinos to solve a problem. Most of the time one Arduino is enough if you get the program right.
Teensy LC (for Low Cost) runs at 48MHz. Maker is PJRC.com. They have faster ones, the Teensy 3.6 OC's to 240MHz. All are Arduino-compatible (can code with Arduino IDE).
Be aware that the pins are more delicate than AVR pins, don't control exactly the same if you are banging register bits instead of using the much slower Arduino digitalWrite() function.
Your wiring would need to change for 3.3V control and less current than AVR pins can give/take.