Can Logic Analyzer be used to measure clock & PWM Signal

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

This may be a dumb question, but I want my doubt to be clarified.
I am planning on buying a Logic Analyzer either from Saleae Logic or USBee. Can a logic analyzer measure the frequency of a clock signal (say 8 MHz) and also can it measure the pulse widths of a PWM signal?

I know an oscilloscope can do the above but I am looking at a cheaper option since I just want to measure digital signals like clock and PWM signals and protocols such as SPI etc.

Thanks,
Sumair

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An 8MHz clock signal has a period of 125ns, so can the logic analyser resolve periods faster than this? If so, then it will measure your clock signal. Again, what periods are you generating with pwm and what can the logic analyser resolve?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have difficulties running Saleae Logic at 8MHz sampling rate for any more than few seconds on my laptop (may be the bottleneck here). You need at least twice the sampling rate to sample a signal, so 8MHz clock signal with 50% duty needs at least 16MHz, but in reality you need more than that. Can be hard with Logic. Logic just samples the signals and streams it to PC memory for further processing and display.

Same applies to PWM. Depends on PWM frequency and resolution you need. If you have a PWM signal generated from 8MHz, then 8MHz sampling rate should be fine.

I needed to sample a <2MHz clock with Saleae, so 4MHz sampling rate would have been enough. But alas, my signal had 25% duty, so to sample it, I need to use 8MHz sampling rate.

The Intronix LogicPort would measure 8MHz clock happily for ~1000 transitions, with up to 500MHz sampling rate. It has internal buffer which is captured and sent to PC for non-realtime processing and display.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have met situations where clock issues were not due to duty-cycle or period, but rise/fall time and oscillations and overshoot. A logic analyzer cannot show those.

You will still need a scope. Get a second-hand one?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

Thanks a lot for your replies. I need to generate a 50 Hz PWM signal used for servo motors...I just need to measure and verify the pulse widths for the different servo positions....I guess the Saleae Logic should be able to measure that.

As for the clock signal I actually need to generate a 500 KHz clock used for SPI protocol...but was just wondering if the Saleae Logic could measure an actual 8 MHz clock signal as well.

I may need a logic analyzer after all for debugging the SPI protocol....and try to buy a second hand oscilloscope sometime later.

Thanks,
Sumair

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well for the servo stuff even a "free" soundcard 'scope could be used.

Search OT: (sticky) Freeware for the word "soundcard". In particular a post from Plons with a simplistic level converter circuit in it.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Saleae:
-500kHz SPI, no problem
-50Hz PWM, no problem
-8MHz clock, well, depends on what do you want to see/measure from it and for how long and how your PC and USB subsystems perform.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Quote:

-8MHz clock, well, depends on what do you want to see/measure from it and for how long and how your PC and USB subsystems perform.

Could you please explain this a bit more? what is the max. frequency that the Saleae Logic can safely and efficiently measure? what criteria are we looking at in this aspect?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The issue with devices like the Saleae Logic or USBee, is that they have very little memory inside them.
They depend on being able to stream the data samples in realtime from the pod to the PC.
If the USB bus & PC can't pull in the data samples fast enough, then the device very quickly overflows its on board buffers and the trace stops.

While they claim a maximum 24Mhz sample rate, on my 2.2Ghz Dual Core machine running vista, with a USBee I can't get the sample rate to work reliably above 8mhz, so that means that it really can't be used to examine any signals above about 4Mhz.

The good thing about USB is it is very inexpensive to implement. The bad thing about USB is that can have unexpected overhead, including from places like non "active" devices - which still have to be polled and consume some USB bandwidth even when not moving data.

Some other devices use an alternate approach and do the triggering and buffering inside the analyzer pod. They store the full trace in the pod and then transfer the data after the trace buffer is full. In this design the speed of the PC and USB bus won't be an issue as all the trace data is buffered locally before sending it over the USB bus.
These types of devices typically have significantly higher bandwidth.

