Go Down

Topic: Logic analyser (Read 1 time) previous topic - next topic

alkopop79

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?

Frisky

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.


alkopop79

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.

AWOL

Quote
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

alkopop79

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

AWOL

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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

alkopop79

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?

AWOL

Quote
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart

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.
- http://www.arduino.cc/en/Reference/PortManipulation -

Would look like this (not tested, but to get you started)
Code: [Select]
void setup()
{
  Serial.begin(115200);
  DDRB = 0xFF;
}

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




Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Graynomad

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
Rob Gray aka the GRAYnomad www.robgray.com

robtillaart

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

+1
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

alkopop79

Considering buying it! Thanks!

alkopop79

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.

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview