Hello, everyone, and we're watching this after the fact. Make sure you check the time codes for the description for time codes. This tends to be a pretty long stream, so the description will give you time codes into when everything is happening. Otherwise, we'll sit tight where I'm early because I got prepared. So we'll say hi as people drop in and have a good time. Say hello to folks. JP says lal. Oh, nice. There's a Flickr album for everybody dressing up. We're going to talk lots of Raspberry Pi stuff today. Not quite yet, though, is this stuff. Getting all my tweets coming in. Spook's going to want to get on my lap. I'm going to get cat hair all over this costume. How's everyone doing? Hi, Beata. JP, aka Pierre, I think. Seth's in the chat. We're a little early. We're going to keep waiting for folks. We'll see how bad the cat messes up when he tries to get on this. Oh, you can see his head. Thank you, Eddie. Hey, David. Thank you, as always, for taking notes. I'm getting that note stuck. We'll see how long I last in these glasses. I am not. I don't excel at putting physical things together. So you might see the rubber band here. Hi, NaraDark. Hey, Andrew R. I'm Minnesota Mentat. I have the windows open because I'm like, this is a full body dinosaur suit. I mean, Blica suit. Wait, I have a tail. Oh, I just sat on my tail. Before things really get going, for testing that PR locally, that flash stuff, do I simply point the module to my repo slash branch, update, and then compile and test the hardware? Yeah, so you can, in Circuit Python, you change into the data slash nvmtoml, and then you can run. Then you check out your version of the nvmtoml. Or you could just copy the files in there. Bad Abby says, nice costume. Thank you. And my costume, my eyes are running Circuit Python. Thanks to Phil B for the iCode. I looked at it and I was very impressed that Circuit Python could do it. I did change the colors. I don't know if you can tell. Hi, Chi. The blink goes a little purple. Purple's kind of hard to do, though. We'll get going just in a couple more minutes. The folks are new to the deep dive welcome. Is the cat scared of snakes? No, he's not. He's right here. And he was thinking about getting on my lap. You might have seen him in cat cam. He's right below the cat cam. Yeah, props to my partner, Becca, who found the costume for me. I mentioned that Phil had dared me to, or Phil was asking me if I was going to dress up for my stream. And Becca took that and ran with it. Mark says, if you can do the whole deep dive in those glasses, I will truly be impressed. I'm not planning on it. I'm not planning on it. But I have to do enough at least so that we can get the thumbnail, because we should at least have the thumbnail with us. We'll see. I'm noticing when I'm reading the text, I'm adjusting my eyes. See? The cat's right under cat cam. He's like, giant. Yeah, I think that is the term, doctor. Kigurumi? It's like a onesie for adults. It's like a blink of one. It's the right colors. DCD says, any hope of getting eye tracking interface to the glasses? Nah. You can't tell. Hi, doctor. I think I said, hey, love the factory. How are you doing? DCD says, is it just accelerometer now? The eyes are random as far as I know. You're getting like over the shoulder view of the cat. That's pretty cool. Mark says, he watched slash participated in show and tell in the glasses. 30 minutes was about my limit before my eyes were buggy. Yeah, I don't really expect to go. I don't expect to go 30 minutes either. But we'll get going. We'll do housekeeping and stuff and see how it goes. Becca loaned me a frame of her glasses. But I'm definitely not a, I don't have a 3D printer, so I couldn't 3D print the glasses. So these eyes are great, though. Props to Philby again for doing those. Unexpected maker, hello. Nice wardrobe. Thank you. I did have another idea for a deep dive costume that I had after I did this. Beata says, they're having fun with IceGridC today. I think that board.icegridc stem, a singleton idea, will be helpful. Otherwise, the value error, SEL1 in use happens unless I power cycle. Interesting. It should de-init for you. DCD says, does the eye filter out the LED grid on the glasses? Not sure what you mean by that. Hamzlabs says, oh man, I got a nice laugh when I opened this on YouTube. Hi, Scott. Hi, Hamzlabs. And Mototima says, the costume is plain awesome. Thank you, Becca. Yeah, she found it for me. And then I was like, ooh, I can add the eyes, too. I can find the, I think I have the link. So bug me later on Discord, and I'll find the link if you do want to pick this one up. I had to, I paid for faster shipping. So it was like 20 bucks, but then 10 bucks for shipping. But I was wearing it around a couple of days ago when my wife was getting a kick out of it. OK, we're past time. I think folks that were expecting to join have joined. The brain eventually see without the horizontal lines of the LED frame puts the front of your eyes. Is this a character? I should know. So this coloring is meant to be Blinka. So Blinka is the sacrifice and mascot, which is Blinka is like purple and pink on the belly and blue eyes. Blinka doesn't have the spikes, but, you know. Yeah, thanks there, Doc, for putting that emoji there. And LeMort totally called it, too. We were in a meeting on Wednesday, and I said, oh, and I'll probably dress up. And she's like, what are you going to be, Blinka? And I was like, no. So hi, Todd, but I'm not used to wearing glasses either. You're Blinka. That's a character I should know. Ooh, Hamslav has an ELYR effect. Yeah, that might be the one. Doctor found the purple dinosaur one. It is like a purple dinosaur. Kiko Rumi. So yeah. OK, let's do housekeeping. We'll see how long I can keep the glasses on, but I think it would be fun. Like as people are coming in, I think it would be fun at least. All right, so hello, everyone. My name is Blinka. I mean, Scott slash Blinka. This is a deep dive. Deep dives happen every week on Fridays, usually at 2 PM Pacific, which is just five minutes ago. Next week or the week after, somewhere around there, the US will shift, and that will mean it's time for everyone outside the US will change. So just be aware of that. I'm in Seattle. I work remotely for Adafruit. So Adafruit is an open source hardware and software company based out in New York City. I work remotely in Seattle, and I have the last five years. That's why times are in Pacific. Hi, Dylan. Thank you for saying love with the costume. If you want to support Adafruit and support me, Adafruit pays me to sit here on the screen and do a lot of other development work. Hi, Deshipu. You can go to adafruit.com, purchase some hardware there, check that out. And if you don't know what CircuitPython is, well, if you don't know what Blinka is, Blinka is the snake mascot of CircuitPython. And CircuitPython is a version of Python designed for microcontrollers to teach people how to program on microcontrollers, which are these little inexpensive computers that I have on my desk here. And actually, I can slide this on. Actually, what I'm doing is I have this clue. The clue has a semiconductor and a battery connector, so it worked out. So it's running CircuitPython on the glasses here, and it's making the eyes go back and forth. Sherry says they're enjoying the costume. They say it's a Barney outfit. It's definitely the right colors for Barney, but it's meant to be Blinka, which is our snake mascot. And I'll probably wear the, I have contingency plans if I can't wear it all the whole time. Yeah, so that's CircuitPython and Adafruit. If you want to chat with me and a lot of others throughout the week, you can check out the Adafruit Discord server, which is a chat server. You can go to adafru.id slash discord to join us there. That's what the middle box here is, is the Discord live broadcast chat channel. Oh yeah, Barney has a green belly, I don't know. Does he? I don't know. This is Blinka either way. Hi, Keith. I didn't say how do you yet. OK. Yeah, so deep dives happen every week. Normally, Friday is at 2 PM Pacific, which has just passed. And it's occasionally shifted to Thursdays if I want to do it that week, but want to take Friday off. Otherwise, if I have something on Friday, I may take it off as well. Streaming pretty regularly for a while, so don't be surprised if I skip some weeks. And then next week is on Friday. And it typically goes for two hours or more, so feel free to ask questions about circuit Python electronics. I'll try my best to answer them. I may not be able to answer everything, but I'll try. And I saw Bad Abby asks, did anyone order a Raspberry Pi 02W to be true Blinka? You can't use your arms during this deep dive. Well, yeah, Blinka must program with her mind, and I just can't do that. I can't manage to program with my mind. I do like the cats sitting on the chair. I ordered no problem, Sherry. I'm glad you enjoy the outfit. Everyone's enjoying it, which is good. I ordered a Raspberry Pi 02W. I guess we should start there. I ordered it yesterday. It shipped out today from Adafruit, and it'll get here on Monday. So next week, we should be able to cover the 02W. Hopefully, we'll be able to get circuit Python running on it next week, so let's just talk about that. Let's go to the desktop here. Unexpected makers as I ordered one could only buy one and going to put it in my MCU box and never use it. That's a shame. Is Barney a green stomach? Is that what we decided? Ah, Barney's a green stomach. So I'm not that close to Barney, which is good. OK, so folks, if you didn't see it, Raspberry Pi. Oh, I look like Keitzelblinka, the mascot of Dia de Circuit Python. Nice. Yeah, so the Raspberry Pi 02W was announced yesterday. And it's a new Pi Zero from the Raspberry Pi trading company. It is $15, so it's a little bit pricier than the originals. But the originals were never actually that price. If you ever wanted to buy more than one, it was like $15 or something. So it's nice to see kind of real quote unquote real pricing on that, which is nice. It's got the same chip as the Raspberry Pi 03. And they did some fanciness where they included the RAM in the package. So chips themselves are like silicon, little pieces of silicon, and then they get packaged to sit on the board and in some resin and maybe metal. And yeah, so the Pi 02 has the same chip as the Pi 03, but the package of the chip includes the 512 megabytes of RAM. Makes it possible to put them all on there. Minnesota Mentat said, excellent would enjoy Blinka support for the Pi 02W. I think I saw in my email today that it was already merged in. I just had to get the CPU code to be able to identify it, and I think it just works. So check that out. So the really exciting thing about the zeros, all the zeros, but also this new zero, is that the zeros were designed to be the, they have the USB device connector on them, which a lot of the Raspberry Pi's kind of expect them to be the computer. But this way they have, with the zeros, they're actually meant to be devices, which is really awesome. And that's kind of what CircuitPython does. So that's why the zeros are really exciting. The chip that's in the 03 that's now on the 02 as well is a 64-bit ARM as well. So all of this work that I'm doing the Pi 4, like the 64-bit stuff, will be pretty easy to port over. All the peripherals are the same except for the interrupts. So we'll have to do a little bit of interrupt work to get to the Pi 3 chip, but it shouldn't be too bad. And there are a lot fewer peripherals, but the peripherals they have are the same ones that are in the Pi 4 as well. So we've got some questions. Let me go with that. The four-core with the W2 is what's approximately four times faster. Yep. Yeah, if you're talking multi-core stuff, it's also 64-bit versus 32-bit. So you might get a little bit of a speed up there. Hello, Mark. Glad you're enjoying the costume. Michael says, will CircuitPython for the Pi get support for the camera connector? That's a great question. I haven't looked into it. So I can't. I don't know. It's not high on my list. Jeff has been doing work with the camera stuff, so I wouldn't rule it out. But it really depends on how well documented it is because it relies on the GPU and stuff. So we'll see. Like, the code doesn't even have SD card support at this point. So I'm hoping to get it to the point where we can all use it on the devices, and then people will add the things that they're interested in. Alvaro says, I'd love to see CircuitPython with the Pi camera. Yeah, I think it would be neat. I'd also like, it's kind of in the same vein as Bluetooth and Wi-Fi support. It's just like, could be really tricky. We've started talking about USB host though, which will be really exciting. Hey, Aaron. I'm glad you're enjoying my Blinka costume. Not quite Barney costume. Maybe they're relatives. Somebody was saying, so the RAM was the customization by the Pi Foundation. That's my understanding is that, so I think Raspberry Pi folks are trying to be more definitive between the foundation and the trading company because the trading company is actually a commercial entity and the foundation's a nonprofit. So that's why they split RaspberryPython.org into two, .com and .org. So like, all of this product stuff is actually happening on the .com side. So yeah, their innovation was the packaging. The chip itself is not any different from what I understand. They had to change the clocking a little bit just because of heat dissipation of the package, but I don't think the chip is any different. But the USB is still not a full USB, right? It's still just OTG. Like it can't detect a device swap like in the zero W. I would assume so. I think generally it is, I think generally the USB is gonna be exactly the same as the original zero. Like there's the USB stuff. Ooh. Umut says, tell us more about USB host. I think device swap means like it's running and like it's running in your switching devices and I don't know. So I've gotten to feel a little more a little excited about this RaspberryPy stuff I think and there was recently a story about the author of Dune and how they used like a old Windows computer with a DOS screen editing screenplay program. And so the feeling the more worth it gave it'd be kind of cool to mimic that. And the way that we can mimic that is with CircuitPython host or USB host support. So tiny USB has a little bit of host support in it already. And so we would build on that. It's just basic HID stuff. So like keyboards and mice, but that's enough for us right now. I think I've got to take these glasses off. We'll see. I've gone 20 minutes. Oh yeah, thank you for the article. So we thought it would be kind of fun to like reproduce that in CircuitPython and RaspberryPy actually came out with this Pi 400 which is a kind of all in one keyboard that has a Raspberry Pi in it basically. And the way that the keyboard is connected to the Raspberry Pi bits is through USB host. So Todd would love to help get USB host working, MIDI host working. Yeah, and make sure there's an issue on tiny USB for it. I think that would be neat. The cool thing if we got that working is that if you had a regular Pi 4 and we had USB host support you would be able to plug a keyboard in and then use the regular Pi 4 just like you would the Pi 400. So think about what CircuitPython means in a world where you're like all only interacting with CircuitPython. That's the only computer you have. One idea I've had is like with all this BLE workflow stuff it would be really cool to be able to edit the files on a Pi via BLE. Like imagine you have a Pi sitting under a TV and you have a game running or you're doing something with the TV and you can use BLE to like update and iterate on the code that's showing on your TV. Hi Dave. So yeah, I think MIDI host is cool or USB host is cool. So to get it working on the Pi 400 we actually have to support there's an XHCI chip which is a type of host controller for USB and it's connected actually over PCI. So that would have to be something that we figure out. I asked TAC to look at it. He's got a few other things but and he wanted to finish the USB device support that we're using here. Yeah, Zork clone in CircuitPython. There's also some really cool project that somebody's been doing called PIDOS that looks really neat too. So that would be really cool in our Raspberry Pi as well. Pico 8, if people haven't seen it is one of my inspirations for this stuff and they kind of all in one have running a game and editing the files and editing the tiles and all that stuff. So I think there's some really cool stuff we could do is like CircuitPython as like an old OS. Okay, I think I'm done with these glasses. I like how they look but I think they're throwing my brain off a little bit. There we go. I can show you how I have it set up. It's like how a software engineer does hardware. So there's the glasses. These are the, what are we calling them? I don't know, I forget what we're calling them. Eye lights maybe? They're just released from A to Fruit and what you get is just the PCB and then what you do is you plug in via STEMA to a controller. And like I said earlier, the controller I'm using is actually a clue. I've disabled the display so it's not changing at all anymore, which speeds up all the code. But the nice thing about the clue is that it has a STEMA connector and a power connector. I don't have, we designed a certain board for it, custom board for it, but I don't have it. Like the glasses were ordered before the controller was available. So it's just like a regular pair of reading glasses that my partner had that she popped the lenses out of. And you can see I rubber banded it and then we tied it with string and then I rubber banded it. Apparently rubber bands are the things that I'm like, I'm most capable of using is a hardware thing. So yeah, anyway, that's my setup for the glasses. I think I might have to take that off too because I'm getting warm. Even though the windows are open, I could put it back on later. I do have like two layers on. Okay. So yeah, the zero two W is really exciting because it's going to be a really good, like 15 bucks for like a half gig of RAM that circuit bypass can use. I posted this as a reply to Raspberry Pi earlier. I was like, you know, it's not spectacular for Linux because it doesn't have that much RAM, but it's epic for circuit Python where we're like, we're used to being like in the kilobytes and now we can have half a gigabyte or nearly all of that. So yeah, I'm pretty excited. I'm pretty excited that it's going to make it really accessible to have USB device through it. Mark says, Halloween costumes always either so hot or so cold to wear. Yeah. Okay. So any other questions about the zero two? I figure we'll probably be able to, we could work on it next week when I have it or maybe I'll work on it before. I don't know. It depends on how this SD card stuff it goes. So the last thing on my list is really to get SD card support because that will complete the kind of like workflow for circuit Python where you plug in the device. So kind of the Raspberry Pi flow will be as you get an SD card, you flash it with circuit Python, you pop it in your Raspberry Pi and then you will be able to plug your Raspberry Pi into your computer. It will show up as a drive with code.py on it and you'll be able to edit the file and it will run just like normal circuit Python would. If you have HDMI, you can plug in HDMI and you'll get the automatic display output on the HDMI display as well, which would be really cool. And I think that's the reason, like I said last week or the week before or whatever, like the reason that I'm doing this is really because of the HDMI. I think that's a really cool thing to give people access to is like what they can do on their TVs. So what we have working right now is we have HDMI working and we have the USB REPL, the USB serial connection working and we have serial over UART working as well. Yeah, JP says zero two is the ultimate board for circuit Python. Yeah, it was really good timing, really good timing for it to come out. It is very much a good like step up. Although we'll see, one of the things that's gonna be interesting is like how much of the hardware APIs work well on the Raspberry Pi, whether they actually support everything. So that'll be interesting because like how well like I squared C and spy work and stuff like that will be neat. But the HDMI stuff is gonna be really cool. So last week when we left off I showed that we had gotten all that working and shout out to TAC for getting USB working. This week TAC actually, last week it was working full speed but this week it's actually working high speed. Although I haven't actually switched my copy of circuit Python over yet but on the tiny USB side he's gotten high speed working on the Raspberry Pi four as well. So that's pretty neat. And that's high speed device. That's not host mode. So does the Raspberry Pi Pico support circuit Python? Yes it does Andrew. Yeah, we launched, when the RP2040 launched we had circuit Python available as well. I had like a, I had about a month head start on the RP2040. So we supported it as quick as we could and it's been really nice because the RP2040 chip availability has been pretty good and it's pretty good cost as well. So it's pretty neat. Like RP2040 up to the Raspberry Pi 02 will be really neat. Okay, so let me switch to, so what we were looking at last time is that the HDMI was really slow. And I spent the good chunk of the start of the week working on that. I was convinced, I was convinced and convinced and convinced that the caches were not on. And I looked into this thing called the performance monitoring unit and spun my wheels a ton only to realize that yes, caching was on but I wasn't caching enough. I wasn't caching that range where like all of the circuit Python heap was and that was slowing me down a ton, it turns out. So let me switch to this. So this is circuit Python. Amazing job with the Pi Pico, thank you. Yeah, it's a really cool chip. Like once I heard about it and got access to the data sheet, it was like, this is seriously impressive. It was like another really good circuit Python chip. And I think that the Pi 02W is probably in that camp too. Anyway, so what we had here, it's actually the other way around. What is the other way around? Anyway, so here's the output. This is a slightly different resolution than what we were doing last time and we can play around with that. Yes, circuit Python supports the Pico. Right, right, right. Okay, so let me show you. Once I figured out that I needed to cache everything. Ha ha, hoo-ha, Adam, late to the stream but I take it you're putting circuit Python on the new zero. Plan is to do that next week. I don't have one yet, mine's coming next week. Pi 02W or Pi 02W will be the most powerful circuit Python device, right? Yeah, I think that's safe to say. It'll have the most RAM and it'll be the fastest. But yeah, so last time when we were doing this, the scroll was really slow. And it's really, really responsive now because I turned caching on for everything. So let's just play around with it. So this resolution is a little bit different. Let's just tweak the resolution to see how well it does at larger sizes. So this is actually, oh, you can't see. MergillumTV says, sorry, what is circuit Python? So circuit Python is a version of Python designed for microcontrollers, which are very inexpensive computers that come on little electronic sports. I'm actually running it bare metal, meaning no, without an operating system on a Raspberry Pi here. So this is not running on my computer, this is running on a separate like Raspberry Pi compute module. So I can do all of the sorts of regular, um, so I can do all sorts of Python-y things. And it's not running on my computer, it's running on a separate, separate thing. Todd Butt says, yeah, last week I saw GC-Memfree and it was in the megabytes on the Raspberry Pi. Yeah, so that's only because I've hard-coded it to 32 megabytes right now, but it can actually be like hundreds or gigabytes of memory. There's no reason to do that. Like, I just, the problem is, is that I can't take the full memory range because the GPU uses a chunk of it and I haven't just figured that out. With the big Pi logo on top of the zero to chip, is it still a Broadcom CPU? Yes. Yeah, the CPU part of it is all the same, I think. It's just how it's packaged. Adam says, circuit Python on my three new zeros coming will be the best Christmas ever. Awesome. Yeah, and I do want to support the original zero as well. It's gonna take a little bit, a little more work because it's an older ARM CPU, but there's no fundamental reason we can't. It's just, at some point I'm gonna have to do the work to support all of the range of the Raspberry Pis, but I think we should be able to support all of the Raspberry Pis. The challenge is that the USB device stuff won't work very well on boards that aren't designed for that. That's how you get HDMI faster, extend the memory into the GPU range and just write to it. Yeah, so the way that, oh, for unexpected maker says the slower flash, SD is slower than embedded flash, right? Or is it faster? I think it all depends. There's certainly lots of different types of flash, but the reality is that like, generally because you have so much RAM, everything just lives in RAM, and then getting things from RAM to the CPU is all, like there's two levels of caching there. So it's, and when it comes actually writing and reading blocks on flash, it's gonna be about the same. The Pi, I assume it's not the Pi Foundation, it's the Pi Trading Company. Anyway, I don't know. I don't know the distinction between the two. At this point, I don't, for ST support, I don't care. Like, all I care about is starting to get it to work. But I thought what I would do is actually play around with the resolution. So let's go with the desktop with the HDMI. That's even better news. I got like four original zeros. Yeah, so I think once I get, once I get the, once I get SD card working, the thing I'm, the peripheral that's controlling the SD card is in all PIs. So once I do that, and I get the baseline there, before I merge it all in, I'm gonna wanna like tidy it all up so that we can support all the PIs, basically. And I think also boards that have it as a compute module. So, yeah, it's just, it's gonna take a little work to like branch out and support all the boards, but it shouldn't be too bad. Anyway, let's experiment with these. So what we were looking at last time is 640 by 480. So let's just do a build. And one thing we can do in the future is we can actually detect and decide on what.  They think this needs to be... So I was working on SD card support. So let me just comment that back out. I was having trouble with my iCloud backup too, but I switched to Google Photos for Photos. I just wanna show what the refresh performance is on the larger display sizes. Because I think it's a little noticeable on 1080p, but it's not too bad. If I remember right, I just tried it once and I was like, I kinda like how cute it is when it's all chunky. So there's the bootloader. Lost your stream. How's Twitch look, folks? YouTube look okay? It looks okay from here. YouTube. You see the REPL, okay. YouTube, okay. Yeah, if you're on Twitch and it's not working, go ahead and slide over to YouTube. It looks like it's working there still. YouTube.com slash Adafruit will get you there. Okay, so here's the 640 by 480 REPL and we can see it's still pretty quick. Like maybe it's not perfectly fast. LotoTima says, looking forward to receiving Pioneer and trying out this bare metal circuit by them on the CM4. Thank you, Timon and Tandu. I should get mine out. I haven't tried it online. I have an early pre-production one. Have a good one, doctor. Have a good walk. I'm gonna go for a walk after I'm done streaming. Gotta go get some groceries. And just for comparison's sake, let's try 1080p and just see how it is. Because it does work. It's just a lot of pixels. Maybe the person thought that they lost the stream because of the color bars. Color bars are okay, because the pie is off right now. You shouldn't see color bars on the box that where my picture is. Oh, the cat's still there. Okay, so this should be in 1080p. I think it does get squished. I assumed it was my Twitch that messed up. Oh, so it is Twitch that, I guess they didn't hear me. I guess I should put it in the chat. They can't hear me say it like, oh, I think it's fine. There is some text displayed mid-boot. That's the boot loader. That is my understanding, yeah. Timon forgot about the stream. You missed my Blinka costume. I have eyes, too, but I took them off. But I could just wear it like this and not be able to see. Yeah, so it's like not too bad? So this is like 1080p. And I don't know why it going chunk, chunk. That might be the display IO. This is not perfect, but it's also 1080p and it's tiny. So it seems a bit blurry here. It could be. It's totally possible. I'm using a capture card and I'm not sure it can actually do 1080p. Chris says, coming from Arduino, I find setting up 8 different circuit bytes on hard work. Are there any plans to make it this a simpler process, for example, moving it to a Java IDE? No, we don't have plans on moving to Eclipse IDE, but I would recommend Mew if you haven't looked at Mew. Mew, it's an editor that kind of does it all together, which should help some. I mean, there's certainly lots of room to optimize this. So remember, display IO does dirty rectangle tracking and that will apply here. And so if you're doing a game where you have a character just moving, like it should be nice and smooth. But yeah, the artifacts could be the capture card as well, although we didn't see them with the smaller resolution. So let's just switch it back. I kind of like the 640 by 480. Mew is definitely a good experience. Yeah, yeah, I recommend that. We do try to, one of the reasons that it's more confusing is that we try to not keep you in one editor like Arduino does. We do want to be more flexible and work with more things. That's a goal of mine. Looks like Twitch is still not loading. It looks okay from Restream. Why isn't it loading? Oh, and she points out that there is a VS code extension that can help too. Keep thanks for the link. Glad people were enjoying it. Okay, yeah, and Chris, if you were continuing to have trouble with Circuit Python, the Discord server is really a great place to get help. You can go to the URL, adafru.it slash discord and I will type that in. And there is a help with Circuit Python channel that folks are really helpful in. Not even a slight movement. I wonder if I could just turn Twitch off. What if I do this? I think it should be off. Maybe if I, can I turn it back on? Fani also works at Circuit Python from what I hear. I believe so, but Fani likes to work in a very weird way. It uses, at least in MicroPython. I think there's a Circuit Python mode that doesn't do this, but if you try to do it in Circuit Python, it throws it off. They try to load chunks of code in via the REPL or the raw REPL and it's just not usually what, not the way that we're used to supporting for Circuit Python. Oh, okay, so I was switching the resolution back. Python 3.10 is deprecated distutil. Spent my day on that for the Yocto project. It's nice to not worry about that with Circuit Python. I like how it tells me the files seem identical, even if they're not quite. Okay, great, Twitch is back. Okay, I just toggled it on and off. I turned it off and back on again via a restream. So that's cool. I'm glad I didn't like mess up the other streams. Yeah, so that's the bootloader that you see blip there. And you can also see my SD card print debug. All right, any questions or should we get into SD cards? So usually what we would have in Circuit Python is we would have some flash either inside the chip itself or we would have flash on the outside of the chip and in a like spy flash configuration. And both in those cases, the type of flash is spy nor flash and it like doesn't wear, but it's also like pretty large. So you can't get a ton of flash in a very small space. But things like EMMC chips and SD cards, which I guess basically use the same protocol, they use what's called NAND flash, which you can have higher densities of, but over time it wears out. And so what you have to have is you have to have a micro controller inside of the SD card that will balance how all of the chip components, it's like the NAND flash itself is used to balance it out so that it doesn't just like stop working really quickly. So there's this protocol that the SD card folks and EMMC folks support is how the host computer or whatever talks to the SD card. And I'm implementing it for the second time. Should you have some knowledge of Python before learning circuit Python? I don't think so. I don't think so, Dave, but you should feel free to use Python resources to learn Python as well. Yeah, Py4 is ARM64, so theoretically you can port circuit Python to the M1 chip. Yes, theoretically I can port it to every chip.  Like I said, the Py is really interesting from the perspective of HDMI and low cost. Low cost HDMI. Cheat says they learned Python by writing circuit Python. Yeah, so the core and Dylan did as well. So the core of Python is just like circuit, or the core of circuit Python is like Python, so we don't have great resources of how to learn Python with circuit Python. Just take a look at Python resources for learning Python, and then they should apply to circuit Python as well. Something we thought about. Okay, so SD cards, SD cards are technically proprietary, but the SD card folks have, let's go to the desktop. I don't need to do any, I don't think I need to show the HDMI stuff anymore, if we're gonna be working on SD cards here. To be honest, not sure why I would use bare metal circuit Python over Blinka. So the reason that I would do that is in Bruce to get away. My argument for bare metal circuit Python over Blinka is, it's really easy to set up, much easier to set up than Linux's, and it just does one thing. So it's easier to maintain as well. That would be my pitch. And of course, I definitely like this retro computer feel, which I think is really cool. I like this retro computer feel, which I think is neat too. Okay, so let's see here, spelling mistake. Well, I answered your question. So we looked at this, and I don't need that, and I don't need this. So here's the implementation. This was originally based on some MicroPython code, but I went through and redone a lot of it. So this is a Python implementation of how you talk to a circuit Python, or not circuit Python, to an SD card. So there's like a number of ways that you can talk to an SD card. Is that smaller font than normal? Yeah, I haven't made a bigger, I can make a bigger. I think I usually do. I'm a little afraid to make it not go away. So here's a version of the code that I did a while back in 2017, and it is just pure Python using spy to talk to a micro SD card. So micro SD cards, you can talk to via spy, but the faster speeds that you want, the more kind of data lines that you want. So you can get, instead of getting one bit at a time, you can get four bits or eight bits at a time. So this is just a version for spy, but we'll be looking at the wider version a little bit too. Timon says, I'm currently building automation to set up a pie image for use with Pyonora, otherwise it would take a long time to get it going from a bare image. Still not no match to the quick setup of bare metal circuit Python. And also there's a lot of IO stuff that you couldn't do under a Linux kernel, like bit banging is quite hard slash limited in a non real time OS. Yeah, it'll be interesting to see the bit banging stuff. I mean, that's a nice thing like the GC would run. I don't know how we'll do NeoPixel, I haven't thought about that, but given that we have so much RAM, we'll probably just do NeoPixel over spy under the hood. Be nice if this chip had a PIO in it. Let me tell you that, that would be amazing. Hi Dexter. Okay, so I did this driver, this is one of my references for it. You can see initialize card, you clock the card, and then there's a sequence of stuff here for doing initialization, reading the card, figuring out what its capabilities are, stuff like that. So that's what this code is doing. Man, my brain is not here. Can you tell it's Friday afternoon? This must be the costume. So yeah, this is one reference I have, another reference I've been looking at, and I don't, I kind of want to show this, and I kind of don't want to show this. So there's this awesome, awesome, awesome BZT source Raspberry Pi tutorial. And they have this example for Read Sector, and I'm looking at SD.C. She said I can't wait for the hopefully inevitable Raspberry Pi with PIO. Yeah, that would be amazing.  Drink some water. Yeah, I've got more water here. Some basic understanding of Python. Yeah, that's true. I think it's pretty quick to drop in, but obviously I'm biased. So I just wanted to point out, so I've done some code reviews, I think on the stream before, but I was trying to use this code earlier and I want to just point out some habits that I think lead to more confusing code. That's a nice way to put it. The not nice way is like, I want to rant a little bit about some of the stuff they did in this code as I was using it as a source. So I thought I wanted to take this as a learning opportunity for things that we probably shouldn't do when you're writing code. These of course are my opinions. So these defines are great. I like these defines. One thing that throws me off, and maybe this is in some circles a pattern, but this is actually a declaration of one, two, three, four, five different global variables. And none of them are labeled what they do. So when I was looking at the code earlier, it was definitely weird of like, this shouldn't be like, what is this global doing? Why are we like mixing globals and non globals? Which is weird. So that was one of the first things. And then I do a different style for reading registers because I'm used to the SVD generated structs. So I'm redoing all this. One thing that they do well is that they do, they're doing timeouts, which is awesome. But one thing that throws me off a lot is that they're doing multiple things on a single line. So this is like declaring int and then it's a while loop. And one thing here is like, this statement here is inside the while loop, but they don't have the curly braces, which makes me boggles my mind too. In my opinion, you should always have curly braces. Yeah, ResmirPy just announced the build hat for Lego and that has an RP2040 on it. I was wishing they broke out USB so we could run it just with circuit Python directly. Like, it doesn't need to be a hat. Just like talk to it directly or like just use it directly from circuit Python, in my opinion, of course. So that's one thing that really weirds me out. They do these multiple declarations. So like R and M, I think start with this value, but maybe I'm wrong or maybe R is not initialized.  Yeah, just like some really weird things and then like weird globals as well. Like here is accessing SDR. Umut says, is there a native async library in circuit Python? I found a library called async CP. It works for me now, but it would be better to use the native way. We just talked with Damian. We're working on, like Dan is actively working on this. We're planning on at least getting the async IO version from MicroPython going. But I would recommend the other stuff too. It's no problem. Um, right now we only have the keywords in what's released, but we're working on adding a little bit more. This reminds me of plan nine source code. Hmm, remind me not to look at that. So the reason I'm looking at this code is presumably it works and it's for the Raspberry Pi three, which is going to be the same setup. But yeah, these like trailing else's with ifs worth really throwing me off all of this masking. And like here, here's four statements all on the single line. And I'm just like, I don't know why that's the case. Anyways, and then, oh yeah. And I was doing this like clock initialization and like all these variables. Oh, the other thing, they're all single letters. So that's really a bad habit in my opinion. Like use single letter letter variables very sparingly, not in the sense of like you're going to use them the entire function. If you can't read the code, can you really trust that it works? Are there many test cases? Oh, David, I could not trust that it works. Although I could run it, and I don't think there are any tests and it's only been edited twice. So I'm not sure that the person who wrote it can actually maintain it either. So I'm definitely just using it as a reference. Ardorsnod said, this is exactly the reason why I use an IDE and reformat all source code before reading it. That's a good point. Could a lot of these large AF groups be switch statements? They could. They could be switch statements. It's just very weird spacing too. And yeah, I guess you're like, I could just run it through a formatter. But yeah, like figuring out, I still don't know what this math does. I just came up with my own math. So I have a lot of different things to reference. I don't have to reference just one thing, which is nice. But it is cool to see like, okay, well, they're doing like pin initialization, but they're doing like some weird pin initialization stuff. And so like I have left that commented out and host version. And like this is setting a global. So I guess one thing for this code is like you could change the naming style for the global state. Although I guess I don't necessarily do that either. It's nice that there's these prints to tell you what's happening. But yeah, so that's one reference I've been looking at. Circle is kind of like the opposite end. So Circle is a bare metal. And I should give credit to these folks. Like I would not have gotten this far without all of these folks writing tutorials on bare metal pie. Like it's really nice that they exist. And Circle is really nice too, but Circle is also C++ and it's GPL too. Hi G3 holiday. I can put my glasses back on. I've been slowly like coming out of my Blinka costume here. So this is really well commented and it's actually it looks like this is not GPL. This doesn't say GPL in it. It might be more liberally licensed, but it's C++. So this is kind of the opposite end. It's like very well structured, but that means that it's like kind of not dense. So this is a good reference too. For the like pie specific stuff. Simple I squared C debugging interface. But when I say the state of your board being demoed on YouTube didn't realize who's required. What hoops did you hit Chris? Be curious. The deep dive time change times will change in a couple of weeks because the U.S. has not done the daylight savings time yet. So be aware of that. Get base clock is nice. I'm actually ignoring this and just using default, which I think is right. But yeah, let's just. Oh, I guess I should also point out that the full specs of SD cards are gated behind the people that actually pay for it, but they have simplified specs that you can download off SD card dot something SD card.org. You can get these simplified specifications. You just have to read their thing that agrees that they own it still silly. But I did that. And so I have these things as a reference as well. So they're giant PDFs with no table of contents. Well, no table of contents that shows on the left here. They do have a table of contents. It's just not browsable like I usually browse it. But yeah, that's cool. Christian just jumped in said, hey excited to put circuit pipe on the new Raspberry Pi zero. I've got one on the way and I want to give it a try. How's that effort going? Mine comes on Monday. Mine comes on Monday. So it depends on, yeah, it depends on how quickly this SD card stuff gets done. Cause I want to do that first. Like it's not really circuit pipe on until we have the flash that you can write code to. And that makes testing easier to raise if you can actually write code to circuit pipe on rather than having to like copy it to the REPL every time. I mean, Lamar had one like a day before I did or I don't know how long she had it, but like she either had one and then she had a bunch. And when she had a bunch, they were on the site and I was able to order one. And I ordered it next day, like they pay for me to do next day. The problem is that I ordered it last night after shipping went out. So it was shipped this morning and next day is business day. So I'll get it on Monday. Yeah, the YouTube chat lag is slow. I have it set to normal latency so that the auto captions work. If you want it faster, I think the Twitch stream is going again. Oh, Kristin says, I also met the normal Raspberry Pi's. Oh, we've, we've made lots of progress. Let me show you. I think it's still on. This is the REPL that you can access over your or USB. And it is HDMI as well. So I can type in here and do one plus one if I can hit the one. So it's a, oh, Keith, Keith says it's, we're still live on Twitch and it's much faster. So if you're having trouble with the YouTube lag, go ahead and switch over to Twitch and it'll be quicker. You can even stay in the YouTube chat if you want to, either way, but yeah, so it's, it's working quite well. So the USB is working. The last piece is this SD card piece, which is going to be kind of two tasks. It's one, getting all the SD card reading, working from within circuit Python. And then the second thing is hooking that into the USB side of things. So making SD cards show up as mass storage devices via USB, which I should have talked about sooner because it should be actually quite exciting if I do it right because we've had some people say like, it's great that I can have my circuit Python device plugged in and I can read the onboard flash, but it would be great because I have this SD card that I could see it there too. And so I actually do want to, I do want to think about that second step of like connecting SD card to the USB in a way that we can actually make it, actually make it work kind of across all the things so that anytime you have an SD card and you'll be able to actually read it over USB, ideally. Not exactly sure what that would take, but that's kind of the goal of that second step. Timon says that's really quite fast now is that all from using caches. It is, in particular, it's from setting the data ranges to cache. Like I talked about that a little bit. Columndrum says, I'm a bit lost. Is this circuit Python running bare metal on a pie with no rasbian? Correct. Correct, correct, correct. It's running with no other operating system. I did actually switch, we talked about exception levels a few weeks ago, I think, and we were running an EL2, which is the hypervisor level. And like I kept running into problems where like the defaults for EL2 were not what I wanted. And so one thing when I was trying to get all the caching working is I actually switched to EL1. So the code now switches down to EL1, which is the OS exception level. So EL1 is OS and then EL0 is like for user code. So all of circuit Python now is running in EL1. As of what I pushed earlier this week when I was trying to get all the caching going. But yeah, the caching just dramatically made it faster. It was awesome. I was like waiting for that. And I was thinking it was because the caches were off and it wasn't that they were off, it's just that there was so much it was doing still hitting memory that it was sad. Yeah, so this is the 640 by 480 speed and it's quite quick. And it's going into kind of a like low grade capture card. So I'm not exactly sure how well the capture card's capturing it either. But yeah, it's pretty neat. It's going pretty well. So we're making lots of progress. USB works too. This is over UART that I'm interacting with it, but USB does work. Or at least last time I tried it, it works. And TAC added high speed support this week, but I haven't integrated that into the circuit Python yet. I'm waiting for it to actually be merged into tiny USB so I can switch to like a main commit of tiny USB. And then I'll be able to do a pull request to merge in the Broadcom stuff into circuit Python. And there's board stuff that I have to do there as well. But yeah, so I'm working on SD cards. That's because I want to have a place where you can store code. So let's get to that. So here's my code. I should show my code after criticizing somebody else's. So what I'm doing right now is for testing, all I'm doing is I'm just calling the SD card code from Bordenet, which just starts on startup. And in fact, when I'm testing like reading and writing, I'm gonna do that here as well. Randall says, what about display IO? Display IO is working? Oh yeah, you can't see my code, thank you. Display IO works via the HDMI. So that's what you're seeing here because I forgot to switch to the desktop is HDMI output from the Pi being captured by an HDMI to USB adapter. So display IO is working. Oh man, YouTube is slow. Okay, so here's my code. I know that the YouTube folks are behind. It's because I wanted the captions on. Twitch is faster according to Keith. So if it's too slow for you on YouTube, I know it's the setting I set. They made it clear that you don't get auto captioning. So here's my code. So this is in Bordenet. So in Bordenet, all I'm doing is I'm gonna just do like all my test SD card stuff. I was a bit overwhelmed like yesterday and I was procrastinating doing this SD card stuff. And I kind of gotta get over that hump and just be like, I just gotta get this card working. Right, like supporting all SD cards is like quite the challenge. But it's like, okay, I'll get this card working that I have in mind. And that should cover a lot of cards. And then David, thank you for doing time codes. Yeah, so I'll get this SD card working. I'll get it working from C first. So initialized and like reading a block or just reading a block maybe. And then once I get that stuff working then I can connect all the USB stuff and the file system stuff and circuit by phone. So like first steps, turn to like bite off just as much as I can handle. Not like all of it all at once. And then go from there and iterate. So trying to get over that hump, of course it's Friday. So we'll see how far I get today but I'm kind of checked out. I was like really, really, really focused on all the cash stuff. Like could not get to sleep because I was thinking about it focused earlier in the week. So I'm kind of a bit burned out. But I feel like I've recovered a little bit here. So let's take a look at this SD card stuff. It should be pretty straightforward. So we already have this API called SDIO IO.  With this big chunky font, circuit by phone needs to implement CBM ASCII to get cool map building letters. Let me tell you what I was thinking about because we have so much RAM. Let's take a detour, shall we? So that I don't have to work on SD card stuff. Mark says that's how this thread is going to. I feel you, it's totally okay. So I was thinking about this. Like one thing, thinking about the fantasy console, fantasy space, which is like people, people of a certain age are nostalgic about basic and learning computers in the basic world. And what I'm really hoping to do with circuit by phone on the Raspberry Pi is to mimic that, but modernize it. And so there's a couple of ways that I was thinking about having it modernized. And what Todd's talking about where you can build graphics out of a grid of characters is really cool. But there's two things I was thinking we need for that. One is, so nerd fonts are really cool. I don't know if folks, I think we've shown this before. So nerd fonts are where all of these non, all of these icons are merged into a font that also has characters. So I don't know if they have a, oh, it's not there. So it's kind of hard to see, but there's like different sets of like power line symbols and font awesome and weather icons, palm icons, material design icons, all get merged together by this project nerd fonts. And if you look at downloads, what they actually have is they have different fonts that you can have that have been, they take in all the characters and then patched all of these icons into them as well. So I actually have that like in my terminal, like I use nerd fonts, which is really neat. So I was thinking one thing we need for circuit by phone on the Raspberry Pi is we need a giant bitmap of like all of the nerd font. So that that's one thing people can use to like construct these images. Very similar to what Todd Bot's talking about with the C64 style. So I think this is like the modern version of that. Does circuit by phone use Unicode strings? It does. So that brings me to the second thing. If we do Tui Moji, so Twitter has open sourced their emojis, turns out, where's the website? And those are the emojis that are used in Discord, which is very neat. Oh, it's right here. So this might look familiar. So this is the emoji that you get in circuit Python. And it's all open sourced and attribution licensed. So another bitmap of things that I thought would be really cool is actually to take all of the Tui Moji's and put them in a giant bitmap. So you could do that like I'm making a game with all these characters, but the characters are different emojis and things like that. I thought would be really, really cool. And just to show, I don't know how to type emoji on, on the computer, so I'll copy and paste one. So we just go here where you can copy it. And if you look in here, this is circuit Python. And if I just say S equals the emoji, it prints there. Let's see what it happens on display IO. I think display IO will be confused. Yeah, so display IO doesn't know it. So it just omitted it. But it does roundtrip correctly here. So now if I print asset, it will like print the Unicode character back to me. And we've done, I've done some work to make sure that if you put Unicode in file names and stuff, it will work as well. I got pretty wild with it when I was on mobile and like the emoji keyboards right there, like, that was pretty fun. Oh, and the other thing I was enjoying is that you can actually use it as variable names.  Which I think is pretty neat.  Oh, I gotta take my, my mic off. I'm gonna let the cat out, hold on. Let's just, okay, here's the bottom of my costume. It is a fall.  Let me get up again. Oh, I need a OBS template update. I do, I do have desktop with HDMI. I don't have one that has all, that has both. When do cats listen? That's a good point. Mototimo says, I learned basic when I was six to eight years old.  Is that what you're doing? He doesn't know what he wants. Meta plus dot on plasma, I think. For what? Come on.  When they feel like, smiley face variable names have become a valid single character variable name in my lexicon. Yeah, I know, right? Anyway, I thought that was kinda neat that that all works. And a lot of that is thanks to to the MicroPython folks. I just had to tweak a little bit of stuff, but have a good night, Dave, sleep well. Maybe when daylight savings hits, it'll shift it for the better for you, I don't know. Hopefully. No need to shrink it down to an eight bit code page. UTF-8 is variable length encoding, not fixed length. Kitty. He just wants pets. He's like, anyway, so that's my detour, Todd, for you, is that I think it would be really cool, really cool to have, because we have so much space on the Raspberry Pi to have a font with a lot of stuff on it. Did you lose me? Oh, my key frame intervals. Dropped. Look okay? Is it the video feed blinking gray? It might be restream having problems. In CPython, you can only use Unicode characters and variable names that they belong in the letter class. Seems like Twitch is having some trouble. Although restream's telling me I don't have enough key frames. Don't go that way. Come up this way. You know how to get up here. He wants, I have my keyboard set further back. Oh, so this is not valid CPython? 80 fruit pythons being a gig download. I don't think it'll be that big. I downloaded all the emojis and it's only like three megabytes for a 72 by 72 PNG of everything. Well, that makes me a little sad. Maybe CPython should change what they can have as a variable. We'll push him for it, right, Spook? Okay, let's get at least one step further. Oh, nice. Let's get one step further, maybe more on this SD card stuff. It should be pretty straightforward. Okay, so that's the outside. This SDIOIO interface already existed. He goes over to the door, this cat. Unicode and emoji variable names was one of my favorite features of Swift when I came out. So let's see, so let's do this send if condition and get that working. So what I have here, and you can't see it, sorry. So this is, again, we just need to figure out how to have the chat control what view is showing up. So this is the next command that I have to get working and we'll see what it does. So this is an SDIOIO SD card. And you can see here's the pin setup stuff that I didn't do. Yeah, it makes a remote door opener or forces the cat to stay in here. I have this nice, these GPOS pin set functions. So I'm using those. I'm not actually checking that the pin numbers are right because there's only like on the pie four, there's two options where the pins can be and on the other pies, it's just a one, one or two options as well. So I can always do that code later. Remember it's like, don't get hung up, just keep going and go from there. So I have no idea what this R equal or R ampersand thing is, which is confusing. Oh, I get it. I didn't get it, Mark. Pi equals 3.14. I like to help start a foundation to give away boards to kids to learn to check if I found it. I think Adafruit might actually have a .org now. I think they set that up. So maybe email Phil and be like, do you want to do this? I don't know how it works, but all right, I'm getting distracted. So we want to send this command, but I was a little uncertain on how this second argument works. So there's a couple of things we can look at. Let's look here. Let's stop getting distracted by fonts. And there's a couple of places we should look. One is this SD card. So how do we initialize the card here? We do it, all the CRC stuff. Nice haircut, thank you. Yeah, so here's a knit card. We've done command zero. One thing that's bad about this code is that we don't have, I don't know what the 90, oh, the 95 is the CRC. I didn't put names for the commands in this code. I think I did that as a code size optimization, which is probably the wrong call now that I'm trying to look back at this. But yeah, I think the last, this argument here is the CRC. So command eight and then this and RB seven. So that's the response byte. So if you look, we have, I meant to find these. On Twitch, there's a lot of solutions and no dread in a module that talks to the Twitch API and you can trigger OPS changes. Problem is, is just like, it's just not my priority. My priority is doing this Raspberry Pi stuff. I'd like to get to the point where it's not all, like I spent weeks on code that is not mainlined yet. So it'd be nice, be nice to do that. It's good to review your own code when you've forgotten. Yeah, I'm doing that now. The code's changed a little bit since I wrote it, like the CRC stuff I hadn't added. Somebody else added that, I think. But yeah, so I think this is the, I don't know what this send if condition is. So let's find that in the docs. So it's in here, functional description commands. Oh, and then there's response types as well. So we'll want to take a look at that. So commands, and if we look at command eight, it says it's a basic command. This is like telling you when commands have to be available. Are you using an SDIO peripheral or SPI? This is an SDIO peripheral. I am not using SPI. What commands are mandatory? And then this is what they are, and they have these nice abbreviations. So I found in the expressive IDF, they had pound defines for these, and they had gotten them from OpenBSD, I think, which is cool. So this send if condition sends the SD memory card interface condition, which includes host supply, voltage information, and asks the card whether the card supports the voltage. So, do you want to come up or you want to go up? Are you going to stick around for when we have to say goodbye to folks? He's like, I couldn't wait that long, Dad. You have to pet me sooner. And then it says, let's just go back here to the responses, and it's response format seven. The card supported voltage information in 3.3 volt range is sent by the response command eight. He's getting anxious thinking he wants to go up. So I think what it will do is it'll just echo it back to us. So I think we should be able to run this, and then what we'll get back is, so response zero, let's print that out. All right, let me kick this cat out. Sorry. Come on, you're getting kicked out. He's like, no, that's not what I'm looking for. Although, what, like yesterday? Or this week, he actually meowed at the door to be let in. So I was going to say that this is the last of the cat, but who knows? Okay, so let's just do this, and then we'll print out the result. And let's do it as hex. Let's just go one at a time here. And if SD error, return SD error, which is like, it's a global, which is just like so weird. And then let's see what this does. So, well, let's get that far. This is complicated. The Raspberry Pi actually has two SDIO peripherals in the new one, I think in the Raspberry Pi four only. Or no, it's in the Pi three as well. The license wall for the SD simplified specs make me sad. It makes me sad too. And they make you scroll down to download it. Like that means that you read it. We should get the output here again. We got zero back. I don't think that's right. Is that right? I think we're supposed, I thought we were supposed to get the same value back. I think I'm supposed to get the same value back. What do we do in the Python? Do we check it in the Python? Because I know the Python code works for a number of cards. So it says, command eight, this thing, data block false, RB seven equals R. What is R? One, idle state or illegal command. So let's see what command does. It might be that I'm, actually it might be here. Card interface condition, start bit, transmission bit, command index reserve bits, PCIe, PCIe voltage. Echo back of check pattern. R is R, CRC end bit. The card that accepted the supplied voltage returns the R seven response. Not supported, not accepted. I feel like we should get the one card status. How do we get the response back? So command does, we create the buffer. If we're given an argument which we give, we pack it in, this is a byte array, so that's okay. And then the response buffer. Oh, it's a buffer to read a data block response into. All right, good night, Dishapu. But this is the spy interface. So let's take a look at the other example. I mean, maybe that's fine and we should just keep going. This is the send command, send if condition. And then what does it do special for that? Oh, that's what I was, that's what I'm missing. Send if condition, we wait. Which I don't know why it waits. If condition, if the response matches the argument then everything's okay. But I think what I'm missing is that the map last week, deep dive on standards, yeah.  At least they're documented, right? I can complain all I want, but I'd rather have large confusing docs than no docs at all. Okay, so I think what we need to do is what I'm missing is that if we look at the commands in this example, the commands are actually a full 32 bits worth. But if we pull up, have it here. So this is the command register, command TM register, and the command index. So there's 64 commands for SD cards. And so they're, what, five bits? Is that five bits, six bits? Six bits. So they're actually in like these upper bits, which is the command index, and then there's command types. And if we look, I've been experimenting with the SD card module and circuit by them, but it stops the code if there's no card in the reader. Is it the circuit pathline code? I might expect you to check that. Usually there's a card present, or forget what it's called. Usually there's a pin that you can check before. Before you do that, so that might be why. It expects you to make sure there's a card there first. It should raise an exception though. If it doesn't raise an exception, then follow bug. If it hangs, just like waiting forever, then follow bug please. Okay, so I think the missing piece here is that if we look back at the commands, they actually have more bits set than just the command itself. And so what we've got to figure out is how we want to manage that in our world. And so I think what these bits here are, the one, two, three, two, three, is the response type. So if we look at this bits 16 and 17, which are the kind of the three and then four zeros to the right of it, we can see that if it's set to two, which it is in this case, then it gets a 48 bit response, which we are currently ignoring or we're not setting correctly. So I think let's just simplify it briefly. Although actually, you know, I was thinking of doing a macro or an enum. So let's do a type def response type SD response. And I'm actually gonna make these not match the registers, match the SD card spec. And then internally I'll map the values from the SD card spec into the register values. So does that make sense? Maybe it doesn't make sense. The other way we can do it is because it's consistent for all the commands and we know what the commands are, we could just decide to store it all internally. And we're on a 64 bit machine, so I was like, maybe I'll just use UN64s. I could just have a bit mask of like all the ones that are a particular type. Yeah, maybe I won't, I don't wanna have to pass it in every time because that risks mismatching the command with the response type. So maybe what I do want is like a static, you are not static. Just like a const UN64 of R2 responses. And this is equal. Let's just look at the spec. So I think it's in commands, what's my month? Card registers, I might pass it. Command types, command format. It's in, not that table. This table, this response. So I think the most common response is, I guess I could just do them. How I wanna do this? Do I wanna just do it as a bit mask? I guess let's see how it looks. So R2 responses, and this is a bad example. Maybe I should do the R7. I wonder if there's any more than that single one. I don't think there are. So maybe it's okay to just special case it. I'm like so dependent on in response to command eight. So let's just hard code command eight. We'll deal with this later. We can say incend command, command forward with response. And we're gonna say if command equals MMC, oh no, it's SD, SD send if condition. Then we're gonna say, response type equals zero. Did I enumerate it? I think I might have. So which would be the status response type. Hey, oh, we have an enum for it. I'll use that. That type is kind of unwieldy. By default, we'll say no response. And if it's condition, then we'll do, and this response type needs to be shifted. And the command actually needs to be shifted too. And here we should be able to see also the, so this file here is generated automatically based on the SVD file. That I already painfully hand copied together. But it's very nice. Very nice to have SVD stuff. Oh, that's not right. How did I copy the wrong thing? So we're just trying to get a non-zero value back. Yes, I like the command response shifting. Hello from Greece. Hello, Creus Digital Studio. Thanks for dropping by. I've got my, should I put my, for the last 15 minutes, should I put everything back on? We'll see. I'm gonna go for a walk after that. There, I don't have to get any work done if I'm just wearing my full costume, right? Oh my goodness, where's the time gone? I know. Not SD cards, I'll tell you that. I'll take a break this weekend and come back renewed. Especially if I get the Pi, I'm gonna wanna get it going. The new Pi Zero. The Zero Two. I'm very excited, very, very excited to support it. And the regular Pi Zero also. DCD says, that's the trade-off, can't work done to wear the costume. Thanks, thanks, Dinkleburg. I'm glad you like it too. Good, this is perfect. I kind of like bookend it with the costume. Okay, we synced and we still got zero back. One thing that crossed my mind that can be really nice, I'm not gonna walk in the costume. It's been very rainy here. This costume would not hold up in the rain. Although it's not raining right now, which is nice. So we still didn't get anything back. I wish maybe I should order, I think they have things that you can stick in the SD card slot so you can introspect or like keep track of the pins. Probably should do that so I can use a logic analyzer. That's probably worth it. I wonder if Adafruit has it. I just made an order yesterday though, so if I order it now it's gonna be kind of a SD card. Like there's this extender thing. It's not quite what I want. Three volt breakout forecast is dry for a bit. I'm not, the design guide white paper is pretty cool. Is that a good resource? I haven't actually looked at it. I'm all about, yeah, logic analyzer is a good idea, isn't it? I should do that. It might be Sparkfun that has the SD card breakout. I wonder if they have any pi zero two still. Yeah, see the problem is I've seen these, nope, that's not what I want either. What is it? I want something I can stick in the micro SD card slot. I feel like I've seen these before. Do they not exist? I mean, I could try to like solder it down, which would be not fun. Ah, there you go. It is a Sparkfun thing. Korea says it would be great if we could order a pi zero two W. Well, since you're in Greece, there's probably somebody closer than Adafruit. Adafruit put some in stock earlier today, or yesterday, so I ordered one yesterday and it's coming. Micro SD sniffer. That's what I want. Let's see, didn't have great reviews. View what the spy traffic is doing. Oh, but it does have that zero one, two. Does Blinkett eat mice? Blinkett's friends with mice. Why is it only got three data pins broken out? That's very strange. Is that why it's not rated? It doesn't latch. I don't really want to hold it. Does it look like it should latch? Have a good one, Minnesota Mentat. It does kind of look like it should latch, but it may be not. Ah, Simone saying the Payunora's SD card connector is quite easy to solder to. Yeah, we could do that. Is it easier than this one? I have to dig out my Payunora. I know what box it's in, but I don't have it on my desk. Naradak got a zero two from Pimeroni. Nice. It's hard to find all eight of fruit products in Turkey. We often end up ordering clones for many electronic stuff from AliExpress. That's a bummer. Are you able to order from DigiKey? DigiKey does pretty good international shipping, I think. Definitely not easier than a full breakout. The missing DAT3 is weird. I agree. I'm not sure. I don't think I'll order this. I think I'll find my Payunora and see if I can't solder it down. If it's a thin PCB, I'll probably phrase a little at the edges. Yeah. Mouser is okay, but one time they canceled an order citing Adafruit to insubmit docs for some export regulations and my order had a Wi-Fi enabled chip. Hmm. I think Adafruit is able to do all the export stuff, but if that does happen, feel free to email supportadafruit.com and they'll try to help you, I think. Um, oh, okay. Let's just, I don't have a lot of options because I'm trying to use the host controller.  I think the Payunora is probably what I'll look at. Oh. Rdorsenaut said, I hit the same wall with Mouser on the airlift feature. Yeah. International shipping is really expensive. Yeah. That's been, that's true now everywhere, I think. Oh, it does have DAT3. It just calls it CS or CO. Well, maybe I will. It's not gonna come till next week. I'll figure it out. Payunora might be my best option, actually. Or I can like, yeah, it would be good. It would be good to have Adafruit grease distributors. Yeah, I don't know. I don't know who they're at it, whether there is anybody. Okay, so we didn't get a response back, which does make me think that it's time for a logic analyzer. So a logic analyzer would be able to confirm that I am transmitting what I thought I was transmitting at the speed I thought I was transmitting it at. And then also seeing if the card's responding and like I'm not reading the right register or something. David G says, recommended CM4 for the Payunora. They're hard to find. I would recommend whatever you can buy. At least for CircuitPython, it's not really gonna matter. But what are the options? I've just like, my Kynar wire or a Genard wire. I have some 30 gauge wire that I could use. JP says, trying to compile the CircuitPython locally on Windows WSL compiles fine for the QVPyR P2040, but I get a weird error for my board. If you ever have NPQ string problems, clean, do a make clean and then try it again. The thing that generates the Qster stuff is not always smart enough to rerun. So if it doesn't rerun, then you'll have errors like that. So just clean. If you ever get a build problem that you don't know how to fix, just clean and try it again first. It might actually work. But yeah, let's look for CM4s. Like, CircuitPython is gonna be great for any of them. Just download. Oh, I didn't look at the design guide. Did I post implementation guidelines? Software drivers. Are they gonna be like, here's our software drivers. See, for standards, that would make so much sense. Start the SD clock and initialize up to Command 8, which is what we're trying to do. And then we're trying to read the response. Why don't they just have open source drivers to go with it? I'll tell you why. This is what I've run up against. So much of this stuff is like, we don't need to document this. We just put it in Linux and that's it. I missed some of the chat. Should be fine with 26 gauge too. It's a one millimeter pitch. I made the pads wide and long. Oh, awesome. I'm like, totally down to do that. And I'll just solder it to like some of the other headers. That's gonna be great. A great reason to get that out. Are you planning on dealing with CM4s with and without onboard flash? I am. You're looking at SD Express though. That's newer than the standard. That uses PCIe not SCIO. Yeah. I hate when Linux is the only reference implementation. Yeah. You do not have the cat S740 license from the supplier. Hey, Corky, you should forward that email to support if it's been recent. Support at Advert.com or the folks that can settle that out for you. It is better than nothing to give you that. Let's just, I wanted to see what the options are for modules. If it was like relatively recently, I would email them too to just see if they've had that issue. Do they have ordering information? I do like the module interface. It just would be good to verify that it's like pushed down correctly, which bothered me. Oh, so this is one SCIO 2.0 CM4 Lite. Right, so the Lite version is the version without the onboard EMMC, which I think is this chip. Here we go. This is what I want. I want to see what's in code. Wireless, yes, no. So I'll support. I will equally not support wireless, at least at the start. RAM, one, two, four, or eight. Oh, eight gigs.  The Lite uses a four bit interface that EMMC uses eight bit. Same peripheral. Pemeroni actually has the wireless four gig, 32 gig, CM4 and stock. Nice. And then EMMC, I don't think any of the ones that I have have EMMC. So I'm gonna have to take a look at that. I would like to support it because it's like all in one then. But I think the ones that I have, I'll have to, I don't think I have them. I think all of the ones I have are Lite versions, but I could be wrong. I have like three. Let's see, what does this one say? CM4 Lite R1, R4. So this one's definitely a Lite one. It looks like it has the wifi, but it doesn't have this order code at least on the top, which is unfortunate. Anyway, so yeah, I intend on supporting all of the CM4s and like they're all gonna be I'll say it now and be like, a gig of RAM is perfectly fine for Circuit Python and like the Pi Zero 2W will only have half a gig. Like it's just gonna be a different world for Circuit Python regardless. Order code is only on the packaging, unfortunately. Yeah, that is unfortunate. I'll have to take a look later. But we've hit our two hour mark while I've been going a little bit more than two hours. So I think we'll wrap up and I'll get out of here and go for a walk. Let me switch to cameras. Well, thank you everyone for joining me on this Halloween deep dive. Glad you like my not a dinosaur, but it's Blinka costume. I work for Adafruit on Circuit Python. I do these streams, so thank you. We've got other people that can test the EMMC. Next week, we'll be taking a look at the Pi Zero 2W. I'll just point out doing that since I'll get mine tomorrow and I'm pretty sure, pretty confident that'll happen. So we'll continue this Raspberry Pi saga. Hopefully I'll make some progress on the SD cards. Thanks to Mon for sending me the early version of the Pi Unora that I'm going to solder to. It should be really cool. If you wanna follow along, I do push all my code to my GitHub. Oh, I know that. Umut says, my girlfriend's on vacation for a week. That means a full week spent on my Circuit Python projects. I know how that goes. Get some sleep and do your chores still and stuff. But I know how that goes. Yeah, so this has been a deep dive. We're here every week, or nearly every week on Fridays at 2 p.m. Pacific. Thank you all for joining in. Thanks for having the fun with me on this not a Barney costume. If you wanna support me, you can support me indirectly by supporting Adafruit by going to adafruit.com and purchasing something there. They pay me to do all this stuff. So that's really awesome and I appreciate them. Circuit Python is their creation. They've funded it from the get-go. So thanks to them. If you wanna chat with me and a lot of others throughout the week, we do have a Discord server, which is another chat channel. You can join that by going to adafru.it-discord. Next week will be on Friday, I think as well. And as always, thank you to David and Patrick for taking and wrangling the notes for the deep dives. If you don't know that and you wanna go back and look at past deep dives, maybe this is your first one. We do have a repo under Adafruit. Just search for deep dive. You'll find it that has all of the past notes. And Patrick's set it up so that you can look through like what we covered and click the time codes for a particular thing and it'll take you right to YouTube at the time code that that thing happened. So it's really neat and so if you wanna do a quick recap of like all of this Raspberry Pi for work, that's a great way to do it. These are the I like glasses. I think is what we decided the name was. They're available on adafruit.com although they may be out of stock. Digikey.com is a great place to check for things that are out of stock on Adafruit to see if they're in stock at Digikey. Anyway, next week we'll be SD card and the zero two W and like thinking more broadly about all of the other boards. And with that, the cat's out of the room so I won't give him a bet. Thank you all for hanging out. As always have a great weekend and we'll see and talk to you on the discords next week.


