Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Build logic analyzer

Status
Not open for further replies.

patroclus

New Member
is it possible to build a simple logic analyzer for up to 8Mhz resolution using Parallel port or USB ??

EPP supports that high rate??

Thanks
 
patroclus said:
is it possible to build a simple logic analyzer for up to 8Mhz resolution using Parallel port or USB ??

EPP supports that high rate??

Thanks

Simple answer I think is yes it is possible. But I would not try and directly send your data into a parallel port even if EPP supports the rate. I think you will find problems getting your signals to have the proper timing. Instead, one channel might be something like:

1) some input protection on front end.
2) digital buffer that takes a sample at 8MHz or whatever rate
3) this sample is stored in a FIFO (large enough to handle data flow with software & EPP port)
4) A usb controller connected to a uC or PIC that properly handles data flow from FIFO to USB controller/port.
5) simple USB driver to access the data
6) nice VB app or similar that can take all the data from all channels and display it graphically.

Since each piece of data comes from the FIFO in a certain order, the time stamp for each one is well known and predictable. It is important that you "de-couple" your operating systems timing from your logic analyzer timing unless you have a real time operating system.

All of these parts can be had relatively cheap. You'll spend the most time writing the pic program (state machines etc..), and the VB app... I think generic usb drivers exist. or of course, you can use parallel port, serial port etc...
 
are you wanting to build one out of interest or need (cost of buying one)

if it is interest go for it.
If it is out of cost of a full spec one check out the Ant16 logic analyser

**broken link removed**

it sells for about £100 and it is great
 
"3) this sample is stored in a FIFO (large enough to handle data flow with software & EPP port) "

Which FIFO could I use??
Why not sent it directly from buffer to USB??

The problem is that I don't know if EPP supports that rate, and I don't know how to use USB,.. (I know very well how to control paralel port).
 
patroclus said:
"3) this sample is stored in a FIFO (large enough to handle data flow with software & EPP port) "

Which FIFO could I use??
Why not sent it directly from buffer to USB??

The problem is that I don't know if EPP supports that rate, and I don't know how to use USB,.. (I know very well how to control paralel port).

Well, you're going to have to do some math on th etransfer rates.
You see, the main problem I am thinking about is on the software end. I mean ultimately, you will be displaying your data somehow right? Well, if your data rates are too sufficiently fast, your software may not be able to "retrieve" the data in time and you will end up losing data.. This is irregardless of how fast the hardware is (be it USB, EPP etc..) If you are sampling at an 8MHz rate, you are likely going to have a problem getting software drivers to collect data at that rate..

You need to look into the software end of how fast you can grab data from an EPP or usb. Generally though, I would forget about relying on software to be fast enough.. (if it is windows you can forget it!, too much other crap is happening in the background and you generally dont get much control over that).. I'm not an avid programmer so you'll have to check into that.
Simply put, you will only beable to handle a continuous stream of data at a rate that reflects the slowest part of the chain.. think about it..

So how does the rest of the real world devices avoid slow software? They "buffer" the data.. meaning they gather it fast and hand it out at a rate that is compatible with the slower part of the system (like software device driver etc..) But the potential for overflowing the buffer exists so you will have to "size" your buffer appropriately based on sample rate, data size and delivery rate and account for some other interfereing delays that might be possible...

It will help you understand this issue if you draw out a diagram on how you plan to deliver your data to the screen. Include every piece of your system that will be involved and most importantly, include the maximum amount of time each part will need... you will then see an upper limit placed on your sample rate and this restriction can only be alleviated by buffering your data..

I mentioned a FIFO because that acts like a hardware buffer and you can time stamp the data as well.. it makes too much sense to use it.

Do you see how your ultimate problem may not be the rate of your hardware pieces but rather the rate of your slow software pieces (guaranteed if you are using Windows)???

Many companies sell fifo's and they even call them fifo's.. they are essentially volatile ram. you could use general purpose ram as well but the interfaces are more complicated so I suggested a fifo for you with simpler controls that can meet your need.
 
Like Optikon said: You will need some sort of buffering on the hardware if you are going to use windows. Your process that is capturing the data can be interrupted by other windows proceses at any time- you will need to buffer enough to avoid loosing data durring these interruptions. This is a big problem with using windows for time critical tasks.
 
Err HELLO have a look at the ant16 link I posted it si a 16Channel (they do a 8channel) USB logic anayser.

They buffer all the data in the module and then transfer to the comp so hte s/w isnt the limiting factor, the buffer is
 
Is there any IC recomended for this kind of buffering??

Styx, I know about ant16, but it is just too expensive for me.. thanks.
 
Logic Analysis on the cheap ?

For my tuppence worth I would consider a Thurlby LA160 from EBay - sold for about £60.
Failing that I would consider a PIC microcontroller running at 20MHz - could possibly gather data at maybe 5MHz sampling rate? actually it might be only slightly more complex to use a Z80 with RAM, ROM and PIO to create a unit that could display info on a graphic LCD (wow- think of the fun !) ?
 
