Oscilloscope and logic analyser notes

From Helpful
(Redirected from Oscilloscope)
Jump to navigation Jump to search

📃 These are primarily notes, intended to be a collection of useful fragments, that will probably never be complete in any sense.


See also the nice aggregation at https://opencircuits.com/index.php?title=Oscilloscope



The things below are roughly ordered from cheaper to more expensive

What do you need in an oscilloscope?

Sampling rate and bandwidth

Rise time

UI

Memory - at all

Memory depth (how much)

Triggering, trigger modes

Math features

Decoding

Poor man's oscilloscopes

PC sound card

✎ This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

One of the simplest oscilloscopes, one you already have, is a sound card.

This will give you a 2 channel, 16-bit ADC, often 48000 sample/sec, though assume at most 15kHz bandwidth, and modern sound cards now tend to have a pretty low noise floor.

This is typically AC coupled, so voltages won't stay at their proper level.


Sure, that is too slow for many interesting signals, but useful enough to measure some slow baseband signals, for almost-free -- a few cents worth of resistors for some protection and voltage dropping.


Time accuracy

AT 48000 samples/sec, you would be fine e.g. checking that something is timed to below milliseconds. In fact, one sample would be ~21 microseconds, and a millisecond would be ~48 of those.


Bandwidth

Note that running your sound card 96 or 192kHz does nothing to increase your bandwidth more than setting it at 48kHz, because all sound cards have lowpass filters on their input, meaning you should assume content above ~20kHz is attenuated to gone.

Attenuation may start a little lower, though that effect often comes from microphones more than audio interfaces.


(You sometimes find faster ADCs around PC hardware, such as a 448kHz (not a typo) ADC in bt878-based TV cards, with ~360KHz usable bandwidth(verify), though it takes more work to make this into something usable.)


Voltage

Since consumer audio assumes it'll rarely go above ~0.5V, and most things you want to measure is higher voltage than that you'll at least want to make a factor-20ish voltage divider.

Fixed switchable voltage divider may make more sense if you want to relate what you read out back to actual voltage. (in the same way oscilloscope settings are 10x or such)

A few more components can provide more protection and/or convenience - consider buffering, protection diodes, decoupling may further help protect that input.

See pages like http://xoscope.sourceforge.net/hardware/hardware.html



See also:

Microcontrollers

✎ This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

...such as the Arduino's Atmega chip, the PICs, and others.


If they have an ADC, you can use it as a lowish-speed scope. Consider e.g.

Arduinoscope (AVR based software scope)

...but note that performance is on the same order as a sound card - and that's optimistic.


Even without an ADC, they can be a (somewhat faster) logic analyser. Consider e.g.

Bus pirate (PIC based logic analyser)


Arduinoscope

It's not going to have the precision, regularity, or memory depth, or interface features of even a relatively cheap DSO, but it can be a pretty good debugging tool, given it's software for something you already have.


One of the first, and simplest to get started with, was https://github.com/konsumer/arduinoscope (GUI for win, lin, osx), which is fed with ASCII lines of values - not very efficient, but it's an easy way to visualize what's happening on a pin, and with just a few lines of Arduino-side code.

The arduino IDE itself has basically adopted that same approach since version 1.6.6 (2015), with its "Serial Plotter" (see the tools menu), that reads numbers written as text on the serial port.



There are various other projects that tried to be a little fancier than that, in particular getting a little more speed.

AVR-wise, the 9.6ksamples/sec that libraries default to is for compatibility with more arduino variants, and most AVRs can easily be run at ~77ksamples/sec.

Higher is possible, but using/moving the data fast enough becomes an issue, and above ~77ksamples/sec the resolution loss starts becoming noticeable (related to these notes).

It seems the combination FTDI UART and AVR USART (both also run at higher bitrates than typical in Arduino), and AVR code needing some time, will in practice probably transfer no faster than ~1.5mbits/s. If you are willing to give up bit depth for speed, you can get on the order of maybe 150k or 300ksamples/sec.



Toy-like DSOs that fit certain purposes

✎ This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

DSO, Digital Storage Oscilloscope, is a vague description, basically just meaning 'we sample and store digitally', and doesn't actually say anything about the size, whether it has a screen, bandwidth, whether it's an independent box or not.


It starts at things that are almost toys.

Take for example the DSO138, because it can be had for EUR10-25 or so.

It's single channel, 12 bits(verify), a few hundred samples of storage.

While it's quoted as 200kHz, it only seems to pass signal at 100kHz, and do not expect it to give accurate waveforms above 20kHz(verify).

On the one hand that makes it only a little better than say, using your sound card as an oscilloscope.

