London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« on: February 03, 2013, 12:03:58 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Chicago
Offline
Jr. Member
Karma: 0
Posts: 98
Arduino rocks
|
 |
« Reply #1 on: February 03, 2013, 12:26:53 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #2 on: February 03, 2013, 12:35:59 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19018
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: February 03, 2013, 02:41:53 pm » |
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.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #4 on: February 03, 2013, 02:45:37 pm » |
I wonder if the Due can deal with 1MHz logic signals?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19018
I don't think you connected the grounds, Dave.
|
 |
« Reply #5 on: February 03, 2013, 02:49:02 pm » |
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.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #6 on: February 03, 2013, 02:53:33 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19018
I don't think you connected the grounds, Dave.
|
 |
« Reply #7 on: February 03, 2013, 03:01:28 pm » |
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.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #8 on: February 03, 2013, 03:37:47 pm » |
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) void setup() { Serial.begin(115200); DDRB = 0xFF; }
void loop() { Serial.print((char)PINB); }
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Online
Tesla Member
Karma: 71
Posts: 6815
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #9 on: February 03, 2013, 06:36:17 pm » |
Maybe you should have a look at this http://arduino.cc/forum/index.php/topic,52881.0.htmlOr buy a Saleae logic, it will be the best $149 you'll ever spend. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #10 on: February 04, 2013, 12:37:04 pm » |
Or buy a Saleae logic, it will be the best $149 you'll ever spend. +1
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Full Member
Karma: 0
Posts: 192
Yes, we can (solder)!
|
 |
« Reply #11 on: February 04, 2013, 01:05:11 pm » |
Considering buying it! Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
|
|
|