I've been trying to use Arduino to build a logic scope to debug an 8-bit computer I built. I need at least 8 channels and capture logic signals at 1MHz. I've tried most of the Arduino-based logic scope/oscilloscope sketches and none of them seem to work. So I decided to write a sketch from the scratch (rhyme!). It seems obvious to use a digitalRead function and pass on the readings to the Serial.println. On the recipient side I use Max MSP to visualise the incoming data. Yet I'm not entirely sure if it works. Do I need to set the ADC resolution from 8-bit to a higher value? What is the recommended Baud-rate? Any ideas or experience?
Do you need to capture pin state on the 8 channels? I have a logic analyzer but never use it to show glitch. Ive only use to to record pin state and debug the 68hc11 and 8048 8051 series mpu.
It seems obvious to use a digitalRead function and pass on the readings to the Serial.println.
It isn't obvious at all.
The digitalRead function on a 16MHz Arduino will never get close to 1MHz, and neither will printing the results via a Serial print.
Use port manipulation (i.e. make sure all the analyser pins are on same port) and read them to a memory buffer, not a serial print.
With it's larger memory, I'd say it would be ideal.
Make sure you use level convertors though (could be simple voltage dividers), unless you're operating at the same supply voltages.
Hm, that's the thing, my singleboard operates at 5 volts which could fry the Due in no time. What you recommended seems viable, it's not that hard to build voltage dividers (and maybe use resistor arrays to save space). How about using the analog inputs on a Mega? Would the Mega work?