 and welcome to Scolidiata. Hey, buddy, and welcome to my desk. It's me, Lady Ada, doing some electronics. Went outside, it was a beautiful day today and of course, yesterday as well. I love that spring has sprung. Means it's also time for 8051s. That's a little rhyme there. I'm working on a QDPI CH552P. So let's go to the overhead. I'll just show it off real fast in case people don't know the QDPI format. So these are the QDPI boards. It's based off of the shell format that Seed came up with, which I just thought was so cute and adorable. And it's basically the same size as most of our, you know, stomach QT boards about like, you know, almost, well, it's a little bit less than an inch by 0.7 inches. It's got like cast-related pads and it's got the same pins in this, you know, this location, it's like a little micro feather kind of. It's got A0 through A3, so you need like four analog inputs, data clock for I squared C, Rx and Tx for hardware UART, and then hardware SPI pins as clock can be so mostly three volt, ground and five volts. It doesn't have battery charging and it doesn't have like an exposed reset. But, you know, what I did to the shell series was I added a stomach QT port kind of in this location always. And so it makes it like so easy to plug and play all sorts of sensors like this HT20 or like I've got a SGP30 here, whatever. And then there's like a little Neopixel here and then the chip here, like I said, is the CH552P. Just kind of like a change, because, you know, for recently what I've been doing is doing more and more complicated boards, like, you know, we had the ESP32S2 and S3 and the Pico and, you know, we started with the SAMD21, which was, you know, a fairly, it's a Cortex-M0 chip. I don't think we did any 8-bit QT-pies. I was thinking about maybe doing a 32, 4-based one, but never quite finished it. But we do have here, like I said, this is an 8-bit microcontroller at 8051 core, but it has native USB and it's very inexpensive. It's like famous as like a 20 to 40 cent chip. The 20 cent, 25 cent version has 8 pins only and that's like a chill too few. So it's a little bit less than I like pins, but it's still a fairly good number. Maybe let's go to the computer and I can show the schematic. So this is the chip, the CH552P. One cool thing about it has a built-in 3.3 volt regulator. I'm not using it in this case because I actually couldn't find any specs on how much current it provides, but it's probably not more than like 50 or 100 microampere, a billion piers. And I really wanted to have like, you know, our kind of standard 300, 500 milliamp power supply because it's, I don't know. I mean, I can't deal with that, but I think if you were really make a very low cost board, you could skip it and then you tie VCC to five volts and then V33 is then your 3.3 volt regulator out. But in this case, you tie them together and then there's a, you know, my AP2212 over here, super low dropout regulator. Like I said, there's built-in native USB, which is pretty amazing for a 8051 core, but yeah, a D plus, D minus. And the D plus pin is also used as the boot loader entry. It also has a USB boot loader. It doesn't use mass storage. It's not like UF2 and there's not enough space to implement UF2 and I don't even think it has enough RAM to do mass storage anyways. But the HAD boot loader built in, it's like an HAD, it's low level USB. And to get into boot loader mode, you tie the D plus pin high and then you release it after a couple seconds or whatever and then it will then re enumerate into boot loader mode for like 10 seconds and then leave boot loader mode. There's PWMs. You see, I tried to label here all the pins with their capabilities. There's a couple analog inputs. Only thing that's a little annoying is that there's only four analog inputs. So they're labeled here. So this is like A and one, A and in two, A and three and A and zero. So there's exactly four analog inputs, which is perfect because the QDPI only has like four labeled analog input pins, but there's one pin gets shared. The Mosey pin is the same as the analog in pins. There's one like shared pin on the QDPI, which is like not ideal, but I really wanted to have the hardware peripherals on the hardware peripheral pins and I wanted to have all the analog pins be analog pins. So like, this is the trade-off. And then one pin I took for the NeoPixel because this pin kind of has the fewest capabilities, really. Okay, and so there's one NeoPixel and then there's a I squared C output on the STEMI QT port. There's a boot pin and then there's also a reset pin. Note that the reset is inverted. You pull it high to reset. This is not, it didn't catch me, but it is backwards from like every other microcontroller. So watch out for that. And then the layout wasn't too hard. You know, it's single-sided. This is good here. And then I'll turn on the silkscreen and then turn off the bottom. It's a two-layer board, just kind of nice. So USB type-C, the 5.1 ohm resistors, a little protection diode just to, you know, give the five-volt pin output only. Regulator section, NeoPixel. Two buttons, one for reset, one for bootloader mode because again, you can't double-click to reset. You have to do that D plus pulled high thing. The chip itself and the JSTSH4, the STEMI QT port. And it fits and it works fine. So I've been playing around with this chip and I'm using the CH55X-DUINO core written by Dicheng Sun who worked on us a while ago on a bunch of Bluetooth projects. So it's cool to see that he's still doing a lot of stuff. He was at NYU ITP, I think. And so this is a MCS-8051 core USB. So what's nice about this is that this lets you use the Arduino IDE to write code for this 8051 core chip. One downside is that the compiler is a free compiler and does not support C++. It's a C-only compiler. So what happens is that you end up with you know, this is what we would normally have for HT chip where you have like our library and you instantiate and then you like call like object.begin and you have serial.printlin and like dot dot dot because you have object and then you call the constructor or the, sorry, the member functions or you access the member variables. Whereas for the CH552, well, something like digital write is pretty simple. Like, and then I have pins defined. There's no pin definition. So I had to like make a pound define list for all the pins because the pin numbers, they don't get translated. There's no variant. But when you talked about something like I squared C, there's no wire dot function. There's no wire object. And there isn't even like really, you know, the I squared C interface is very, very low level. So for example, I had to write a function called write bytes that would take an array and it would like do the acting and knacking. And it's like, it does all the work. It has an I squared C harder peripheral but it doesn't have like as many wrapper layers. And so you're going to do a lot more low level work. So this is definitely not like, I wouldn't actually call it Arduino. I'd call it like you're using the Arduino like program to compile, but it's not, it's not like you can use any Arduino libraries. Like no Arduino library will work because almost every Arduino library requires C++ compiler. However, once I got write byte and read byte working and they work pretty well, then I was able to be like, okay, well, I want to like read an I squared C register and then I can do scan and then I can do begin. Actually, in this case it's using software I squared C, I guess not hardware I squared C, I don't know. I don't know why, maybe it was easier to just do that. But then I was actually able to write an I squared C like micro driver. And you just see instead of like wire dot write, I'm using wire underscore write because again, I have that C function instead. But then this is what it looks like. You know, I've got this, you know, wired up this I squared C sensor plugged in. I breathe on it and you see the humidity going up. There's also some basic support for neopixels. So hold on, I did get it like a couple, I got a couple of quick demos going servo works. Let's do neopixel. Neopixel again, you know, it's all C and so I had to kind of write all, rewrite all the functions over again like the set pixel color. And then, you know, the way we deal with this is that we have just one array for the LED data. And then we kind of like pulse it all out at once. But you know, I kind of wrote like C-ish versions of all the functions people expect like set brightness and begin. And then, you know, you can rewrite the rainbow cycle which does again, neopixel swirl. And in this case, you know, you set the pins. So again, one thing that's a little tricky is the pin. Second, let me do the back. The pin labels for the, you know, the second version I put them on the back because again, the board definition doesn't know like MOSI or A0. Instead, it only knows like pin P1.5 or P1.3 or P1.6 which you call it with the underscore. So in this case, the neopixel pin is P1.0. And then after you install the support, you just select the generic CH552 board. And then my Arduino install is like crazy slow. So it's gonna take a second. I think I have like five bazillion libraries. And then I want CDC, USB upload. And then one thing I've noticed, you definitely have to select 16 megahertz internal 3.3. This is a 3.3 not five volt mic controller. And then let's try uploading this. Let's see if this live demo works. But what is nice is it does the auto reset stuff you expect auto upload. All right, let's see. Okay, so auto up, it's uploading auto reset. And then if we go to the overhead, you'll see it's doing the classic neopixel swirl. So things that work are CDC output to get serial output, neopixels work, servo works, SPI works, I squared C works. But again, you have to rewrite all your drivers. So what would this be good for? It's like, if you needed a USB interface chip that was like, you know, you did maybe wanna reprogram it, but it's okay if it's like not trivial. It has to fit within the memory capabilities of the chip. So go to the computer again. So the, oh, sorry, a baby, I just demanded. Can you go to the computer real fast? Yeah, there's a baby. So there's 16K of flash. And then it looks like there's one and a quarter K of RAM, which is actually pretty good. You'll need that much RAM for doing USB. So like you probably use about half of it. And you have a certain number of pins, but not all the pins are available. Because like I said, every package is different. The ADC's only four, there's only four channels and they're eight bits. There was capacitive touch. I haven't tested it, to be honest. And like I said, the package I'm using is the QFN 16. It's a little rare, but it's the only one that fits so nicely, basic top, which fits very nicely on the QDPI and doesn't require a four-layer board. So I've ordered the panels. I tested all the GPI, I tested all those capabilities. I mean, I think this is like kind of like a funky, chip, like I said, you're not gonna be anything else for the price. Like if you need to make something and you want no LDO, no crystal, like no passives really needed, it's just like ready to go USB and it can do bit twiddling. It can do, I think, HID if you use, maybe not through Arduino, but through the SDK, although maybe you could just throw the HID code in there. Cause I know people have been using it with some like small keyboards, macropads. Because you could have a timer do the pin matrix muxing or you could use expanders. And then like I said, you have keyboard input. So I'm not gonna use this for making trinkets, I don't think because I like boards that can run circuit Python or Arduino and like I definitely want to be able to use all of my library code. But I think if somebody wanted to make like, I was talking to Phil, maybe like a USB business card and you want it to be like 99 cents for the entire bill of materials, you could do it. You can make like, you know, $1 business card that has a USB interface by using this chip because it's just so cheap, you know, what it would do, I don't know, but it is possible. But you know, to head off questions, like no, it's never gonna run circuit Python. Will ever have a C++ compiler, maybe, but somebody's gotta find a free or open source C++ compiler that supports this chip set. It's kind of unlikely. And I'm not gonna do that work and I'm not gonna do any other Arduino porting. This is mostly just, I think, a fun toy. I thought it'd be cute to have this very low cost chip in a format that, you know, you could then use accessories. I like that, you know, you can plug in I-squared C devices and like do little I-squared C things with it, maybe a little Neopixel stuff. Anyway, so that's the, that's just what I've been working on this desk. So, you know, I ordered that PCB and I got the tester designed this morning. So, I do wanna cycle back and get to the C6. But I want, you know, this was ready to go and very easy. So I wanted to kind of polish it off and get off my desk. Think I designed this back in like 2021, but then, you know, the CH552 chips were like impossible to get. I do also wanna next take a look at the WCHS same company makes like a Cortex, I think M0 chip called like the CH32V00 or something. And it's also like a super low cost Cortex. Maybe I'll make a feather or like an ITBZ or a QDPI with that also just for like the fun of like, wow, it's a 50 cent Cortex M0 that's like got everything built in. Okay, so that's, what's my desk? And so let's go to the great search. The great search watching by DigiKey and Adaford single-legally data brings you the power of her brain to find things on DigiKey.com. We call it the segment of great search. Lady Ada, take it away. Okay, gigantic pulsing brain of searching for parts. Okay, so this, we sometimes look on social media and I see like people like asking folks like, oh, you know, how do I repair this or where do I get something? This person actually did find an alternative to this power supply, but is this such a common issue that I've seen for people who are repairing like old synthesizers or old computers, old test equipment or just like anything electronic scene old that might be like kind of intense and isn't just like simple battery power. It's not that uncommon to have like crazy weird power supplies. So this is, you know, I don't know what this is. It's like extra super-emotion. What is this extra super-emotion? I guess it's a CRT gaming system. Oh, it's a Mac scan converter. Whoa, I don't remember this at all. Whoa, I like how it's like, this is the company. I know like we can get more information about it. So I guess it's some scan converter. Just cool. So this older piece of equipment requires a power supply that gives it plus and minus 12 volts as well as plus five volts. And at like pretty high currents too, not like these 300 milliamps. It's like they want three amps, five volts, two amps at plus 12 and then, you know, point three amps at negative 12. So you definitely could take like an ITX power supply and, you know, connect, make a connector and, you know, design your own power supply. But in this case, this person was recapping the power supply because the capacitors had gone bad. Looks like they was even leaking a little bit of electrolyte out there. But it's also possible to get new power supplies, even ones for these kinds of weird interfaces. So let's take a look. So first off, you always want to look at the label for all the powers and currents. So like I said, there's three power supply voltages, five volt, 12 volt and negative 12 volt. And it needs, you know, as you expect because it's more than one voltage, it has a strange connector. In this case, it's a DIN connector. I don't think they showed the DIN connector, but there is a diagram, which is really nice. We're gonna need this diagram. So then let's go to AC DC power supply. Okay, couple options. Not a hydrate. Okay, so there's AC DC converters and these are like modules and they have tons of them. Often these are called like mean wells. They're mounted inside of an enclosure and they will absolutely work, but they often have exposed mains wire over here. So they're definitely not safe. They're good if you're making like a device that has a power input or inlet and you know how to handle these voltages and you won't mess up confusing the hot and the neutral and the ground. But for mere mortals, what you really want is something that takes like an IEC plug, which these tend not to and it again gives you that connector. So there's a kind of like, this is did you sell stuff for engineering and product design so you'll be able to get little modules and stuff, but we want a wall power adapter, something that plugs into AC and gives you that voltage out. Okay, so we definitely want something in stock. So let's click in stock, which will cut down a lot of options. Next up, I don't actually care if it's active or not because let's say we only get one. I don't care if it's like, this is the last time buy or whatever, like we'll work cool with whatever because we're only gonna get one. For voltage input, I'm not gonna be picky because I'm in the U.S. I don't really, as long as it covers 110 and pretty much everything is gonna cover 110, 112 volts, 150 volts, I'm good to go. Okay, so next we want the voltage output. This is the important part because remember, we want plus five, plus 12 and negative 12. So if you look through the list, there is separated by commas, sometimes multiple voltages in this case, 24, five, negative 15, 55, 62, whatever. But up here, there is five, 24, negative 12, and then five, 12, negative 12, just what we want. Bam. And that really cuts down. There's not a lot of options. So if you couldn't find something with the exact same connector, you could still get this. If you did have the outputs and the outputs are the right currents, you can always cut the connector off and then splice on your own connector, but it's worth checking if they have the connector we want. So first up, I also have to make sure that I have the current outputs necessary. In this case, I need three amps at five volts and 12 volts, two amps, just like quite a bit. So let's look at what's available. So it looks like there's some with this DIN and some with this weird ass rectangular connector, but they do have, you know, seven total and they have a bunch that are the DINs. And so let me just select DIN connector, that's round connector. And next I want one that has, what was it? Five volts, three amps. So if we look at the current output here, you want to match it up. So like five here is four amps output. This is five volts, two point four amps, and this one's two point, sorry, this is five five, but the 12 volt is only one and a half amps. So this one wouldn't be that good. This one would be okay because it has the right amount of current. So you could do this one, but there's only one in stock. And then this one is the one that had the right amount of current. To be honest, you might be able to get away with this one. Well, and actually the 12 volt is also one amp. So you definitely need to have this one, 50 watt, because it needs to have enough current from the five, 12 and negative 12. This is way, this is over specced, but like it's always okay to have more current capabilities as long as it is within the voltage range. So let's now check the connector. So meanwhile, like I mentioned, they're top supplier of beefy power supplies and they're really good at it. They've been doing it for a long time. Looks like they have a lot of ones in this family and you can select different Whipple and rated efficiencies, but like this one stopped and I don't really care too much about the efficiency. And then they have the connector. Okay, so here's another thing you gotta watch out for. So DIN connectors are not labeled the way you'd expect like one, two, three, four, five. They actually like alternate. And this is also upside down. So we wanna rotate this. So I'm gonna just go, doot, doot. So now it's upside down, but that means you read it backwards, but at least that way you can matchy matchy. Matchy matchy. So the first pin, so this leftmost pin and the bottom most pin is called return, which is ground. So pin one and pin two is in fact common ground. So that's good. And then the second pin here is negative 12. So that's number four. And that is in fact a negative V out. And then the, like whatever, four o'clock pin is plus 12 volts. So that's number five and that's the positive voltage. And then the rightmost pin at three o'clock is plus five volts. And yeah, pin three is five volts. So yeah, this power supply will do the job quite well. So this is my pick for the great search. It's great search. All right, that's our show. We're gonna go and take care of a baby. So thanks for joining us. We'll see everybody throughout the week we got. JP show, 3D printing, show and tell, ask an engineer. Great search. Scott's deep dive. Deep dives, lots of videos. You name it, we got it going on. We'll see you all during the week. This week, thanks everybody. Bye, buddy.