I am Assistant Professor from Department of Electronics from Walter Engineering College, Singapore. So today we are going to have an session on Introduction to DBMS. At the end of this session student will be able to define the term data database DBMS database system, differentiate between the database approach and traditional system and enlist and describe different types of database and users. So we are going to start with introduction to DBMS. So firstly we need to know what is data. So data is nothing but facts and statistics that can be recorded for reference or analysis. For example, text, numbers, videos, speech, audio, video, etc. Let's take an example of Ola and Uber, they don't have their own caps. They are having the data of the caps and they provide it to the customers. Even if you take the example of online shopping, when you open the social media websites like Facebook or Instagram, Twitter, what they do, they flash you the products you have searched. Why this is so? Because they have recorded your search engines. So this is the data which is nothing but the facts and statistics that has been recorded. What is information? Information can be processed data or the meaningful data. Like for example, YouTube, when you open the YouTube, you have millions of videos. But what is information? You open the search tab and you search for the videos which is required by you. That is for example, if you search the video for introduction to DBMS, that is the information for you. Next is what is database? Database is a collection of related data that represents the real world or the mini world. Database is logically coherent collection of data with some inherent meaning. A random data cannot be correctly referred as database. Database is built and populated with data for specific purposes. In other words, you can say database to be accurate and reliable at all times. It should be reflection of mini world or the real world. If you go with the examples, it will be clear for you. Here the recorded data of that person with the name, telephone number and addresses is the database for you. And if you go for the faculty database, university or the college is having database for the faculties. They record all the information of the faculties and even if the faculty gets resigned or even if he gets married or if he has his dependence, all the data is recorded in the faculty database.  So whatever is happening in the real world, it should get updated into the database. What is database management system? Database management system is nothing but database plus management system. A database management system which is DBMS is a collection of interrelated data and a set of programs to access that data. A primary goal of DBMS is to provide a way to store and retrieve the database information that is both convenient and efficient. DBMS is a computerized system that enables the user to create and maintain the database. So why we are going to use the database management system? You are familiar with the client server architecture. The figure in the right side shows you the client server architecture. In the between, you have the server and you have the clients all over the server. So you are the users with the laptop or computer mobile phones. They are nothing but the clients and the server is nothing but where the data is been stored. If you take the example of the IRCT website, so if you want to search for a particular train and if you consider like 25 GB of data is present in the IRCTC website and you want to search only 1 KB of data of that particular train and if you are going for the file processing system, then what you have to do? You have to download all the 25 GB of data onto your computer or laptop or you can say the local drive and then you have to go for searching of 1 KB of data from that 25 GB of data. This is so much of complicated, so much of time consuming also that you have to download all the 25 GB and then search the 1 KB of data. But if you go for the database management system, you have not to download all the 25 GB of data. You have to log into the server and just search for that 1 KB of data. That is so easy. This is the beauty of DBMS. We'll see the features of the database management system comparing it with the file processing system. First feature is the location. When you go for the file processing system and you want to access one file in the file processing, you have to know the location of that file. Like if you are searching for file in your PC or the laptop, you know the location of their local drive, then folders, then subfolders and everything. But in your database management system that is DBMS, you need not to know the location of your file. The beautiful example for this location feature is when you open a YouTube and you go for searching of any video, you need not to know the location of that particular video. You can simply search for that particular video and you can access it. But if you go for the file processing, you need to know the location of the file. Then only you can access it. Next is the concurrency control. What is concurrency?  So if you are using the file processing system and if you want to share file with your friend or someone, what you need to do? You need to share the file or you need to give your laptop or PC to some other so that you can access it. But in the database management system, whatever database is there or whatever the data is there, it is stored in the server. You just need to login into it and access it. So you can have multiple users sitting at your home. No need to give the access to your devices. So whatever data is there, it is in the server and you have to access it using the clients. So this is a feature for the concurrency which will provide you the feature of multiple user at a time. So this is not possible in the file processing. Next is the security, which is role-based system. Example of university if you take student, faculty and the HOD. So these are the three role plays we are going to see. So when you go for the student, student is able to see only the name, address, phone number and the subjects of that particular student. So he is not able to or he is not allowed to view the data of the faculty. What are the faculty database and all. But when you go for the faculty, faculty is able to view the data of that particular student of his subject not allowed to view the information of other faculties in that department. Only his data and his student's data he can view. And the other role is HOD. So HOD can view the information of the faculty student as well. But he cannot view the information of other department HODs. So database management system provides a security which is called as role-based security. So you can provide the restrictions that student cannot view the faculty information, faculty cannot view the other faculty information and HODs cannot view the other HODs information. Such type of role-based or security is provided in the database management system. But this security is not provided in the file processing system. Next is the data redundancy. So data redundancy is nothing but data duplication. If you take the example of lab assistant of one particular department and the office administrator. So these two persons are going to have the data of one particular XY student. Data redundancy is nothing but data duplication. The same information is recorded by the two different users. If you go through the diagram over here, the left side which is the file-based approach. So the same data you can see the set, this is intersection set and same data is being stored by the two different users using two different applications. And the right side what you are having is the database approach. You are having one single database which is common for both the users. And the both the users are going to access this database using one single DBMS software. Which is in your case you can see data is wisely stored you can see. So same data is stored by two different users. So this is nothing but example of data redundancy you can see. Next go for the file processing system and the database management system differentiate. So first is file system is general easy to use system to store general files which require less security and constraints. So whenever there is a less security you can go for file processing system, when there is more security you can go for the database management system. Data redundancy is more in the file processing system. Because when you go for file processing system, duplicacy of data is happening in the file because both the users are going to save the same data of that particular user. Next is the data redundancy. Data redundancy is less in the database management system. As seen in the previous slide only one single database is going to access by the two different users. Centralization is hard when it comes to the file processing system. And centralization is very easy and it is achieved using the database management system. Next is user locates the physical access of the files to access the data in the file processing system. But in database it is user is not aware about the physical location of the data where it is stored. Next is security is very low in file management system and security is very high in the database management system. So you can say with the help of role based model we have seen the difference of the how the security is very low in the file system and how security is high in the database management system. So these are the references of the database systems by Ramesh and the Shamkand B Naute. Thank you.