The Zeroplus Logic Cube is an example of an inexpensive device that uses this design.

The entry model of this (LAP-C 16032) can be had for about $120 and supports up to 75mhz bandwidth and can be clocked at 100mhz. Also offers 16 inputs rather than 8.

The GUI isn't as polished as the USBee and it doesn't come with as many decoders but it can capture higher speed clocked signals and on more signal lines than the USBee.

Here are some links to information on the Logic Cube:
http://www.zeroplus.com.tw/logic-analyzer_en/products.php

http://www.nkcelectronics.com/test.html

It comes down what you want/need it to do.
If you want a fancier and more intuitive GUI with more decoders included and can live with 8 inputs and slower signal speeds, the something like the USBee is great.

If you need more than 8 inputs or need higher speed sampling, then you will need a device that buffers locally like the Logic Cube.

--- bill

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ssyed_mcu wrote:
Hi,

Quote:

-8MHz clock, well, depends on what do you want to see/measure from it and for how long and how your PC and USB subsystems perform.

Could you please explain this a bit more?

Sure, but not without your help.

ssyed_mcu wrote:

what is the max. frequency that the Saleae Logic can safely and efficiently measure? what criteria are we looking at in this aspect?

How am I supposed to know what are your requirements for safe and efficient? You need to tell me that before I can answer.

I'll try though. Well, in theory, Logic can sample at 24MHz if your PC has powerful CPU and USB bandwith and it can sample for as long as your PC has memory available memory and swap space. Every second takes 24 Megabytes of memory, so a minute would take 1.3 Gigabytes or so. It means that if you have a perfect 12MHz 50% duty cycle square wave with zero rise and fall time and it does not drift in respect to Logic sampling at 24MHz, then you are able to see 12MHz square wave, one pixel high and one pixel low.

In practice, my laptops can use the Logic when it is sampling at 4MHz for several tens of seconds, maybe a minute, and 8MHz for 5-20 seconds until it just stops.

8MHz sampling rate is good for signals up to 4MHz, but in reality, your clocks are not phase aligned and sampling will drift, so instead of square wave with 1 high and 1 low sample, you sometimes get two same samples and you miss a transition. Also if you have a 1MHz signal with 10% duty, you need to sample it at 10MHz at least to see the 100ns pulse.

So with my PCs, I can propably use 24MHz sampling for few hundred samples, and what would you see from a 8MHz clock sampled at 24MHz anyway? Sampling period is 41.6ns, while signal period is 125ns, so signal is high and low for 62.5ns.
You would see that it is sometimes one and sometimes two measurements high and low. Sure, on average that is 8MHz, but it does not tell you the duty cycle, as sometimes it is 33% and sometimes 66%. And since it calculates frequency based on 1/samples, it will either show you 12MHz or 6MHz, since the period is either 3 or 4 samples.

So in my opinion, at 24MHz, which it most likely cannot do, it can measure 8MHz signal but in my opinion it is not good.

Now, define what do you mean by good, safe, etc? And why would you measure 8MHz anyway? If you are measuring crystal frequency, you are able to divide that down in the microcontroller and output a lower frequency to a pin and measure the lower frequency very precisely, from which you can calculate the crystal frequency.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My LogicPort "claims" sample speeds up to 500MHz. It isn't particularly expensive either, but indeed costs more than $100 solutions. (I got one of those and thought it was crap. YMMV. Returned it.) For slow protocol work like I2C the buffer-compression of repeated levels seems to work nicely.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Thanks for your replies.

Quote:

what is the max. frequency that the Saleae Logic can safely and efficiently measure? what criteria are we looking at in this aspect?

What I meant by the above statement was to know what was the max. frequency that could be measured by the Logic efficiently and accurately without any loss of data :)

From your above replies I have got the answers to all my questions. Thanks a lot to everybody for their valuable inputs.

Thanks,
Sumair