Using a PIC and sampling to its internal RAM memory would do the job??
the problem is getting enough memory..

At 5Mhz (0,2 us resolution) , if you only have, let's say 1000 memory locations, you will be able to capture 0,2 * 1000 = 0,2 ms. Right?? It's not much...

Is any PIC from microchip recomended??
Is any other aproach better??
The Z80, RAM,... is quite a lot of work!! :D
 
patroclus said:
Using a PIC and sampling to its internal RAM memory would do the job??
the problem is getting enough memory..

At 5Mhz (0,2 us resolution) , if you only have, let's say 1000 memory locations, you will be able to capture 0,2 * 1000 = 0,2 ms. Right?? It's not much...

Is any PIC from microchip recomended??
Is any other aproach better??
The Z80, RAM,... is quite a lot of work!! :D
As long as buffering is involved, I guess a form of control is required.
The fastest PICs runs at 10 MIPs. Capturing data at 8MHz is not possible. Besides, you'll have to consider transferring the data to another entity such as a PC/LCD/FLASH using protocols which usually come with overheads, and would of course vie for instruction cycles over the capturing process. I was thinking more in the tune of FPGAs.
 
Yes, I suposed PICs are not fast enough.. but Z80 neither (runs ar 3,45Mhz) :roll:

As data cannot be sent to PC fast enough at more than about 200.000 samples per second (at least, not easily ;) ), I thought of sampling and storing in some sort of memory (RAM?). Keep on going until memory is full, ans sampling ends. Then, sending it to PC via ECP/EPP with no speed restrictions... :)

Any ideas for aproaching ??
Better other way??

"I was thinking more in the tune of FPGAs."
what do you mean?? :?:

Thanks in advance! ;)
 
if you want to go teh route of FPGA and buffer you might as well get the ANT8/16 FPGA are fairly expensive esp with all the stuff you have to put around it and all
 
patroclus said:
Yes, I suposed PICs are not fast enough.. but Z80 neither (runs ar 3,45Mhz) :roll:

As data cannot be sent to PC fast enough at more than about 200.000 samples per second (at least, not easily ;) ), I thought of sampling and storing in some sort of memory (RAM?). Keep on going until memory is full, ans sampling ends. Then, sending it to PC via ECP/EPP with no speed restrictions... :)

Any ideas for aproaching ??
Better other way??

"I was thinking more in the tune of FPGAs."
what do you mean?? :?:

Thanks in advance! ;)
With memory, you'll still need some form of memory controller, similar for the case of using buffers.
FPGAs, like microcontrollers, are programmable to handle more specific tasks than a uP/uC at a generally faster rate. The are somewhat like custom-designed digital ICs. Maybe you should factor in this as a consideration.
 
It gets too complicated..
I've been working out some designs, and at last I think 500KHz resolution would do the job for the moment. At this low bit rate, are there easy solutions at hand??
 
Standard TTL ?

If you use a static RAM IC of maybe 2k by 8 bits all you need to do (at its most basic) is have a TTL binary counter clocked by an 8MHz clock generator, the binary counter drives the RAM address bus possibly via some form of tristate buffer.
Any data bus activity will be recorded at this 8MHz sample rate.
To play back the data you could simply disable the tristate buffer and enable a second address generator (PIC, Z80, bits of wire or EPP port) running at any convenient rate for your display.

You would need to generate a write command at the 8MHz sample rate for the RAM but the above idea isn't impossible - even with a PIC at 100kHz ! --- I guess this is a 'hybrid' solution, part descrete, part microcontroller/microprocessor but it could be done --- even faster if the right TTL chips and RAM were chosen.
 
Silicon Labs Sells an 8051 with a 16 bit 1MS/s converter and DMA controller. So the samples can be transfered to memory automatically without using any CPU time. This controller is a system on a chip so you don't need to add anything (not even a crystal) to get it to work. The controller also has an external memory interface which lets you add even more ram for sample storage. C8051F066 sells for $20 in a TQFP100. https://www.silabs.com Silicon labs products are super easy to use. If their site is right it looks like you can get an evaluation kit for ~25$ - well worth it.

Brent
 
mechie I like your idea. Why do I need to generate a write commands?? Is it like programming flash memories?? Aren't they any ram that can be written by addressing and pulling WR line down??
And if I need to generate commands, how can a PIC running at 100kHz generate commands at 8Mhz??

thanks :)
 
I should pay a bit more attention. Somewhere in between looking at the topic title and formulating a responce I forgot that you wanted to sample digital signals and not analog signals.

You might want to try a CPLD (like a smaller cheaper FPGA) or a couple CPLDs- the mid range ones are $2-$5. You could set it up to sample and store data in an external memory and then dump the data to the computer with a UART or to the Parallel port when the memory is full.
 
Isn't it better to just address with a counter a static ram DIP chip??
I never worked with CPLD...

SRAM does not need any write algorithm, does it?
 
Status
Not open for further replies.

Latest threads

Back
Top