 Welcome to the Lady Aida. Hey everybody and welcome to my desk. It's me Lady Aida, broadcasting at Random Hacker Times. It's a little bit later, sometimes a little bit earlier, but we got a lot of stuff going on on my desk. First up, Mr. Lady Aida is behind the mic and video cam. Is there any news or updates for anything you want to talk to people? No, all the way that I have a mic on Kitto and you can hear, she likes playing with crinkle paper. Crinkle. And then she has this little squeaky thing and then there's a couple other things that make noise, but we'll see. If she says anything, I'll put the mic on. Baby is still alive, it's been 91 days. Yes, it's working out. Okay, over my desk. Okay, so let's go to the computer, I think, so we can get the computer stuff out of the way. So folks, I talked about this a couple of weeks or months ago. I've been updating all of our testers that were originally using a Teensie 3.6, which is a great processor and I would have kept using, but it's unobtainable right now. And we were using that tester bed to program our RP2040 boards, some ESP32 boards, our SAMDs, basically things with a microcontroller that were more complicated than just a sensor. If it's just a sensor, we'll use a metro Arduino, basically, to test it. But if you have to program it, you need something that has an SD card to hold the firmware and is fast enough to bit bang the SWD protocol or use USB host to communicate with the USB peripheral on the chip. But since you can't get the Teensie 3.6s anymore, I decided to try updating the design to use a Pico. And we showed this off on previous videos, so I won't go through the details. But basically, you know, you've got your RP2040, microSD card, piezo, USB host that we use bit banging to interface, semi-QT, the port that goes to the device under test. So like the SWD pins here, you can see UART, I2C, power controls, you can like turn on and off the power, character LCD reset button and mounting holes. And UART, RXTX, so you can, when I mess up which ways RXTX, we just switch, the flip the switch the other way and suddenly starts working. So folks wanted the files. The files are now on GitHub under RP2040 based TesterBrain's PCB. The only thing is it's super, super, super, super unsupported, mega unsupported. There's nothing more unsupported. It's like 11 out of 10 on the unsupported dial because there's no way for me to, you know, I use it for internal usage only, we don't sell it. It's just that some people might find this useful. There's some videos, the previous videos where we covered this thing. It's open source, go ahead, fabricated. I tried to make it as much surface mount as possible. So we put stuff like this through the oven, but you would have to hand solder. But it's not too bad. You also convert it to more through hole. And then, so we had already converted all of our RP2040 designs. Sorry, anything that we were programming in RP2040. So like the KB2040 tester, the Feather RP2040 tester now uses that brains as the board and it programs the RP2040 over USB host. And so this week, what we've been working on is, let's see, under test bed. This is also, again, it's like totally unsupported, but we publish it. It's a library that we use for testing stuff, both self-testing and programming. So what has been added this week is TAC and I are working on adding support to programming ESP32s. And you can program ESP32s over UART and they use this very simple, like packetized, like send a response over the ROM. And we use this for our web-based flasher. Of course, ESPTool uses this as well. And so this is just a port, basically, of ESPTool, this bootlump code that I wrote like forever ago. Sorry, this was originally part of the Arduino maker update or code and I hacked the heck out of it. So it is based on their code. I'll say that I modified it, but I was using this for programming the PyPortal because the PyPortal has it built in ESP32 and I wanted it to self-program that module. So this library works pretty well. You sync the data, you connect, and then you send UART data and it autobots. You can use up to like 921 kilobot. There's only one thing that we notice, which is this works wonderfully on the classic ESP32s. Like I'll show you on the PyPortal. So the PyPortal uses the classic ESP32 room. And this is like the first ESP32. And so you can do everything over the boot ROM directly. And this was, this could program just fine. But then I was like, well, the first thing I wanted to do was program the Feather V2s, these these new Feather boards that we have with the Pico ESP32. And I was like, the Pico ESP32 is just a room but smaller. It turns out actually, no, it's not. You do need to have the stub loader. You can't program it without the stub. And the stub is this piece of stub. It's this piece of code. So like the ROM loader can like do some basic stuff like like program flash and load stuff into memory. And I probably could eventually get it working with the ROM loader to program that Pico, but like, it's like really slow or something, or it's not responding. And I don't quite know why. So basically, the ROM loader is very bare bones. And what they're expecting you to do is that you boot up the loader, the ROM loader, and then you insert like a very small program that takes over the hardware and then does the rest of the boot loading out of RAM. And this is actually very similar to how the IMX series does it as well. The boot loader, when you program it from USB using like the NRF, sorry, the NXP programmer tool, I don't remember the name of it. It's from like three weeks ago, we were showing it off. We load TINA USB into the TINA UF2 into RAM. And then we execute from the location that we loaded it into. And then that actually does the programming, like you can only program into RAM. And then the RAM is where like it you jump into there. And then that takes takes care of the rest of it. So it's kind of like a secondary loading technique. So the flash has the step has to be flashed in for the these v2s, the minis and the Pico's, which we kind of want because again, I want to, I'm updating a bunch of designs that originally used the room module to use the mini or Pico module because it has like PSRAM built in and it's inexpensive. So to do that, what we're doing is you're loading this and stuff is like, while they say like, here's what you do, you know, it's not really documented what it is. So what you do is we run ESP tool to program the chip and we put when you call ESP tool, you add a dash T for trace mode, which is really nice. And trace mode gives you the full byte dump of like what it's sending and what's receiving. So like, you know, all the bytes that are sending and received. So like this is I think the beginning of like, okay, I'm going to write the stub and then this is actually the stub. The stub itself, I wouldn't extract from here. There's actually the hex code is in the Python. But just if you want to compare and contrast, like, well, what, you know, what does it look like when you're writing versus what I'm doing in C? So right now we're trying to figure out like, you know, we're trying to load the stub and execute. It's not quite working, but we'll get there. It's like, it's just a matter of you just go through the trace and eventually you get to everything in the trace. So that's the next steps. So then after that, we'll also do DAP. So if you want to, so it's RP2040, ESP32, AVR, we already have available, it's in a library called AVRprog, which I, you can program both. It's always telling me to do this. You can program AVRs over ICSP, which is like the reset mostly MISO S clock interface. And then the modern chips, like the AT-TINES, get programmed over UPDI. So we also have a port of UPDI, which I grabbed from somebody else's standalone thing. So that's all the AVRs. And then the last thing would be anything that uses SWDAP, which is like, you know, Cortex M0s, not the M7, because the M7 is like kind of complicated and has a built-in USB bootloader. And we also don't use SWDAP for the RP2040, because the RP2040, it has like this weird dual core DAP thing, which is like a multi-tap. And also the USB is like really simple. It's just mass storage. So we just use that. You know, for in general, by the way, that transport by which you program the chip usually doesn't have a huge impact on the speed, because chips are time bound by the amount of time it takes to flash or erase the flash memory. Like that's what takes time, not sending the data as much, although it, you know, you do want to have that as fast as possible. So for DAP, just for the folks who are interested, we do have, oh, that doesn't work out, ADA for DAP. So this is our code that you can program SAM chips and STMs and NRFs, all, you know, and then people maybe can add, hopefully, I mean, there's no poor request. But once in a while, people submit a PR, and they're like, hey, here's how to program a variant of one of these chips in situ. So slowly but steadily, you know, we're using Raspberry Pis to program the ESP32s, but you know, I'd love to, and the Raspberry Pis, believe me, they're great. But even those, it's like they can get flaky and they can have power dips, whereas the having something that's fully firmware, solid state, there's no operating system. Even if it's tiny bit slower, you can have multiple of them running at the same time, whereas the Raspberry Pis are kind of like, they're not delicate, but they're, you know, you can't just unplug them and they can get corrupted and the SD can get full. So it's one of the things that we're planning on doing. Okay, question. Because this came up before, and I think I think you might want to put a note for this. So the PCB designs that help at our products, the RB2040 Bones files. How can folks get those? Because I don't think we have it as a specific I haven't published it. You haven't published it yet, because it's not tested. I have no idea if it works. Okay. All right. So that's the reason why folks can't find it. Yes. Okay. But it will be like all of our stuff. Oh, yeah, it will be. But like I would, you know, I don't want to publish something and it doesn't like I should at least get it working somewhat like the tester brain somewhat works. So I'll tell you, I'm talking to the previous the member the not the this project that you're talking about the the the RB2040 Feather Bones file. Yeah, I'm saying I haven't tested it. You haven't tested it. I'm not going to publish it. I'm only publishing this because I've tested it. Okay. Yeah. So that's our so yeah. Yeah, I don't publish stuff until I've at least made a prototype. There you go. All right. So when you do that, let me know more and I'll get the work done. So there's a couple of video. We'll do video. Yeah. It's basically the feather though. It's like it's not that different. You can take the feather and Okay. Any other questions? Nope. Okay. Is that everything? Sorry. I don't have the text in front of me. Is that everything I've had in me? Well, let's see. For the greats, we have three during the great search. This is this week. More RPR2040 Tester Brands did the glamorous. You moved over GitHub. Yeah. Yeah. Let's hit the great search. Okay. So it's great search. The great search brought to you by Digikey and Aida Fruit. Every single week, Lady Aida, user power of engineering to help you. Yes, you find the things that you want on digikey.com. Lady Aida. What is the great search this week? Okay. This week, I am looking to replace the low cost class D amplifier that I've been using in so many of my designs. It's gone. NRND not recommended for new designs. And one thing I've learned over the chip shortage is that once you start seeing that, try to get away from that part as quickly as possible because it can, you know, it used to be that things would go NRND, but you'd still be able to get them for a while. I'm actually a little nervous about that now because I got bit a couple times by parts that were NRND and then immediately disappeared and evaporated and there was no last time by. So let's go to the computer real fast and I'll show off this chip and then I'll go to the overhead later. So on a lot of our boards, we use this little speaker. This is a 7.5 millimeter by 7.5 millimeter speaker. They're actually available on Digikey too. They're magnetic buzzers and they, they're a jelly bean part. They come in a variety of different makes and they're going to about like 50, 60 cents in quantity. So these are, these are a great alternative to plug-in speakers. They're inexpensive. As you see, they're fully surface mount. They come in tape and reel. So unlike piezo buzzers, you can solder them in and they're fairly loud. The only thing that's a little bit iffy about them is they use a fair amount of current. They, they are magnetic and they require 100 milliamps. So it's not a ton of current, but it means that you can't just drive them from micro controller pin. You're not going to, you're not going to get the nice strong tones. That's different than piezos, which you pretty much can drive from a pin. So what we've always done is, as you see here, this is the buzzer and this is the audio coming out here and this is the the two pins of the inductor inside. There's a little disc that vibrates is we have this PAM 8301 diodes, ink, class D amplifier with like six pins. It's a very inexpensive part. It's like 15 cents and it basically has like audio in you, you know, put a 0.1 micro farad cap on the inside because it's very high impedance and so you don't need a big blocking cap. And then you have like one shutdown pin, power ground and then two class D bridge tied load outputs. And what's nice about the class D is, you know, first off, it is fairly power efficient. It doesn't heat up the coil by having a bias go through it because class D it's differential. You don't need blocking caps. It's just overall like a really nice design. And like I said, it's very inexpensive at about 15 cents. Without any, you know, you only need one, I put like a filter on the inside, but basically you only need a resistor and a capacitor to run this thing. It's low on component cost. It's easy to pick in place. It's about the same price as a couple transistors. So it's like, why don't you just do a class AB? It's about the same price. And you get like a class D performance. It doesn't sound too bad either. So let me go, I don't know if this is going to work, but hold on, let me, oops, go here. So this is, let's see, it's got hooked. So this is the speaker. I don't know if you can hear that, but it's on a macro pad. And it's just kind of doing a little booby boppy. And then you can do one thing I like to do for a lot of projects is I just have a little coin, like a little indicator coin. So it's, it's like a, like a beep. It's not a very loud effect. And that's again, using the PAM 8, you know, 8301 with this, this little amplifier. Okay, great. But you know, I'm going to dig a key and they helpfully tell me, well, there's lots in stock, but they're not recommended for new designs. And the substitute is actually like, there isn't any of the substitute in stock either. So I thought what we would do is we would find a substitute for this. So what we're looking for is, you know, it's going to be a class D mono because I only like, I need to be small and cheap and it's the smallest and cheapest is going to be always mono output class D. The power per channel, I mean, as long as it can drive basically, you know, 8 ohms, the wattage doesn't really matter. Another nice thing about this amp is it went, it would run from about 2.5 to five and a half volts. And so you can use it with 3.3 or five volt power and logic. In fact, what I would often do is power the amplifier from five volts or battery, whatever is the highest voltage I have on the board. But then, you know, the logic level that goes into it is three. And of course, I want to be surface mount. The package, I don't know, you know, I'm not able to get thought 236. And in fact, actually, sorry, well, yeah, quickly, I'll go here. So at dives.com, you can search for the parks as like, well, what do you know, what do they have? And they also say, yeah, it's not recommended for new designs. And if you go to the datasheet, they do have a couple recommendations, which will which we'll see. So this is another good place to go look for recommendations at the top of the datasheet. They'll, you know, dives are going to have a better idea of what they stock, that's a better option. And then this is the just usage, because you can see it's like, I love this thing that's so simple, you just have like, you know, coupling cap and power supply, speaker out, shut down, you're done. Stop. Don't need anything else. No gigantic blocking caps. Okay, so let's find surface mount mono class D in the amplifier category. We're going to look for active, because that's what we want. And normally stocking. So let's see what's available. And pricing isn't really kind of important to me. So I'm going to look for pricing at like 5000 pieces or more. So there's a couple of good options. So one of the options that is recommended, so this is the unfortunate thing is that they're like, okay, why don't you use the 8013 or 812, you know, 8013 or 8014. Well, these are very affordable. They're about 20 cents. But they're both BGA package. Now, I will say that the BGA package for this one in particular, you know, if you don't need to use the end pin, if you don't mind having it be on all the time, you can tie end to VDD in that way you don't have to, because this is a 0.4 millimeter pitch. So, you know, you're you're dealing with either a fan out or very, or like a via in ball pad. I'm not a huge fan, because I like to keep my manufacturing simple. The 8014 is a little bit nicer, because at least the center pad is the power PVDD. So, you know, yes, it is also a BGA, but at least you can tie the center pad out here. And then, you know, because you're probably going to be using the same power as VDD. But we'd like to avoid that. So the next options are the 8302 and the 8304. Both of these are sorry, the 80304 is actually recommended. So the 8302 is a little bit older. And I'll show you the comparison. It's actually using the 8302 a lot. So one thing that is nice is by the way, the 8304 is available in, if I needed it, that small space, it's available in this tiny DFN 3030. The biggest difference kind of for the so 8302 and 8304, let's go to the right here, is the 8304 will give you three watts into four ohms. That's another thing. These can go into four ohms, which is quite a bit. But the voltage range is a little bit different. This one, you know, it's closer to three volts. This one goes down to two. Are you running it off of two AA batteries? Then maybe you would want to use the 8302. Whereas if you can guarantee a 3.3 volt power supply minimum, you can go with the 8304. Both of these actually are pin compatible as well. And then the PAM 8304 also is available in DFN. This is another option. This wasn't in stock, but I did take a look at it. This is a little bit, you know, the part number, you know, 8201.1 is like, okay, they're obviously kind of getting in on that PAM 83 series. Also very similar, pretty much the same setup. There is differential inputs with this resistor and capacitors and then output driver. This one just has like, I guess they just have a standard package that they use. But that said, so what I ended up doing is, I do like the 8304, but the fact that the 8302 is just like there's more in stock, and I do already stock it, I'm pretty much just going to redesign everything that used the 8301 to use the 8302. And you know, it's basically the same. It's actually the same gain as well. So what I did, if you can go to the overhead, is I have a, this is a PAM, hold on, focus lock. This is a PAM 8302 amplifier. And you know, inside there is 24 dB of gain. And I just took off the, I had a terminal block here, looked like this before. And I just hot aired it off and soldered on one of those little speakers. And then on the original design, there was a little potentiometer. But what I did is I kind of removed, you know, to mimic what the 8301 would have. I replaced the input resistors and capacitors and then put a little high pass, sorry, a low pass filter here because the output from this RP2040 is the high frequency PWM. So this comes in, the high frequency is kind of filtered a little bit to smooth it out. Even though the Class D kind of, you know, obviously it's high frequency as well, but it does remove a little bit of the hiss. And then in here, there's a little bit of a input gain modifier. So the default gain that these have is 24 dB, which is like five times gain. I can't remember without my head. But I want one to one gain because I'm actually getting 3.3 volts output from here. So this is actually kind of like a, it's like a current booster voltage follower. It's actually very, not really amplifying. I mean, it's current amplifying, but it's not voltage amplifying. So what you can do with these, I'll show you this one. One of the datasheets does not have a diagram of the internals, but one of them does. And I think it's this one. I'll show you it. Oh, can you go to the computer? Sorry. So this is the inside. And so, you know, you're like, okay, here's how you wire it up. You have differential input. They have a blocking cap. But what's inside actually is here is that, sorry, it's 15 gain. So there's this 15 times gain because they're expecting you to give it, you know, a couple millivolts, maybe 100 millivolts peak to peak signal, and then it boosts it up and drives your output to three, you know, plus or minus five volts differentially. However, because I, my input is three volts peak to peak already, and I want basically three volts output. What you can do is you add another resistor here, 150k approximately, and that turns this gain into one. So this normally is 150k over 10k gain. So you add another resistor on the input. And so let me show you what that looks like here. This is 300k. Ignore these values, because these values are not correct. But by adding, like if I have this be, you know, like 140k, this is 140k, and this would actually be 0.1 microfarad. Now I have unit gain. You still have to, even if you have, by the way, it's differential input, if you have single-ended input going into this chip, you'll still need to have this filter going to ground to balance out the differential input. But now I've got the same 3.3 volt in, 3.3 volt out, driving directly to my speaker. You don't need to have a ferric capacitor output, but it's nice if you can fit it on your board. Still very inexpensive, and I always get very nice output from this. Also good for little speakers. And yeah, it's up to three watts. So you can use this for, you know, fairly large for 8 ohm speakers. So this is my pick for debate search. That's a great search. Alrighty, let's do some questions. Are you ready? Is there any reason that an end user might want to reflash what these tester programmer boards are doing, perhaps security issues or Wi-Fi devices? I mean, they're for anything. I mean, they're just, if you want to automate any kind of programming and testing, that's what they're for. I use them for programming, but it's got USB host, SD, LCD button, you know, it could be useful for a lot of things. Does logic voltage versus power voltage matter? Like you said, use bat 5 volts and 3.3 volt logic, but would 3 volt input and 3.3 volt logic work? Yeah, I mean, you just want to have the power, you know, the power should be as high as the best power supply you've got, right? Because you're driving a speaker, you need a lot of current. But the signal, the analog signal can be any voltage. Okay, next up. With the iSpy connector, is there a library or documentation to use a MEMC over SPI? A MEMC? What did they say? Yeah, MEMCS, sorry. Oh, MEMCS? Well, it's just, if there's an external flash memory, you can use that as the chip select. Okay, and then next up. What's the difference between DFN and QFN? I don't understand the name of convention for these SM and D footprints. The D is for dual, so there's pins only on two sides. At QFN, there's pins on all four sides. Okay. Why reduce the gain to one? Because my input is signal is 3.3 volts, and my power supply is basically also 3.3 volts. And so I don't want to amplify the voltage, I just want to amplify the current. All right. Looks like them's the question. Okay. All right, well, thank you everybody. Kiddo fell asleep here, so no more... Too much excitement. No more crinkler squeaky sounds. She's slaying her. Time to pass. So we'll see everybody during the week. We got some shows and more. Lots of fun surprises. Thanks for joining us on this Sunday night. That is a desk of lady. Good night, everybody. Have a great week.