Best way to exercise inputs of a logic circuit for analysis by a logic analyzer - Page 1
Forum section: electronics / beginners

author: JoeN
author_rank: Frequent Contributor
timestamp: March 18, 2017, 06:30:13 am
content: Instead of hooking my logic analyzer up to a microcontroller project, in this case I want to look at the outputs of a network of logic circuits and not have to slap a microcontroller on it. I need to exercise the inputs of the logic network. I understand the tool to do this is called a digital pattern generator. What's a cheap decent one, if one exists?It occurs to me that you could get a cheap out out of an ATMega328P and control it via terminal over TX/RX and have 20 digital outputs. The only problem is that those IO pins are spread over 3 ports. Is there a way to update 3 ports on the ATMega328P at once? I don't recall a way to do that. I guess if you were going to roll your own, a very cheap 32 bit uC would work well here, you could updated 32 IOs at the same moment due to 32 bit wide ports.Thanks.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: March 18, 2017, 07:18:10 am
content: If you use shift registers with a latch (595) it would be pretty much exactly simultaneous.So a small micro with UART (or USB) and a couple of pins to drive the shift regs is all you need.And you can make it as big as you want - just cascade more shift regs one after the other.

author: Nusa
author_rank: Super Contributor
timestamp: March 18, 2017, 07:22:54 am
content: Perfect application for a shift register such as the 74HC595. Daisy chain them for the required number of bits, shift in the next test pattern serially, then transfer the entire pattern to the storage register at once.

author: JoeN
author_rank: Frequent Contributor
timestamp: March 18, 2017, 07:25:41 am
content: I had given that some thought (as a way around the multi-port update issue, but not as a simple solution with a serial cable), my only concern is I would like to test it at speed. Serial cable into a shift register, can we just call that a DC test as a close approximation?If you don't mind slow, that is certainly the low cost way and I have all the parts, so thanks for that idea.I not only want a quick way to know if all the output patterns are correct, but it would be nice to see how fast this network runs before it craps out and I expect it will run at 10mhz just fine.

author: jeroen79
author_rank: Frequent Contributor
timestamp: March 18, 2017, 08:03:33 am
content: Define 'at speed'.

author: 2N3055
author_rank: Super Contributor
timestamp: March 18, 2017, 08:06:23 am
content: Average clock rate for 74HC595 is in a range of 25MHz.. You can easily transfer data serialy to it at 5-10MBit speed..If you combine 8 uC outputs with 595, that's 5-10 MBytes per second.. Hardly slow..

author: Nusa
author_rank: Super Contributor
timestamp: March 18, 2017, 09:02:58 am
content: Or if you want to go back to your original 3 8-bit arduino ports idea, you just need an octal latch for each port.

author: Brumby
author_rank: Unknown
timestamp: March 18, 2017, 09:07:01 am
content: Quote from: jeroen79 on March 18, 2017, 08:03:33 amYes. This ^^^^^^^

author: JoeN
author_rank: Frequent Contributor
timestamp: March 18, 2017, 09:08:07 am
content: Quote from: Nusa on March 18, 2017, 09:02:58 amThat's a good idea. Thanks. That would be reasonably fast and possible to get working very quickly. To go faster would require a dedicated instrument which there appears not to be no cheap options (Saleae should add this on...) or something based on an FPGA. It might not be too hard to get something working with a Max 10, but I am not nearly as good with FPGAs as I am with getting at ATMega328P working on a board with some support ICs.

author: JoeN
author_rank: Frequent Contributor
timestamp: March 18, 2017, 09:11:12 am
content: Quote from: Brumby on March 18, 2017, 09:07:01 amFaster than a USB-to-serial cable driving a shift register. At least 10mhz, preferably. That is not going to work with an 8-bit micro but it might be able to be done with the latest 32 bit M7 micros that go 300Mhz, for example, and certainly can be done with an Altera Max 10. The difficulty just goes up for each one of these. Writing code in Atmel Studio for the 328P is something I know how to do pretty well now and I can get the ports to run about as fast as possible.Note: I am measuring speed at the output clock plus the ability to generate a new bit pattern every clock. So I am thinking in cycles per second, not specifically bits per second or bytes per second. I haven't locked down the width just yet but if I use a micro, more width will lower speed in using more ports and having to latch it in.

author: rstofer
author_rank: Super Contributor
timestamp: March 18, 2017, 04:49:11 pm
content: A CPLD or FPGA can generate anything you want and as wide as you can afford.If 16 channels at 100 MS/s is adequate, the new Digilent DigitalDiscovery might be one way to go.http://store.digilentinc.com/digital-discovery-portable-logic-analyzer-and-digital-pattern-generator/The older Analog Discovery can do the same thing...http://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/Here is a CPLD that's pretty cheap:http://store.digilentinc.com/cmod-breadboardable-coolrunner-ii-cpld-module/It needs an external 3.3V power source and it needs a JTAG programming cable:http://store.digilentinc.com/jtag-hs2-programming-cable/

author: JoeN
author_rank: Frequent Contributor
timestamp: March 18, 2017, 05:12:01 pm
content: Quote from: rstofer on March 18, 2017, 04:49:11 pmThanks, that answers my primary question which was if there was a relatively cheap commercial digital pattern generator out there, even if it was an eBay special by some Chinese seller. I am putting this down as a yes, looks like a decent one too. I searched on "digital pattern generator" before I even made this thread and this product was not on the first three pages. I am kicking myself, I know about this product, I just forgot that pattern generation was one of the features.I am well set on the CPLD front. I have MAX II 240 and 1270s, a few MAX 5's and even two MAX 10's in my kit right now, as well as some XC9572s. I have a Xilinx cable from Digilent and a clone adapter for Altera from some Chinese seller, but it works fine.