Logic analyser

Hi,

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.

I need to see what's happening on the data/address lines. I do need to see the logic state of at least 8 pins.

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.

I wonder if the Due can deal with 1MHz logic signals?

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?

How about using the analog inputs on a Mega?

And divide your capture rate by many hundreds?
No, I don't think that would be a good idea.

The best you can do is to use direct port manipulation (read 6 lines at once) but even then I expect not more than somewhere around 10K signals max.

Would look like this (not tested, but to get you started)

void setup()
{
  Serial.begin(115200);
  DDRB = 0xFF;
}

void loop()
{
  Serial.print((char)PINB);
}

Maybe you should have a look at this

http://arduino.cc/forum/index.php/topic,52881.0.html

Or buy a Saleae logic, it will be the best $149 you'll ever spend.


Rob

Or buy a Saleae logic, it will be the best $149 you'll ever spend.

+1

Considering buying it! Thanks!

How about this board:

http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,892&Cat=18

It's 32 bits, 80MHz clock, 512K Flash and 32K SRAM. Besides the digital pins can endure 5V unlike the Due.