gillham / logic_analyzer

Implementation of a SUMP compatible logic analyzer for the Arduino
Other
458 stars 99 forks source link

increasing number of channels #11

Closed rick2047 closed 11 years ago

rick2047 commented 11 years ago

Sorry if this makes no sense, but wouldn't it be better to have a whole byte representable on the logic analyzer i.e. 8 channels. Is there a way to increase the channel count?

gillham commented 11 years ago

You can have 8 channels on a Mega, but there is no port on the normal Arduino that has all 8 pins available. Port B has the crystal on PB6 & PB7 so 6 is the maximum. PB5 is digital pin 13 or the LED, so I have that disabled by default, but you can enable it if you want 6 channels.

PC6 is the reset pin and there is no PC7, so Port C is out. PD0 & PD1 are the serial port, so Port D is also impractical. Check out the pin / port mapping and you'll see what I mean. http://arduino.cc/en/Hacking/PinMapping168

A custom board can be used of course and you could move to a software serial port on different pins and use port D for 8 channels. It would mean the Arduino IDE wouldn't be as easy to use with your board, but if you wanted it to just run AGLA it wouldn't be a big deal. In fact you could fire up the bare minimum Atmega328 connected to a USB<->TTL board and skip a boot loader, just burn the sketch straight in and use software serial on port B or C. If you try it, let me know.

If you wanted a much lower sample rate and sample size, you could sample two ports at once (more or less "at once") and perhaps have 12 channels.

I decided 5 or 6 channels at 1MHz was much better and anyone that needs more can go with a Mega, or just get a real logic analyzer. The Open Bench Logic Sniffer ( http://www.seeedstudio.com/depot/open-workbench-logic-sniffer-p-612.html?cPath=174 and http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer ) for $50 is a far superior way to go if you really need a logic analyzer. My code is a convenience when you already have an available Arduino and want something quick & easy.