Posted by Speedy Builder5 on 06/10/2021 16:29:36:
…
…
Basically I have a pair of Arduinos, one which controls the stepper motor and the other for the display. The advice I was given was that a single processor didn't have the speed to doo both tasks.
…
Though it complicates the wiring, using a second Arduino to drive the display is a good idea.
The problem is the display rather than the microcontroller, because the Arduino 'blocks', ie stops and waits until the display gets its act together and does it's stuff. LCD displays in I2C mode are slowest, 4-wire much better, and 8-wire parallel the quickest but they're all slow compared with writing to USB or a serial comms connection. It makes sense to have one Arduino blast data to another, and have the second Arduino sort out the display.
A while ago Duncan Webster and I collaborated on a Dynamometer project and looked into improving Arduino performance in some depth. On the dynamometer, display delays limit the maximum RPM that can be measured and/or accuracy. (Be nice to measure RPM with more than one pulse per revolution.)
Our cure was to stream the data to a PC over USB for off-line analysis, and to send edited highlights only to the onboard display. This approach isn't OK for all applications.
USB/Serial can cause trouble too. If USB speed is important, it pays to choose between the various Arduino boards. For example Uno USB is relatively slow and primitive, whilst a Mega is smart and faster.
I've recently been experimenting with the new Raspberry Pi Pico, a £4 board with two fast CPU's on the same chip. Each is about ten times faster than an Arduino Nano. In theory, I ought to be able maximise throughput by collecting data on one CPU whilst the other manages the slow display. In practice, using two CPUs is slower than one! Ho hum, something is wrong… At least Speedy's circuit works!
Dave