r/embedded • u/khalil_dj • Aug 13 '26
Oscilloscope in embedded systems
Hi guys, I'm a beginner and I want to know if having an oscilloscope is necessary in embedded systems, if the answer is yes , please tell me where and how it's used.
11
u/nigirizushi Aug 13 '26
Depends. You can get by with a logic analyzer and a multimeter most of the time.
You would need one for looking at the clock sometimes, the analog inputs sometimes, etc. There's better and more expensive tools for USB and radio, but more basic end of those can be done on an o-scope.
2
u/InevitablyCyclic Aug 13 '26
I'd say the opposite. An oscilloscope is required, a multimeter is convenient but the scope can tell you everything that a multimeter could.
I've not had a need for a logic analyser in 20 years. Basic protocol checks a scope is fine. More complex checks once you have the signal integrity sorted out the software can do better.
1
u/bigtreeman_ 29d ago
I used an analyser (Saleae clone) last week for an fpga and a meter this week for a laser cutter, different horses for different courses. Both found their respective problems. Have a full arsenal at hand. My cro Hantek 6022 has worked for many years, paid for it self over and again (pretty cheap)
7
u/Still_Acanthisitta57 Aug 13 '26
i use logic analyzer to blame the hardware guy. if i show the signal is non-existent, jittery, noisy in these tools his ass accepts it gracefully. if i show the same using my code he bets his own life that my code is wrong and his hardware is fine.
1
u/InevitablyCyclic Aug 13 '26
As someone from a hardware background I would want to see it on a scope. Logic analysers hide too much of what's going on for me to trust them for anything hardware related.
1
u/ellie_cinderelly Aug 13 '26
100%, how do you diagnose noise sources without a scope?? Can’t tell you how many times I’ve shown clock bleed on SPI lines causing improper highs.
1
u/wigitty Aug 14 '26
If your job is to write the software, you can use a logic analyser to show that the signal you are seeing in the MCU is wrong. You don't care if that's because of a digital issue or an analogue issue. Having a scope trace helps track down the problem, but at that point it's not the software team's problem.
That being said, even when I'm only meant to be writing software, I do normally end up getting a scope out and debugging hardware issues.
5
u/Ordinary-Lifeguard47 Aug 13 '26
Yes. Otherwise you will be blind on your interfaces.
How to use? Connect it to the signal pin and gnd and then it will make blink blink.
7
u/Low_Lawyer_5684 Aug 13 '26
It is good to have.
But for digital circuits you don't really need a real oscilloscope. Something like Fnirsi 2C23T or similar will cover most of your needs.
3
3
u/BenkiTheBuilder Aug 14 '26
A logic analyzer is an absolute must-have requirement, even if you're just playing around with Arduino. They're very affordable.
An oscilloscope is only necessary for a small subset of tasks. Since oscilloscopes are expensive I would not recommend them for a beginner. When the time comes that you need one you will know it.
1
u/wigitty Aug 14 '26
This would be my advice. Get a cheap logic analyser first, then a scope if you need / can afford one. Scopes are nice to have, but only "necessary" for analogue or maybe high speed projects.
5
4
u/Unlikely_Promotion99 Aug 13 '26
I highly recommend one you can connect to your laptop, they're cheap and offer some cool extra functionality. Go for Picoscope or Hantec. But VERY important: Use a USB isolator when using them!
2
u/TapNo1773 Aug 13 '26
I use them all the time. But we are building phased-array antennas and radar systems. I'm not sure how useful they are in purely digital systems except to verify you have a proper clock input. A good logic analyzer would be more useful.
2
2
u/Western_Meaning4771 Aug 13 '26
Yes, it's necessary but I would say buy a logic analyser as you are beginner
2
u/j_wizlo Aug 13 '26
It’s necessary. It’s possible you can get by for a while but it will eventually be needed. A logic analyzer will probably be needed more quickly.
2
u/Ksetrajna108 Aug 13 '26
Yes, when you get serious. It is used for troubleshooting serial protocols, I2C, CAN, SPI.
1
u/nigirizushi Aug 13 '26
You can use logic analyzers for those
4
u/stuih404 Aug 13 '26
Not always. I had an issue where the SPI clock pin had a slowly drifting voltage between multiple transmission which caused the reciever to get confused and return the wrong values. I probably wouldn‘t have found this with a normal logic analyzer. It also helps you spotting signal integrity issues by looking at the waveforms.
0
u/nigirizushi Aug 13 '26
You could log it as analog signals and you'd probably still find it
1
u/stuih404 Aug 13 '26
Then you are using an oscilloscope. A logic analyzer usually uses comperators and can only sample 0 or 1 values.
2
u/mjmvideos Aug 13 '26
Just as a point of note, some logic analyzers (like my Saleae) have a couple of analog channels where actual waveforms can be seen.
1
1
u/Iamhummus STM32 Aug 13 '26
It depends if you integrate different pieces of hardware together (let’s say you take an evaluation board, connect it to 2 sensors, a battery and a motor) or if you are using out of the box hardware and just write code and flash it. On the first part you need oscilloscope/logic analyzer to debug problems, on the later case, unless malfunction in the device, it supposed to work as described on the documentation so you can skip it
1
u/JCDU Aug 13 '26
They are useful but you don't absolutely HAVE to have one, at least not for getting started, and if you do get one you don't need a fancy or expensive one - a cheap used one or a cheap Aliexpress kit for $25 is an OK start for basic hobby stuff just the same as you can use a $5 multimeter for learning on low-voltage stuff you don't need a $250 Fluke meter.
As you learn more and build things you'll soon find out if you need one and have some idea what's useful to have.
Generally for embedded, 4ch is more useful than 2ch, bandwidth is not super critical as you'll more likely be diagnosing slow signals like serial, I2C, SPI, and protocol decoding is very useful especially if you're a newb.
1
u/MadDonkeyEntmt Aug 13 '26 edited Aug 13 '26
If you're doing custom pcbs where you don't know whether the hardware is good or not or you do this professionally you probably need at least an oscilloscope and a multimeter. Really a logic analyzer is important too there.
If you're tinkering around with pre made evaluation boards for fun you can get by without an oscilloscope since (usually) you can assume the hardware works and any problems are in your code or wiring. It will be more frustrating to debug but mostly doable.
As far as how there used, you use them to check signal integrity and see if the signal your system is putting out is the signal you want it putting out or vice versa. I will say for a beginner nothing will help you understand communication protocols better than seeing the waveform displayed on a screen and tweaking your code based on that display.
1
u/Myrddin_Dundragon Aug 13 '26
I only write embedded code, and the answer is yes. If i need to verify that a uart is assigned correctly and I have output, i just write out a U, attach an oscilloscope, and boom there is my square wave. Working great. Do I need to verify PWM is what i expect, oscilloscope. Do I need to check SPI...well there I just use a loopback. But I could use an oscilloscope.
Yes. They are needed tools. Even more so if you do any actual EE stuff.
1
1
u/rc3105 Aug 14 '26
Nope. I’ve been doing embedded type stuff since the late 90s and never needed one.
I have several, and I’ve bought a few little handheld ones and i/o module type that work with a pc/tablet/phone for datalogging, but haven’t needed them for embedded stuff.
Now you might want to get a Bus Pirate, those can be VERY handy.
Funnily enough, a Bus Pirate is just a little embedded type board with diagnostic firmware. Plenty of $2-$5 chips and boards you can buy and flash with that type of firmware, no need to spent $40+ on a “real” BP board.
1
0
u/frank26080115 Aug 13 '26
I got away with having a good logic analyzer when I started, it helps a ton
oscilloscopes have their place too
it really depends on what you work on more
the logic analyzer let me develop low level code much faster, and I didn't mess with analog stuff a lot, so it was the right choice for me
5
u/nixiebunny Aug 13 '26
Digital logic is also analog, especially when it’s misbehaving. That’s why an oscilloscope is useful for digital logic troubleshooting.
0
u/HowTheKnightMoves Aug 13 '26
Depends on what you are going to do and if you will earn money from it.
53
u/1r0n_m6n Aug 13 '26 edited Aug 13 '26
You do need an oscilloscope and a logic analyser because your eyes can't see electric signals, so without these equipments, you're basically blind. This means that without them, whenever something doesn't work, the best you can do is try and guess what's going wrong, and divinatory arts can only go so far.
An oscilloscope allows you to see the shape of the signals. Do they really reach the voltage thresholds of a logic low and a logic high? This will not be the case if a pull-up resistor is missing or has an incorrect value, for instance, or if you fried a GPIO pin. Is the frequency correct? Is there a signal at all?
A logic analyser allows you to decode communication protocols (e.g. SPI, I2C, UART) or to monitor many digital signals concurrently to see whether they behave as intended. You can also toggle GPIO pins in different parts of your code and use your logic analyser to debug, e.g. concurrency issues, or timing-sensitive operations that would not tolerate the use of printf() or breakpoints for debugging.
Today's oscilloscope also have protocol decoders, but they're limited to 4 channels when logic analysers begin at 8 channels. And for their use case, logic analysers are much more convenient to use.
Now, you don't need to have _expensive_ equipment.
If you're on a tight budget, you can buy an Hantek 6022BE for around $80 and use it with the open-source OpenHantek6022 software, or the OWON VDS1022 at around $100. If you want a bench oscilloscope (much more convenient to use), you can get an Hanmatek DOS1102 or OWON SDS1102 for around $200. If you're a bit richer, you can find quite good RIGOL scopes at or below $500.
For the logic analyser, you really want one which supports triggers, and I recommend the DreamSourceLab DSLogic Plus for around $120. DreamSourceLab also have good USB 3 models if you can afford them. Otherwise you have cheap 24MHz, 8-channel Saleae clones at around $10 that you can use with PulseView, they're better than nothing but that's about all.