Yet it's an independent tool, has auto/norm/single triggering, and is perfectly useful to debug basic electronics, and audio equipment faults (clipping, waveform distortion), and the like.




Recently, some ~EUR50 DSO-like scopes have appeared that are a little more capable.

...but may also be very creative with their specs. Say, maybe quoted as 120MHz, but don't maybe don't assume accurate waves above 1MHz.

And yet, for a lot of hobbyist debug uses these are pretty decent figures.


That said, once these start going above 100 EUR or so, you may as well start considering more serious gear, both for specs and for user interface reasons.

Somewhat better

USB / mini oscilloscopes

USB logic analysers

✎ This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Logic analysers do only digital sampling, which is easier to do a bunch faster than analog sampling.

When selecting one, you might wish to check whether its graphical interface also does what you want it to do.

It may do a bunch of protocol analysis - usually a bunch more than scopes at higher price points.

This is great for a lot of fixing and debugging of digitally connected things, so when that covers your needs.

Decent ones seem to start around a hundred bucks.


Examples:

  • Bus Pirate
  • ZeroPlus Logic Cube
  • Logicport one
  • USBee

TODO: add more

USB scopes

✎ This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.


Remember that 'DSO' is a description -'Digital Storage Oscilloscope' - not a brand or type. You see the term on toys as well as professional gear.


USB DSOs then often refer to samplers with no screen, no physical controls.

Their core is a (fast) ADC or two, some memory, and an USB interface to read that memory out to your computer, where the actual scope is an application that shows that data.

A lot of these can stream that data live-ish, except maybe at the fastest, many-MHz settings (if they even go that fast)

(...if they do go that fast, they will often shift towards "I will send an X amount of samples after I was triggered, and send that to you after the fact" behaviour, and how practical that is (and how fancy the triggering) can vary)


That said, if you like to work from your PC anyway, and have relatively basic diagnostic needs, this form of scope may cost-effective, and more transportable than a full scope.


In general, the feature set 'varies a lot, as does the convenience of the interface

so you want to do a lot of reading to know whether it will actually do what you need.


On the basically-a-toy side you may get no more than a few dozen KHz. Heck, you can do that just with your sound card.



Products that deserved at least little care tend to do least a handful of MHz, sometimes a few dozen MHz or more, but note that once you get decent bandwidth (50MHz, order of magnitude), the price starts crawling towards that of a dedicated desktop scope, and such a an (entry-level) desktop scope is preferable for many.



There are a number of people that are designing their own USB scopes based on common ADC chips, because you can beat a few dozen kHz easily. Some are basic, some are fancy. See e.g.


Note that many cannot use all their sample memory at the top speed(verify)

Basic portable/handheld scopes

✎ This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Have a screen, are battery powered.

Probablynot a full interface, and not great bandwidth, but can be great for debugging on the go.


Consider e.g.

DSO Nano

  • One probe (so no probe-based triggering, but there's level and edge triggering).
  • 12bits ADC at 1Msamples/sec. Don't count on seeing unaliased / detailed signals faster than 200kHz.
  • Can store waveform to SD storage
  • USB connection can be used to charge battery, read stored waveform (from SD storage), upgrade firmware
  • USD ~100


DSO Quad - basically an improvement over the DSO Nano


FNIRSI handheld scopes


TODO: longer list

Desktop memory scopes

If you're coming from the perspective of older CRT scopes, there are digital and have memory to freeze a signal on screen (memory scopes existed in the CRT era, but were not common or cheap).


If you're coming from the perspective of cheaper DSOs, these are the self-contained variant that have an LCD screen, plus the ability to keep more acquired data on screen, a much friendlier interface and more capabilities you want in diagnosis.


If you have a job where you regularly need an oscilloscope, you one, you want to start looking away from the "businesses don't care about a few hundred bucks" and towards the lower end of the price spectrum.


There are a few "good enough for specific uses" at 200EUR. Decent general-purpose memory scopes start at perhaps 300EUR, and if this will be a central everyday tool you may wish to look at EUR400+ models.



"I've heard analog scopes are lower-noise than digital scopes?"

On probes

On (not) damaging your oscilloscope

See also



Cheap logic analysers

While oscilloscopes need to care a bunch about many levels of voltage, logic analysers may only need to care about binary levels.


Because of the debug tools that they are, real logic analysers need to do a lot of lines all with the same timing, but note that

Even simple microcontrollers can sample digital levels quickly (and often 8 GPIOs at the same time), which means you see some projects along the lines of ESP32_LogicAnalyzer which do a specific job pretty well.


Are they as great as the expensive one? No.

Will you want that one sometimes? Sure.

Is the cheap one great for some tasks? Yup.





Practical use notes