 Welcome, just lady. Hey, buddy. And welcome to my desk. It's me Lady Ada with me. Mr. Lady Ada on camera control I got some harder. I've been working on I wanted to show off a mr. Lady. Did you want to do a little intro first? Well, um, later on when Lady shown the Circuit pirate this was the photo we posted up. So I thought it was a glimpse into what's going on here Designing electronics taking care of kiddo doing all the things eagle cat is charging her two seats thinks that's unfair But that's okay, and we also posted up about this Really cool project and talk about the logo and more. Yeah, but without further ado. Yeah What's with you? Okay, so We stock the well we used to stock the bus pirate in the Adaford Chapel You don't have to go to the computer because you can see it. This is the bus pirate. She's a really cool like hacking toolkit that uses USB serial command you can actually see the FTDI chip here public domain and it was yet. No, well Designed by in Leza. This is version 3.6 and design you can see well when we go to the computer. I'll see it's designed April 2012 So this is like 10 years old but was really cool is that like there were a lot of people who wrote scripts and While I think a lot of the functionality of like having a USB to bus device Has been replicated by like the bigno Which we stock you to I f The FT2 3 2h there are a couple things that the bus pirate was really good for like it It had a lot of protocols built in which I thought was kind of neat So like you could have like it can act like a mini device or keyboard and it kind of knew everything You didn't have to like bit bang all of it It also had a couple neat things like the chip used the pic 12 f It's 5 volt input compliance. So you use a 3 volt chip You can use the 5 volt signals and so that was kind of nice because you could you could use it with Devices that you know like LCDs or you know, maybe e-proms that were 5 volt logic But unfortunately was discontinued. We've been stocking it for a very long time And we went to do a reorder with seed and they were like oh because of the chip shortage or something or maybe There's currently delay. We don't know when we're gonna get more Little bit of a buffer and so for now, it's discontinued, you know sometimes things to get de-discontinued in the Adafruit shop, but I do I don't want to promise something unless we have Some good sense that we'll get it again, and I don't know when that's going to be There's also the bus parrot for but I guess that's also not available And you know right now Let's go to the computer because I'm just going to I'm gonna do a bunch of computer stuff. So So right now, you know, we still have the page up, but we recommend people check out the Goodfet by Travis Goodspeed Also out of stock, but probably we will be able to get again very similar device USB serial converter to like a toggler One thing that was that was really nice was that this could do JTAG so does like I it was I to I squirt see one wire SPI like one wire for example is a very rare thing for USB to like bus devices to do because it's a freaky thing MIDI PC keyboard LCDs Pulse with modulator frequency generator, you know, it's just like bus traffic sniffers a Lot of cool stuff. Oh, you know could act as an AVR programmer It just had a lot of like nifty things built into it a lot of support. So we really like this we couldn't get it anymore and Instead of just running the board on my own and trying to like get the chips, which I you know, I could probably do it I can probably refabricate it Based on the files, which are all public domain and under creative commons zero Which is actually really neat. It's pretty rare to see Devices or CC zero that means like completely Free for all you can use it for any purpose whatsoever And but you know public domain and just very cool that Ian Leslie released it that way But I was thinking, you know instead of just remaking this because you know There's this bus pirate for and then like maybe there's better chips. Anyways, I thought let's maybe remake the design because You know actually a few years ago So unfortunately the files got we written because you know, they were I Had I did I worked on the files in 2017 and then I updated that the eagle cat files And so that's why it says 2023 but originally they were in 2017 I had this idea when we first did The RP 20 sorry that circuit Python for the samd 21 I had this idea like oh well Maybe we could like kind of like make a version like something that was like a tool like a hacking tool thing But it would be running circuit Python and I didn't think it would mimic the bus pirate I just thought it would be like the same shape and maybe you'd be able to like run commands with the commands would be in a Python script rather than USB serial converted and I worked on this for a bit and Let's just do you can kind of see on you turn on the Whenever I video I like to turn off the T doc you layer because I feel like it It shows the components best Um, so we had a Hold on Hey, that's much clearer. Okay, so you had a micro USB a Neo pixel This is some SPI flash that connected to the samd 21 the same chip used in like the metro M zero and the cutie pie We set button Three volts internal three volt external five old external power supply these are switchable Which I feel like there's like a couple little details about the bus power really neat like the three volt power supply the five volt Power supply to your device. You could switch on and off by enabling disabling The regulators, which is which is really handy. Sometimes you have chips that are like get into a freaky state and you're less like Okay, gonna just power cycle you and they're like back to normal Crystal analog switch and then that two by five header and you know resistors and you know There's not actually a lot on the bus power a lot of it, you know is firmware It actually got A little of that code written that would have it do like some of the basic I squared C and SPI and bit banging toggling Functionality, but the same d21 was really minimal and I didn't want to write the code Narduino I was like, oh, let's see if I can write it all in circuit pythons I could actually get it done with you know, less of a year and I ran out of memory SRAM and I was like, well, you know, like there is a bus pirate and like what was the point of doing this anyways And so I kind of shelved it because It didn't you know, there wasn't much purpose when you could still get the bus pirate But then you know now that you can't get it. I thought like last week I was chatting with Um, ten newt scott the lead circuit python developer and he kind of wanted a little he wanted something to distract him He was like, oh, do you have any jody projects that? You can distract me with because I don't want to work on this IMX stuff for a week or two and I said, well, you know There was this circuit pirate thing that bus pirate Port to circuit python. Do you want to try visiting again? And he was like, oh, yeah, that sounds like a great project. You just like totally lose two three weeks in let's do it So he would work on the firmware and I said I'd work on I finished the hardware. So I decided to Respin it. So the one thing is is that and there's due to the trade-offs You know, I wanted to keep the price low because you know, that's one of the things that people liked about the original bus Parade was was cheap. So I was like, can I make it basically 20 bucks? But I didn't want to make it about the same size and I wanted to have basically the same functionality As much as possible. So this is What I came up with so far and this is I think I'm going to revise it a couple times But I wanted to get some, you know, proto PCBs on order. So The original had a mini USB. I can pop this up Three point three point five is kind of close Three point six, I think just has rounded corners. Um, this is done in 2010. I mean, this is a very old project So Mini USB there, but mini USB is it's I think out of date now. Wait, let me close this one So I went with USB type C Boot and reset button because and the boot button can also be a user button and that's because it's got an RP 20 40 Wide RP 20 40 cheap and available. I can't get the sandy 51 again. The 70 21 is too small I didn't want to go with another chip that I didn't know I could easily get and you know, the whole thing about the Bus Pirates, it's like it's a pin toggly bus thing and all the protocols that the bus pirate supported like LCDs and PS2 keyboards one wire I squared CSPI, you know bit banging, whatever One wire that's all supported in circuit Python for the RP 20 40 The only thing that wasn't supported is JTAG So we'll probably have to run a little helper to do, you know The JTAG toggling and I want it to support SWD actually because that'd be cool If it also could do like a pico probe type behavior And it has plenty of memory to be able to handle all of all of that in Python There's also an 8 megabyte flash chip. I Still have those regulators a 3 volts 3 volts and 5 volts The 5 volts I actually updated to be these are all 500 milliamps. The original was like 100 milliamps I updated these all to be 500 milliamp regulators LEDs for power Data transmission reception I think we actually added this into circuit Python a really really long time ago where you could have the UART the USB data Send RX and TX a mode LED because there's a couple different modes like binary non-binary And the 5 volts power supply output to 3 volt power supply up so you know if your power is output Same pinout as the 2 by 5 header on the original And then I added a couple of the things you get, you know, the neopixel And this is a stem IQT port because Scott was like I'm gonna use this mostly for debugging I squared C And you could like sniff I squared C. So This is S I squared C on a separate I squared C bus than the header. So there's like two buses a mode switch and this is We need a switch because In circuit Python, you know, you normally get a UART Ripple and then you could have a second UART for data, right? So we're gonna have the commands that you send to the bus the circuit pirate bus pirate clone It's just gonna send the data over the secondary UART So you have the repels still for debugging, you know If you want you can control D and like do stuff, but the the main menu command interface Is going to be to the second UART and we want to have a switch to enable or disable the repel Because we thought it would be confusing if there was two comports people would be like oh, which one am I supposed to use? So when you put it into program mode, the repel would show up and Then if you do and use user mode It would disappear because you can do that you can dynamically change the the USB availability And then the analog switch and then you know, there's a lot of components You need a lot of capacitors to support the RP 2040 and there's like a crystal over here and All the good stuff. I'm pretty much it's the same size and shape But mini sorry USB C instead of mini two buttons static UT mode switch Same pinout and a couple extra LEDs. I figured, you know, why not just throw them on there a couple of things though that were a little Annoying is and I will have to figure out how I'm going to do this to the original bus pirate The pinouts that they did like the marking is only the SPI. So it's a clock most see me so Chip select so my controller out sensor in my control in sensor out Chip select and SPI clock and then those pins would also be Multiplexed with the I scored C and you are the problem is is that the pick 14, you know It had their own pin mux that was very specific And so it turned out that the SDA and you are TX and Mostly pin were all on one pin and the RX and me so, you know, like they they were very like Oh, these are the pins that are available, but that's not what's available on the RP 2040 The RP 2040 has different Pinout capabilities. This is this is what the pinouts are. It's TX Me so SDA and so that's like that doesn't match here and RX and CS are the same Where's here? It's Rx me so so there's like this mismatch of what the multiplexing can do. And so The bus pirate for When I looked at the schematic for the pirate for If you look at their schematic What they did, I mean, I didn't look at the detail detail detail, but What looks to me is because there's there's there's this SPI set here And then if you look it's duplicated down here So I think what happened is they actually just connected two sets of pins to one IO and they just like they just manage It's only one is driving one of those pin sets is driving depending on whether you want I squared C or you are or SPI You know, I thought about doing that, but there's not actually a ton of I mean there is plenty of pins and I could do it but When talking to Scott, you know, cuz I was like, okay, here's this issue. We were like, well, you know, we can bit bang I scored C and You are pretty easily it's strictly with PIO like you can you are you can do quite well Normally you are it's quite hard to do with the banging but the PIO makes it very easy And so we actually made this the hardware as PI port And I put little jumpers on the bottom you see so I if I change my mind I can like cut them in like maybe like, you know, quickly we wire them As necessary, so, you know, we'll see this is This is an experiment and then you know, the second part is Is this analog mux, which I won't go into a lot of detail maybe maybe next I guess what I want to get to the great search But they use an analog switch to Turn on and off the pull-ups from The external voltage like the the output voltage. Sorry. Yeah, the the external voltage which is in comes into the Circuit pirate board and then using this you can enable or disable all four pull-ups at once And you can see these are the pull-up values and then, you know, they connect or disconnect from the external based on this Value and I thought, you know, analog switches are kind of neat So I thought I would make that the great search I don't know if we want to if you want to wrap up anything with the Or to come you check on the socials in our blog We have the schematic the rendering that we're starting on it's still playing around with a logo But let's kick it with the great search. Okay, let's kick it The great search brought to you by Did you key and a different every single week lady a decent power of engineer and help you guess you find the things you're looking on For and with did you key calm? Okay? What's up? Okay? So let's go to my computer So this week I've been working on this design which is is pays homage to is a derivative of an open-source project called the bus pirate and One thing this project did which I thought was interesting was it uses an analog switch to enable and disable Pull-up resistors from these for GPIO pins to an external voltage which which might vary and you know, I thought it's interesting because I was like, oh, why didn't they just use like a bunch of transistors? You could do this with a bunch of fats and I was like, oh, you know, like it would take a lot more board space up It might be more expensive than just plopping down one analog Multiplexer slash switch and then I realized, you know, we we've never talked about this kind of part We often have buffers or we have maybe op-amps But analog switches kind of a cool weird thing in between. It's it's made up of MOSFETs And it's basically, you know, you could think hey, I can I can connect and disconnect some things by, you know Connecting up some n-channel and p-channel MOSFETs and and you should basically disconnect and connect a pathway between two IO pins particularly for analog voltages is what they're they're good for they're called analog switches, although of course you can do them for digital signals, they're just not going to be as as fast as They're best used for analog you can use them digital but of course there will be a limit of how how fast the frequency you can push through them is and You know, of course, this is a replacement for mechanical switch But there are some trade-offs just because they're called analog switches doesn't mean they replace a switch There's a there's a couple things to watch for so first off, you know, you can go to Digi-key and search for analog switches as opposed to mechanical switches which is right which is like the clicky things and There's a couple zones. There's like, you know, a special purpose, but there is you know one Main section for them and there's a lot of settings a little not every setting is covered so the upshot is there, you know, they're they're silicon chips and The most popular ones are the ones that are kind of bar from old CMOS logic So this design used the 4066, which is a four-channel SPST switch But there are other ones too like the 4051 and of course the a lot of the CMOS logic as it became more modernized And more durable You're gonna see it called 74 X, you know, 74 hcvhcvhct whatever that series so the 4051 is a Multiplex or demultiplexer. So what's kind of neat here is that you have one Sorry, you have one of 80 code. So this one is a single pole octal throw SP 80. So used to connect one Input Z. So Z is the input or output, you know, that's the thing. It's analog. It's can go bidirectionally To eight different outputs, you can it's basically like an eight-way mechanical switch and then use the three logical inputs s 0 1 and 2 To select which of the eight outputs or connections. You'll have Z connect to you Yeah, VCC ve power and ground you'll notice a lot of these Because they're meant for analog signals Which used to be like positive and negatively referenced like negative 12 to plus 12 It's not that unusual to see these chips have pretty big power supply Possibilities so you can usually while you could run them zero to five Wedding them like negative 12 to plus 12 is there. There are definitely versions for that. There's a navel and then a ground So a couple things to be aware first up. There is So this one has, you know, wide input range of negative five to five But of course your power supply has to be Beyond that usually mean maybe maybe plus or minus one volt. You can't Use like one of these analog switches It's powered off of three volts and use that to switch five volts like any your signal input output cannot be Above or below the rails except for like one weird situation where it can't On resistance so unlike a mechanical switch where you have a resistance of like point zero one Or point one ohms like it's almost nothing Um, there is a resistance. So These are low-cost 40 xx series. You're gonna get 510 50 100 ohms. So, you know, just be aware that there's some impedance This is this is not a power slick, you know mechanical switch You can easily get ones that give you amps of current through this one You're not gonna be able to drive that much current through and there's all another Limitation of how much not only is there resistance, but there's a limit of how much current You know, usually looks like, you know, 20 milliamps or so Between each input and output So this power supply for example, you can run it up to plus minus Five volts or zero to ten volts, you know, you can do either as long as the total differential is Ten or less. So that's like one example, but there's there, you know, there's others the 4051 The 4052 which is a two by four switch. So this would be good for like a stereo signal two inputs And then four outputs for each two, you know two options reach. So here you've got one Z and then goes to You know, why zero one two three and then to Z which goes to this set So it's like two to four to take stereo switches and four options each. So there's like every which combo you could ever want There's SPST that, you know, normally open and then you have to do something to connect them SPST switches There's ones that are single just like one little switch Different resistances You know, again, like I said, though the inexpensive we have 10 20 40 cent chips are going to be a couple ohms But you can get one that are, you know, very low homage Under one ohm resistance. You also get ones that are massive, you know, 64 circuits So just kind of bonkers. Can't even imagine how big this is. Yes. This is like a beast 44 BGA, but you can get it All is available What we want actually, so this is the 4066 series just want to, you know, show a couple options in the 4066 Family Let's just look at the active ones for now and Only surface mount although they are available in through hole by the way I did use them in lab when I was a student. They were very popular There's a couple standard packages. There's the DV QFN There is the SOIC and The TSOP that we're actually going to use the TSOP in our design and the LVC is a good family to use it can run from three to five volts and Trying to remember if this voltage Yeah, so I would run it at five volts and then, you know, I'd use three volt signals to enable it But then if the external voltage was higher than 3.3, it would be fine for my switch I wouldn't have to deal with dealing with the above the, you know It's a little tougher to switch voltages that are above your power supply rail So I think this is why Digital designer decided to go with the 4066 so Your enable switches three volts, but the external voltage is five You power this from five volts and then now you can turn on and off and connect those Pull-up resistors to the through the analog SPST Without having to worry about like oh now I need like two layers of fats to make that higher voltage for for switching them So the VHT so this is probably I'm going to end up going through the LVC. Sorry the LVC series is good Once from a fine voltage, you know, it can Fairly low on resistance six ohms not going to affect it each switch can handle 32 milliamps plenty This again, it's just a pull-up resistor and it's also fairly inexpensive. So, you know, you're you're talking about like 40 cents 40 cents in in a reel at a time so A good price and so, you know, why not just do this with Fets on your own you can but for 40 cents you just drop it down and you're ready to go So this is my great search pick of the week And that's our show for the week. Thank you so much everybody. We have a full lineup of shows this week Lots of surprises. We've been posting lots of videos and more every single day. So We will see everybody during the week. Thanks so much for joining us. It's very much appreciated. Thank you. Bye everybody