Embedded - 2: My Little Pony Stopped Outputting

Episode Date: May 23, 2013

Elecia (@logicalelegance) and Jen (@r0b0ts0nf1r3) compare multimeters then install the Saleae Logic to debug a problem. Elecia pines for a nifty oscilloscope. Some products discussed on the show: Sa...leae Logic USB Logic Analyzer (and direct Saleae website) (Somewhat expensive) Fluke Digital Multimeter TPI 120 Compact Digital Multimeter (El's desk meter)   BK Manual Ranging Tool Kit Digital Multimeter (El's other meter, not Burger King!) Radio Shack  22-801 (Jen's home meter)   Excellent article on SPI protocol on WIkipedia

Transcript
Discussion (0)
Starting point is 00:00:00 My little pony stopped outputting. This is Elysia White. You're listening to Making Embedded Systems, the show for people who love gadgets. Today we're going to talk about gadgets you absolutely need to make other gadgets. Yes, it really is turtles all the way down. Specifically, we're going to look at cheap ways to look at signals on your board. It's going to start out easy, but get technical fast. And I'm happy to say we've got Jen Castillo here to give us a second opinion. Hello. I'm really excited to be here. I brought some of my own goodies and gadgets just for comparison.
Starting point is 00:00:36 Cool. So my little company, Logical Elegance, wants to buy an oscilloscope. We've been wanting one for a while. And we do mostly embedded software, so our needs are limited. We do debugging of drivers, yet another spy driver seems to be every week, some basic power monitoring, and watching IO lines toggle as we optimize state machines. But just to interject a little bit, that's not all you can do with them. I know that I've spent a lot of time looking at the clocks, looking at how much debounce there is on a button or switch,
Starting point is 00:01:15 and looking at ripple and power supplies and other signals. You can tell that Jen does more hardware than I do, but those things, yeah, I've had to do them too. So I started out wanting a four-channel scope, 200 megahertz. That would let me look at spy channels up to a hundred megahertz. And realistically, that is what the borrowed Tektronix scope I had was. So, you know, I just wanted to replace it so I could give my friend back his scope. I realized pretty quickly I was okay with a hundred megahertz because, because I was. You're not doing that many ultra-fast speed signals.
Starting point is 00:01:49 Exactly. And then wandering around the Embedded Systems Conference, I changed my mind. Two channels is enough if I can have some digital channels, especially if those digital channels have protocol analysis. While I don't mind looking at the scope and, you know, trying to figure out ups and downs and then, you know, drawing it in my notebook and getting into hex, wouldn't it be nice if there was some tool that would do this for me? So it sounds like you were really hoping to get a mixed signal scope. Exactly. But Logical Elegance is a pretty small company. Our budget's only two to three thousand
Starting point is 00:02:23 dollars. Well, have you even thought about looking at some of the used models? But Logical Elegance is a pretty small company. Our budget's only $2,000 to $3,000. Well, have you even thought about looking at some of the used models? Yes, and we did wander around hoping that some of the scope providers would give us refurbished models from floor models. They're still really expensive. They're still really expensive. My wish list is much bigger than my budget. Yeah. Usually if you're a very lucky person and very patient, companies that are going out of business will often liquidate for very cheaply, but you will still need to get that product, you know, that device service before you can really trust it.
Starting point is 00:03:03 Yeah. That's important. Getting a scope just off the street, you don't know where that thing's been. On the other hand, companies that do provide the calibration services often will sell you used ones, but once again at that, you know, almost like new price. Well, for now, I think we should set all of the hopes for an oscilloscope aside, in case of a fairy godmother or godfather. I'm not sexist. But we should talk about what tool you have to have if you want to do embedded systems as a hobbyist, as a do-it-yourselfer, or a professional engineer. Absolutely. So voltmeters, right? That's the tool? For most people, they mostly rely on voltage.
Starting point is 00:03:49 Well, I mean, they have a lot of names. I mean, there's the voltmeter, the digital voltmeter, the DVM. The DDM, I've heard. What's the D in DDM? I think there's still, I don't know why. That's just what I've heard, DDM. Oh, I know there's DMM, which is digital multimeter. So we're going to use all those terms randomly, and I hope none of you get confused.
Starting point is 00:04:12 Right. Now I'm going to stick to multimeter, because it isn't just a voltmeter. You're not going to promise to stick to anything in particular? Well, the truth of the matter is that as soon as you talk about voltage, you're probably also going to head way into resistance and current. Multimeters. Yeah. And unlike oscilloscopes, multimeters are cheap. In fact, my personal advice is to start with the cheapest one you can stand.
Starting point is 00:04:41 And that is, comes in at a price point of? Well, about the price of a cheap lunch i mean i did get mine for 15 which was an upgrade over the five dollar model i saw but that was only because it fit in my hand better and it came with nice sharp probes of course that was kind of bad because i've poked myself so many times and apparently you don't work with lots of other people well and that's the other thing. Anymore. A voltmeter is nice to have for yourself. Yes. And if possible, make it as ugly as possible. So usually when you're working not within a two-person company, but in a larger
Starting point is 00:05:18 organization, you'd ideally want to have more than one, especially because they're generally, you can get them so cheaply and you're usually only utilizing one of the features, which is voltage or beep. Beep. Current. So let's talk about the features. I totally agree. If you have more than two people in your company, you need, as far as I can tell, more than
Starting point is 00:05:43 four multimeters. I have two per person at this company, so that seems like a good ratio. Wow. And they're all cheap? Yeah, actually. They're all cheap. Okay, so let's see. This one, it is bright green and kind of hideous at that. So maybe the bright green in the black casing that you're showing me right now isn't as relevant to the people listening in because you haven't actually talked about the standard color code for one of the,
Starting point is 00:06:26 you know, one of the, one of the chief, uh, DVM providers, which is fluke. That's true. Jen came in with a bright yellow traffic, yellow, um, volt meter and, uh, and with the black casing around it, I was like, oh, you have a fluke. Wow. You really paid for that. No, it's the Radio Shack. It's the Radio Shack knockoff. So you were saying the bright green one, which obviously tries to get away, get around the, the fluke, uh, uh, um, was it IP law issues?
Starting point is 00:07:02 You know, I don't even know what brand this is. It says TPI on it, but that's not the important part. That's not the TPI. The important part is that it's got voltage reading, and it can read 2 volts at 10 millivolt increments, and then 20 volts at 0.1 volts. Because the important thing about your multimeter, what you're doing when it's in voltage mode is the thing powered. As software engineers, isn't that always what it comes down
Starting point is 00:07:35 to? Did you turn your computer on? Okay, well, that's one place to start when you're debugging. But, you know, for me, it usually is also you know what voltage is at is it at and are we able to sustain that voltage regularly i.e. is the part powered enough and when everything's turned on do we suddenly have a current draw that's causing the overall voltage to drop it's hard to see a voltage drop on a multimeter unless it's really bad. Yeah, but we can talk about that later. But that's an oscilloscope problem. Yeah.
Starting point is 00:08:10 Multimeters. Multimeters. Multimeters. So what voltages can you read? So for myself on my Radio Shack DC, with a max voltage of, get this, max DC current of 1,000 volts and 750 for AC. Don't you just want to go out and try it? Yes. I don't know about yours, but this one has a replaceable fuse on it. And let me tell you, I replace this fuse seemingly all the time.
Starting point is 00:08:50 Where do you get a thousand volts? Are you just shuffling across the floor? I don't, I, no, I think, I think a friend of mine when he was in his, I'm going to hack speak and spells was, was primarily causing this, but how he was doing it i have no idea because it's not like there's that much battery you know there's six dc there's there's six d cells i think in that or c cells but so i'm only good up to 600 volts and i almost never go above 20 because most embedded systems go up to five. Most are only at five.
Starting point is 00:09:27 Maybe if you're doing motors, you're up to maybe 20. Depending on if you're doing certain SPI protocols like RS-485, then you'll go up 12 or 20 or so forth. And then if you're doing anything with um the phone system then you're gonna go to 40 but for the most part i maybe if you're doing automotive i don't know solar panels maybe yeah um okay so you have your voltage mode to make sure that you have the volts where you need them indeed and then the other absolutely required feature in a multimeter is the current, is the resistance mode, which is shown with an ohm
Starting point is 00:10:14 or with three little arcs that look like sound things. Actually, that's not how it is on mine. Mine has the ohms or capacitor. Well, I guess you're right because mine switches through mode. It's kind of funny. But yes, the sound. Yeah, yeah. This is the important part.
Starting point is 00:10:35 Yeah. Indeed. Mine also does it. And it says it on the screen, too. It says open, and when you close it together and it beeps, it says short. Oh, mine just has one point nothing when it's open and point zero when it's closed. So that beep is what happens when you touch the probes together. Yes.
Starting point is 00:10:57 It's also the beep that happens if you touch one end of a cable and the other of the cable and in between the cable is connected or one trace and another trace and the question you're really solving with the the beep is is this actually connected to what i think it is connected to but you have to power off depends on the situation depends on what you're doing. So... You have to power off. So how it works is it actually puts a little bit of voltage through whatever you're doing. So if you have a cable, it's just putting a little tiny bit of voltage
Starting point is 00:11:36 and making sure that the voltage goes in one side and comes out the other and didn't get degraded too much. And if you have other voltage in the system which might actually be causing it to couple elsewhere so if you're going through an ic or something like that then yes i'm saying keep this as a mode for when you aren't powered true so for me so she's using it to to confirm what know, the traces already on the board in the system. I commonly use this to confirm, did I solder things correctly and well? Yeah, yeah.
Starting point is 00:12:13 I mean, is it, can you, if you touch it over here and you touch it on the chip, are those connected? And did I make horrible solder globs? And did I fix them? We're going to have a whole show about solder globs. I'm looking forward to that one. So in particular for me, and this is probably going to be a topic for another show, as you start soldering with smaller parts,
Starting point is 00:12:39 once you get to 0401s, you need to start checking your work, which goes back to you need the needle-like probes and not the big chunky ones that have come with mine, or at least clips or some other. In lieu of that, you can always use alligator clips and push pins. Yeah. Yeah. Dumpers are a good way to get the signal out to where you need it. So I do have another multimeter here. So that multimeter that has only those two functions, voltage and beeps, it doesn't even tell me what the resistance is in beep mode.
Starting point is 00:13:18 It just beeps. Okay. And that's the one that costs $15, and that I've had for more than a decade. I bought it thinking, oh, I'll get one when I become rich and famous. Yeah, because that's what the rich and famous do. They blow their money on DVMs, bigger, better DVMs. And let me tell you, you can spend easily $1,000 if you really wanted to on a DVM. See, that's funny.
Starting point is 00:13:44 I was thinking about how much could you to on a DVM. See, that's funny. I was, you know, thinking about how much could you spend on a DVM and I'm like thinking 50 bucks is a fair amount, you know, that's 150. You should be getting some good features. That's when you start getting into the features where it tells you how fast is this clock speed. Sometimes, sometimes, so one of the, there was a, there was a website a long time ago. I don't even know if it exists, so we'll probably need to check this. There was a website called like multimeters. I don't even know if it exists, so we'll probably need to check this. There was a website called multimeters.com, and I bought my boyfriend at the time a multimeter for Christmas because he kept blowing mine.
Starting point is 00:14:15 And it had a way to measure decibels. It had a pressure sensor. I mean, it had all these extra bells and whistles. And that was at 90 bucks, but it was an off-brand Chinese market. Does this exist or is it porn? It does still exist. And it does look like it is mostly off-brand, quite interesting things, which I don't know why I'd complain about that, you know, with my TPI brand. And over here I have the BK Toolkit 273B. Burger King is making multimeters. Okay, so this other one has the beeping mode, although I think this is a little sad.
Starting point is 00:15:02 Oh, we must have changed the battery. It used to give this really sick sort of beep. Oh, yeah, yeah. It also has a resistance mode that's different. It doesn't beep, but it actually will measure the resistance of a resistor so that when I get out my pack of resistors, I don't have to do the whole color code thing. Yes, I definitely have something that's going to tell me what the resistor is,
Starting point is 00:15:26 and it's auto-ranging. Oh, that's nice. Auto-ranging means, so when I look at mine, I have to choose, am I going to look between 200 ohms and 2,000? Between 2,000 and 20,000? Between 20,000? Blah, blah, blah. Yeah, I don't have to worry about that.
Starting point is 00:15:43 Yeah. Which is nice, but that's why hers costs like 40 and mine costs like, what is this one, maybe $20? You get what you pay for. It's from Burger King. Did it come in the Happy Meal? Possibly. So there are some other features, though. Yeah.
Starting point is 00:16:02 This Burger King model, you have to turn it to turn it off. Oh, yeah. Is yours the same? Oh, no. Mine requires the agility of a gamer and a jackal and literacy. If you look at the back of mine, if you actually look at the back, we're on the back of the stand. It tells you how to turn off the thing
Starting point is 00:16:29 and zero the meter and a bunch of other stuff and how to even disable auto power off. So it'll turn off after a certain amount of time, but to turn it off, I need to hit a button combination like I was playing Tekken. Once you find your multimeter, you'll start putting up with all sorts of stuff that you can't imagine doing with somebody else's. And then if you go to someone's house and you
Starting point is 00:16:53 use theirs, you're like, what is this piece of crap? But yeah, yeah, there, there's definitely just like any new piece of equipment, you have your set way of dealing with it. And then when you get this new piece of equipment, you're, you're a little awkward. You're like, what the, you, you, you, you know, the idiosyncrasies, you know, that you've become accustomed to or, or lost upon the new piece of equipment. So my, uh, my $15 super friend, uh, over here does have a push button on and then it powers off on its own. That's great. And it's got a nice long power off.
Starting point is 00:17:30 When I talked to people over Twitter about their multimeters, one of the complaints was it doesn't stay on long enough, and you have to turn it on one-handed, which if you're holding two probes to a board, I have used my nose before, but it was awkward. I've never been put in that position, but I have definitely held my probes like they were just inner-woven into my hands, like they were multiple chopsticks. Ooh, fingertip probes. That'd be kind of cool.
Starting point is 00:18:00 We should do that. I think if we talk to the evil mad scientist people in town, I think they've done something similar but for music. And then another person on Twitter mentioned they had a Fluke 233 that they use both at work and at home. But at 179 pounds? That's pretty expensive. That's what, at least 350 in the U.s not including that not including that um and he likes it because it's got a good display and it has a temperature
Starting point is 00:18:33 sensor i don't have a temperature sensor in any mind have uh well remember it's going to be you don't know how accurate that temperature sensor is going to be and can you actually since it doesn't have a separate probe itself can can you actually use it to do any sort of thermal analysis of the product that you're actually working on? Probably not. And most processors have internal temperature sensors now, so. They do. I'm just not that excited about that. Yes. Haven't necessarily found that. The only, you know, anytime anyone's done that type of analysis, I've seen them use that infrared gun. Oh, yes. I love my infrared gun.
Starting point is 00:19:11 But just not to be too Alton Brown today. No unitaskers. Yes. Someday we'll have to talk about the gadgets you use in the kitchen and the gadgets you use in the garage should be, can be the same, but should not be the exact same. Yes. Um, yeah. So, you know, I bet this guy with the, the 300 plus multimeter is a hardware engineer. Probably. We talked about voltage. We talked about resistance. But we haven't talked about current. What is current like on your device? Well, one of them does measure current, yes. But I pretty much never use it.
Starting point is 00:19:57 It's a measure of current mostly when you're looking at power and how to minimize power for like pocket devices. But I'd rather do that on an oscilloscope so that I can look because there's always different states and the multimeter doesn't let you look at different states. It doesn't look let you look at instantaneous and look at that that envelope that it's creating. So yeah, in that regard, an oscilloscope definitely works out better. But on mine, just to go over my RadioShack Supreme Delight, I need to pick up one of my probes out of its socket and then move it over to the current-only socket.
Starting point is 00:20:37 Yeah. And so I can only take up to 10 amps. Ooh, me too. And this is where I need to select what current range I'm looking at. So the same way that you needed to switch through for resistors, I need to do that for current. Yeah. I do have all of that too, but I don't use it. So I'm not as familiar. Yeah. For the reasons we just stated. Yeah. So multimeters are where to start and they definitely are what you should buy first. And I mean, for me, I would say it really was my first tool. It was not just the first tool at work. It was the first tool that was mine. I could use wire clippers or whatever at work, but once I found a multimeter I liked, I was like, this, this I'm getting for me.
Starting point is 00:21:33 And that's part of going from work to home, and you don't always get to take the work one home. That can be really bad. And quite frankly, you don't always want to take what's yours and leave it at work. People have grabby hands. It doesn't even grab you. But it does make you look, you know, really on your game when you have your, like, this is my toolkit.
Starting point is 00:21:57 Yeah. This is my toolkit, not yours. It's mine. And when I start a new job, I definitely take in my toolkit and all of my tools have labels and it's none of my good tools. I just assume they're going to walk off because I have walked away from the bank with a pen and I think it's the same deal. I don't think people steal tools because they want them. I think they steal tools because they're oblivious to it belonging to someone else. Yeah. They're oblivious to it belonging to someone else. Well, I mean, that's definitely why I have my, that's where I keep all my from the conference
Starting point is 00:22:29 screwdrivers because everyone always needs a screwdriver. Oh yeah. That is the swag that you get from the vendors. Here, have a screwdriver. I don't care. I didn't pay for it. And the DVM sits on my desk. I have it all the time and I use it whether it's the sort of nothing is working bug that tends to be voltage for me or whether it's this peripheral is acting like
Starting point is 00:22:54 I'm not talking to it. It's not doing anything. The DVM is where I go. I would, I would say in most of my professional day to day, I don't necessarily use the DVM unless it's for soldering or some other really quick debugging. However, when I'm working in my wearables and doing costumes that have electronics in them, this is the tool I have to rely on because it's simply impractical for me to bring a laptop and oscilloscope and a bunch of other stuff. I need to be able to debug things very quickly, very concisely and address them. So this ends up being the critical tool that I keep with me for emergencies, for costumes and other things that I'm bringing to the theater or out to a parade or something like that that have electronics in them. And with an oscilloscope, if I need one, I have to IM or call my doubly friend
Starting point is 00:23:53 and ask if I couldn't pretty please borrow his scope. And that's Phil at Weekend Engineering. He's a great guy, and he's always said yes. And then I go over to his house after he gets home from work because I think his wife is afraid to go in the garage, and I pick up the scope, and usually I get it for a week or two, depending on if he's got a project planned. So where I'm going with here is that when I use a scope, it requires some planning on my part, which requires admitting my bug can't be solved by just typing something else. Even when I have 24-7 access to a scope, it still means figuring out where to attach the probes to the board and setting up the scope. Setting it up, you know, in a way that makes sense. It's not as trivially easy to use as a
Starting point is 00:24:37 voltage meter. And this was better than when I worked at HP when we had the logic analyzers, like 32 and 64 channels. They were behemoths. I mean, they were unliftable. They were tanks on rollers. On rollers and protected. You know, these were kept in the clean room so that they didn't get dusty because these are, well, it was like a $50,000 machine. It was amazing. I mean, it was really cool. But it also meant that I had the bug that I was going
Starting point is 00:25:07 to fix here had to be worth setting it up. It was such a difficult tool to use. I had to admit that I couldn't solve the problem just by recompiling. That it was worth spending three days to set up the tool and then get the answer and then solve it in three hours, which was invariably what happened. But, man, how do you admit that you can't solve a bug without help? I mean, that's what tools are for, but still. Well, it sounds like you went through some weird, like, embedded AA thing. I'm totally addicted. I admit it. My name is Elise White and I love gadgets. And I get that. And yes, I think if you, if you look at, if, if what your company has available
Starting point is 00:25:55 to you is something that is 20, 30, 40, 50 years old, because that's really how they made it. They made them to last and they were such an expensive piece of equipment that that tank was protected, maintained, and so forth. And yes, it did take a long time, not only because the phosphorus tubes that they have in there to display were just so difficult to get the right intensity and to see everything. Oh, no, we had digital, but still. No, but some companies, they still don't have digital.
Starting point is 00:26:29 But the point is that, yes, there's so much that's in there that is a problem but if you get something that's been done in the last 10 years it's it's gonna it's not gonna take you three days well it'll take you maybe half a day depending on how many solder lines you need to you know how many little little wires you need to tack on. And if your hardware engineer was smart enough to think about the fact that at some point you might need to debug something in hardware. Well, we're going to see if it's faster. And I'm hoping it's not a day. I'm hoping it's 10 minutes. I ordered the Salia Logic, which is a mini logic analyzer, protocol analyzer.
Starting point is 00:27:06 And it costs $150, which is what I paid for it on Amazon. And I have this box here, and I haven't opened the box. Wow, you really haven't opened the box. It's still in the Amazon package. That's the beauty of unboxing things. Okay, so what time is it right now? So we can keep track Oh really, is this really going to be timed?
Starting point is 00:27:28 Yeah, let's really time it Okay, you got the time Okay, we're opening the box And my plan here is I have the computer running And I have pulled out all the lines So you can see the spy wires here Excellent
Starting point is 00:27:44 And Jen's going to connect up the scope The logic probe from Celia I have pulled out all the lines so you can see the spy wires here. Excellent. And Jen's going to connect up the scope, the logic probe from Celia, who didn't sponsor this, although they're welcome to next time. I believe they are a local company. Wow. So Celia comes in a box. So she's just opening up the outer leaf that slides off the side, and then you open a standard box that kind of folds open and inside there's a little black pod.
Starting point is 00:28:09 That's kind of a nice little case. It is. It will travel well and go well in my backpack. Indeed. Okay, they seem to be missing something. No. Really? Literally.
Starting point is 00:28:20 It's smaller than most of the GPS antennas I've used. It's about the size of like a Nano, an iPod Nano. It has all the little clippies. It has all the, there's like a whole wire set. The wire set is not just a bunch of jumper wires. It's been manufactured to just slide right onto this nano-sized pod. That's really quite cool. The thing that, so she's already going with attaching little clippers onto each wire,
Starting point is 00:28:57 but she doesn't need that. She just needs to focus on the first two wires, which are black and I think brown. Oh, see, I did black first because you always do ground first. Well, that's not ground, actually. What? If you look carefully, ground is labeled at the opposite end of black, of the black channel. I'm glad someone read the manual at some point. Okay, so the point of disclosure is i've actually used this tool numerous times
Starting point is 00:29:27 and what's nice about it is one i don't have to fight somebody for the scope i don't have to play rochambeau rock paper scissors lizard spock i don't have to do any of that it just you know for me right now it's just a pod that sits in my desk it's really small it's about the size of three iphones put together but in a decorative case that you would probably keep i don't know probably a hard drive oh that's the case but the actual unit is the actual unit is the size of an ipod nano yeahorably wincy. Nano, yeah. So once you connect the, you don't have to connect all of them. No, I just was going to do these four.
Starting point is 00:30:11 Okay, okay. Okay, there you go. Okay, so give me the iPod Nano Logic, now that you've attached all the bits and bobbles. It's really very cute. It is, and it's rubberized. It's aluminum. Yeah, and it's rubberized. On the bottom.
Starting point is 00:30:26 Yes. So it doesn't slide around. So all you're going to do, what's interesting about this one is if you look at the bottom, which has the logo of Logic, and you carefully look, it'll tell you which side is ground and which is the one pin. And the one pin is black, not the gray one. The gray is actually your ground. Okay, so I've just clipped that in. And while she's done that, I have downloaded the 13 megabyte installer from Celia.
Starting point is 00:30:58 And I'm clicking through to push install. And let's see, USB, of course. I don't have that many USB ports here here but that's okay i have one using a mac yes i'm using a mac okay but i have that uh hub over there okay there that side's yours what is it one of the mini usb things okay okay let's see. Please wait while System Wizard installs. Yes, yes. As admin, I give you permission to install this software. Okay. So the other thing that's interesting about this very minimal packaging that you get
Starting point is 00:31:35 is that it doesn't contain an instruction booklet. It doesn't contain a disk. It merely contains a single slip of paper that tells you where to download the software that you need. And you know, I didn't even read that. I just searched online. Yeah. It would be nice if I read manuals. Yes, that and my partner.
Starting point is 00:31:57 I wish he would also read instructions. Okay, so this little piece of paper, now that I'm looking at it, because the installer is still installing. Download and install, blah, blah, blah. Connect Logic to your computer and start the software. That was kind of obvious. Multicolored wire bundle to Logic. And then plug it into your device.
Starting point is 00:32:18 Make sure you do ground. Note that the gray wire is ground. Jen is entirely correct. And connect some test clips to the test leads. They may require considerable force before they click. I did find that. That is true. That I had to push pretty hard to put those little guys on.
Starting point is 00:32:37 Yep. And that is really all this little piece of paper just says. I mean, it's a tiny, it's like a little bit larger than a credit card. It's only printed on one side. Yep. It's really nothing. Okay. So my system here, I have spy signals on these three.
Starting point is 00:32:59 Okay. Okay, so I'm going to attach those two there with absolutely no idea of which one's which, and I will let... If you attach them to the same colors, they should be orange, yellow, and green. I should have a little... I totally moved them around. I'll move them back. No, no, no, we'll talk about what they are on that one, because I can unravel for you. Okay.
Starting point is 00:33:27 My install is finished and and it the program is pretty easy okay so i have a spy problem um and what we're going to look at are signals from two different sensors. They're both... Right, Jen's laughing like, I have a spy problem. My husband is actually James Bond. I work for Apple and... Yeah, not that sort of spy problem. An SPI driver problem. I have two devices, and they're both I2C slash SPI devices.
Starting point is 00:34:09 Which is great, because I can choose which protocol I want to use. But I've chosen SPI because I need high bandwidth. And so they're both on the same spy bus and they're fighting a bit. And I'm not sure why. So let's see. Ground. Let's see. Ground's over here.
Starting point is 00:34:26 You can see there's one black wire there. Yeah, I know. I should have pulled that over to the board you were looking at. And so this whole system is built on breadboards and a dev kit. It's a little easy to break. So there's always a possibility that the reason my two sensors aren't working is that I don't actually have them both connected. I did volt meter them out before Jen got here, but we never, we never can be quite sure. Okay. So in theory, we're attached now.
Starting point is 00:34:58 In theory, we're attached. Let's hope nothing explodes. That's the 4th of July show. Fire extinguishers and exploding capacitors. Okay, so the system's on, and is this little heartbeat blinking? The LED is on, but it's not blinking. The green one. Oh, yes, now I see the green one. Sorry. Okay.
Starting point is 00:35:24 The ribbon was on. So looking at the green one. Sorry. Okay. The ribbon was in the way. So looking at this program, I don't know. I'm just going to push start. I don't know what it did. Maybe we should have let Jen drive the program. That would have been really smart. Hmm. Well, first, my signals aren't going very fast.
Starting point is 00:35:45 I know my spy is around 100 kilohertz because I've been trying to debug this problem. And I can choose one mega samples or 500 mega samples. That's the length of the window I'm going to look at. Indeed. And so now when I push start, it takes a little while and all of my signals are at the same levels. I've got one that's high and one that's low and that's okay because actually the system's not talking to those sensors right now. So if you scroll out, understand that, and I know that you're on a Mac,
Starting point is 00:36:20 so I don't know necessarily how this would work, but you should be able to scroll in or tap in, and it'll zoom in and out. Okay, I'm actually running Windows on my Mac. Oh. But I set it up so that my sensor would start talking, and I push Start again, and it's going to collect some data, and now I can see that it is possibly changing. Let's try that again. So now I'm collecting data and one of those should be a clock and it's not moving. So let's see. Checking Jen's wiring. Will we need to pull out the DVM for this? I hope not I hope so, that's the title of the show
Starting point is 00:37:07 It's not like we don't have three of them sitting here on the desk So now the system is talking to one of the sensors The sensor is giving me data It's even maybe giving me reasonable data I've got it so it's just querying constantly, it's even maybe giving me reasonable data. I've got it so it's just querying constantly. It's a poll. But when I push the start button, I just get solid signals. So which ones do you have attached?
Starting point is 00:37:37 I have signal the black, the brown, and the orange. Okay, now I think there is a way that I can, oh yes, I can rename them. So this one is going to be Clock. That's what she's got black attached to. The brown I think is Miso which is
Starting point is 00:37:57 Slave Out, Master In. And that would make the red one Red one's connected, right? Mm-hmm. No, I don't think so. The red one's connected to... Oh, it's over there. Okay, so the red one must be connected to master out slave.
Starting point is 00:38:16 Yes. And then sometime we will put the channel selects. But first, let's get this one working. Push start. Nope. Nope, I got nothing. And if I ask Jen to come over here, she's going to knock over all of the mics. So now we're going to play a little bit of music for you as we figure this out. Thank God. Okay.
Starting point is 00:39:07 So music lasted only for a short period because all we did was turn off the program, unplug the USB, replug it back in, turn on the program, and poof, our data's there. Excellent. One thing that we can always do, at least for Logic, is that usually at the top left-hand corner, I believe, it'll tell you whether your pod's connected or not. So if you plug it in after or plug it in before, sometimes it won't be seen. So that makes me want to unplug my pod so I can see where that says it. It's usually up in the title bar, but I know you. Oh, it is, in fact. And I don't know whether it said connected or disconnected before.
Starting point is 00:39:51 Okay. Quick tip from Jen. There's information in the title bar. Well, and the have you turned it off and on again is usually the right way to start. Definitely relevant here. Okay, so now I see my clock. I see my processor talking to my peripheral, and I see my peripheral responding. From here, it's just a matter of looking at both of them,
Starting point is 00:40:21 making sure they aren't talking over each other. So one of the things that can be awkward for people when they first use it is usually the data is all zoomed out. And so by either scrolling in or scrolling out with your wheel, if you don't have a wheel, then usually tapping and clicking. Right clicking is making it go out and then clicking is making it go in. That was very intuitive actually. Yeah. And then you can just push, swipe left and right to move up and down the pattern itself. And then you just double click on the, I mean it says channel four and you just double click on it or click on it and it brings up the thing and lets you change the name, which is super handy.
Starting point is 00:41:06 So one of the other things that we should talk about is because this is a logic analyzer, which means that if you're having power issues with your signals, i.e. the signal isn't reaching a certain value, you're not going to see any data. Once again, this is where you would use your DVM or an oscilloscope. Yeah, and I2C is probably the worst for that because it doesn't always get to the upper state because it's one of these things where it requires capacitance to flow out in order to make it get from one level to another. Yeah, this is a digital tool. Yeah, so be aware that it's not going to tell you
Starting point is 00:41:48 if you're at 5 volts or not or 5.1 or 2. It will definitely, what you may end up seeing is if you don't have adequate power or voltage, you'll see that you won't get any signals. That is a good thing to remember. Okay, so I turned on the logic analyzer so that it says spy. Unfortunately, it really does want me to connect my enable. I don't know if we're going to do that, if we're just going to look a little bit closer at this. So what's interesting about logic is that it has all these protocol analyzers at your fingertips.
Starting point is 00:42:28 And Elle's probably already looked at the right-hand side and seen that, you know, on that little cogwheel, there's a pull-down menu and you'll see all these different protocol analyzers, I2C, SPI, CANBUS, just a bunch of different items. Yes. When I see the analyzer's word and then there's a little plus and I can choose from lots of things. My spy is there, so I'll add that one. Oh, and there's one wire. That's really hard to debug, so that's good to know. Yeah. And when you decide, you know, when you pick the one that you want, it'll open another dialog and it'll tell you,
Starting point is 00:43:01 hey, what signals are you using for the different core signals for this protocol? And since I'd already typed some of them in, it automatically identified the one that I put all lowercase MOSI and it made it uppercase and CLK ended up as clock. So it's actually named my signals for me. Right. And it'll rename them if you don't want them to, you know, if for some reason you decide that you just pick whatever they give you. There's some other configuration that needs to happen. One is, you know, for what you were doing, you needed to pick out some other options. Can you go through those up and then SPI came up, I chose my signal names,
Starting point is 00:43:47 and then I chose the cog next to spy, and it showed me the signal names again in case I wanted to change them. But it also had all of the normal driver choices you get when you write an SPI driver. Most significant bit, yes, that's what it was. Eight bits, yes, that's what my protocol is. And then there's CPOL and CPHA. So CPOL is the clock polarity and CPHA is when the data is valid. If you've never seen the wiki page for the serial peripheral interface, it is so worth it because it explains what those actually mean. That's good.
Starting point is 00:44:26 Okay. And then enable line is active low. Okay. So now I push start and it does some data gathering. Oh, I know my signals are really tiny again. So I blow up. Yeah. Jen pointed out all I have to do is click on stuff.
Starting point is 00:44:43 And look there. I'm sending it a 226. It's not going to tell it to me in hex. You can actually choose that. If you go back to your little cog for the analyzer, usually there's an option. If it's not there, then you can probably click on the signal that's showing you whatever format and right-click, and I think it'll give you that option. You know, if this is my most difficult thing, I'm going to stop complaining.
Starting point is 00:45:15 This is pretty cool. I'll figure out how to push it to hex because that's what most of my driver is in. This is neat. I can see it doing stuff, and now I can put on the other enable and watch the SPI for both chips and see what's going on. Right.
Starting point is 00:45:33 And if for some reason you don't like hex, I think it also supports octal and... Ooh, I could look at it in binary. ...and ASCII and binary. Of course, if I was going to look at it in binary, why would I bother to analyze the protocol? Maybe you just like numbers and you don't like signals. That's what makes me a software engineer. Well, I mean, I would say mission accomplished here.
Starting point is 00:46:00 I don't think you all want to listen to me debug my spy drivers. Maybe next time. Maybe we'll get to work on this now. Okay, great. You've been listening to Making Embedded Systems, the podcast, with Elysia and Jen. Thanks for joining us. Thanks. See you next time. And special thanks to our producer, Christopher White.
Starting point is 00:46:20 On our next show, I'll be speaking with Phil King about what an electrical engineer thinks a software developer should know about when working with hardware you can send comments about this show or questions for the next one on our website embedded.fm

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.