1 00:00:01,920 --> 00:00:03,840 Welcome to The CircuitPython show. 2 00:00:04,100 --> 00:00:05,180 I'm your host, Paul Cutler. 3 00:00:05,780 --> 00:00:08,640 This episode, I welcome back Scott Shawcroft for the second time. 4 00:00:09,440 --> 00:00:11,080 Scott is the project lead for CircuitPython, 5 00:00:11,260 --> 00:00:14,180 and his work on CircuitPython has been sponsored since 2016. 6 00:00:15,020 --> 00:00:17,600 Prior to that, Scott spent six years working at Google 7 00:00:17,880 --> 00:00:21,040 and holds a degree in computer engineering from the University of Washington. 8 00:00:22,660 --> 00:00:23,760 Scott, welcome back to the show. 9 00:00:24,240 --> 00:00:25,040 Thanks for having me. 10 00:00:26,200 --> 00:00:27,880 One of the things you've been working on is Zephyr, 11 00:00:28,100 --> 00:00:30,660 which is an open source real-time operating system. 12 00:00:30,660 --> 00:00:30,860 That's right. 13 00:00:31,340 --> 00:00:34,040 And you've been working to get CircuitPython running on top of it. 14 00:00:34,660 --> 00:00:38,580 For someone who hasn't heard of Zephyr, what is it and how is that progress going? 15 00:00:39,660 --> 00:00:44,080 Yeah, so back in the old days, 10 years ago when I started doing this, 16 00:00:44,260 --> 00:00:49,800 what would happen is that each individual vendor would have this software development kit that you would have to do. 17 00:00:50,530 --> 00:00:52,900 So Atmel had their Atmel software framework. 18 00:00:53,660 --> 00:00:57,860 Nordic still has their own Nordic thing and expressive still has their own expressive thing. 19 00:00:58,560 --> 00:00:59,520 But they got together and they said, 20 00:01:00,250 --> 00:01:03,380 this is kind of like a lot of work to do it all together. 21 00:01:04,080 --> 00:01:07,100 There's so many things like Wi-Fi and USB 22 00:01:07,760 --> 00:01:09,840 and networking, like, internet stuff, 23 00:01:10,260 --> 00:01:13,340 that like, it would be great if we just had one source code 24 00:01:13,420 --> 00:01:16,360 that we could use instead of having to redo it ourselves. 25 00:01:16,830 --> 00:01:19,840 And so Zephyr is this real-time operating system, 26 00:01:20,000 --> 00:01:22,720 so it's managing what is running on the CPU 27 00:01:23,160 --> 00:01:24,000 within the microcontroller, 28 00:01:24,520 --> 00:01:26,020 but it's also doing a lot of other stuff 29 00:01:26,120 --> 00:01:32,160 abstracting away iSquard C and spy and providing network stack and Bluetooth stack, 30 00:01:32,640 --> 00:01:37,080 all that sort of stuff in a general way that like any vendor can now contribute to. 31 00:01:37,880 --> 00:01:43,180 And so our interest in that is primarily for the fact that like a lot of vendors have 32 00:01:43,560 --> 00:01:47,580 brought in support or like supporting their chips in Zephyr. 33 00:01:48,130 --> 00:01:53,579 So by us building CircuitPython on top of Zephyr, we kind of get a lot of chips for free 34 00:01:54,160 --> 00:01:56,120 where we don't have that much work to do 35 00:01:56,320 --> 00:01:59,060 to bring up Ice squared C or SPI or Flash 36 00:01:59,200 --> 00:02:00,180 or all these sorts of things. 37 00:02:00,660 --> 00:02:01,920 We don't have to manage compilers. 38 00:02:01,950 --> 00:02:03,560 We don't have to manage compiler flags. 39 00:02:03,700 --> 00:02:07,220 It's just quite easy that once something is supported in Zephyr, 40 00:02:07,360 --> 00:02:10,080 we can get CircuitPython going in Zephyr, 41 00:02:10,280 --> 00:02:10,860 and it's been great. 42 00:02:11,420 --> 00:02:14,960 The other thing is that the real-time operating system part 43 00:02:15,120 --> 00:02:18,220 means that managing what is running when 44 00:02:18,580 --> 00:02:20,240 is kind of like not our job anymore. 45 00:02:21,020 --> 00:02:22,200 So in CrcuitPython right now, 46 00:02:22,300 --> 00:02:26,040 We have our own system for managing things that run in the background. 47 00:02:26,380 --> 00:02:30,320 So like display updates and audio generation are the two main ones. 48 00:02:30,780 --> 00:02:34,960 And it's like kind of our own real-time operating system, but it doesn't work that well. 49 00:02:35,560 --> 00:02:41,460 There's a world where it would actually be much better for us to have a proper real-time operating system to manage that. 50 00:02:42,040 --> 00:02:45,200 So kind of two-fold for why Zephyr is really interesting to us. 51 00:02:45,960 --> 00:02:48,800 How is the progress in getting CircuitPython running on top of Zephyr coming? 52 00:02:49,560 --> 00:02:50,360 It's going pretty well. 53 00:02:50,500 --> 00:02:51,320 It does work. 54 00:02:51,660 --> 00:02:56,620 We do have a few boards where we have two versions of CircuitPython for the same board. 55 00:02:57,220 --> 00:03:01,280 One is like the classic, like, here's just the version built on the Nordic SDK, 56 00:03:01,520 --> 00:03:03,780 and here's the version that's more general. 57 00:03:04,480 --> 00:03:08,000 One of the biggest wins we would get is newer Nordic support. 58 00:03:08,720 --> 00:03:10,580 So for the NRF 54s. 59 00:03:10,980 --> 00:03:16,080 And so when I was working on that, I kind of left off in the middle of Bluetooth support. 60 00:03:16,600 --> 00:03:21,580 And I've just not gotten back to that because LLMs and agents have just, 61 00:03:21,740 --> 00:03:28,980 changed the world. And we'll get back to it, I promise, but for now we're redefining or 62 00:03:29,040 --> 00:03:29,980 reworking how we work. 63 00:03:30,440 --> 00:03:32,900 How are LLMs helping you with that work? 64 00:03:33,300 --> 00:03:34,440 They do the tedious part. 65 00:03:34,780 --> 00:03:39,700 I think that's the simplest way to think about it. If you're doing something tedious, they're quite good. 66 00:03:40,340 --> 00:03:44,460 And they're quite good, especially if you have a way to feedback and make sure that what they've done 67 00:03:44,460 --> 00:03:50,480 is correct. So one example I did is that our expressive chips, which are Wi-Fi chips, they're built 68 00:03:50,500 --> 00:03:54,300 on top of the ESP IDF, which is like the vendor version of what I was talking about, 69 00:03:54,480 --> 00:03:54,580 right? 70 00:03:55,200 --> 00:03:56,280 And I said, you know what? 71 00:03:56,360 --> 00:04:01,040 Like, they just released version 6 and we have version 5, and there is this change log that 72 00:04:01,080 --> 00:04:04,060 says, like, these are all the things that we change, and here's how you change this to that. 73 00:04:04,400 --> 00:04:05,080 It's like, you know what? 74 00:04:05,400 --> 00:04:06,380 An LLM can do this. 75 00:04:06,500 --> 00:04:11,000 So I said, hey, Claude, I want you to move from this version to this version. 76 00:04:11,100 --> 00:04:13,320 And by the way, we have some changes we've made. 77 00:04:13,400 --> 00:04:14,560 You'll probably have to do that too. 78 00:04:16,359 --> 00:04:17,140 And it did it. 79 00:04:18,120 --> 00:04:26,120 Like, you teach it how to compile, and it got it all compiling. But then the question was, is like, how do I know that it works? Like, it compiles, 80 00:04:26,480 --> 00:04:33,840 but does it work still? And now suddenly it's up to me to like test it again. And that's led to 81 00:04:34,280 --> 00:04:37,080 the hardware and the loop stuff that you wanted to talk about. 82 00:04:37,140 --> 00:04:38,400 Yeah, it's a great segue. That's 83 00:04:38,480 --> 00:04:42,040 actually the next question that you've been working on hardware in the loop PCBs for testing 84 00:04:42,620 --> 00:04:47,960 microtrollers. That's right. For someone that hasn't heard of it, what is it? And how does that work? 85 00:04:48,620 --> 00:04:53,560 Hardware in the loop is this idea that you can automate testing on device. 86 00:04:53,900 --> 00:04:59,200 So like I was saying, I've automatically had this LLM update from this version to this version, 87 00:04:59,980 --> 00:05:02,540 and it was able to do compilations on my computer, 88 00:05:02,800 --> 00:05:08,360 but it never actually loaded it on the device and can't actually verify that things actually work. 89 00:05:08,900 --> 00:05:13,500 And so this is something that on-device testing is something we should have been doing a long time. 90 00:05:13,980 --> 00:05:17,560 In fact, within the first year of CircuitPython, it was something that I did try to do. 91 00:05:18,020 --> 00:05:23,480 We tried to do Rosie CI, and I, like, had a Raspberry Pi with a bunch of USB cores on it, 92 00:05:23,540 --> 00:05:26,540 and it was, like, trying to get it run every time we made a change, 93 00:05:26,680 --> 00:05:28,480 just to make sure that we don't regress. 94 00:05:29,140 --> 00:05:32,520 And we've gotten quite far not having that for the last 10 years. 95 00:05:33,360 --> 00:05:35,620 But LLMs changed the game for that in a couple ways. 96 00:05:35,800 --> 00:05:38,740 One, it's super useful for that feedback loop for an LM. 97 00:05:39,260 --> 00:05:43,200 But also, two, actually, LLMs can help with a lot of the tedious work about that as well, 98 00:05:44,210 --> 00:05:47,000 of, like, writing a lot of boilerplate for test cases and stuff, 99 00:05:47,140 --> 00:05:50,080 is much easier now with LLMs as well. 100 00:05:50,320 --> 00:05:51,780 So it's the perfect moment. 101 00:05:52,340 --> 00:05:54,980 The board itself was my desire 102 00:05:55,800 --> 00:05:59,400 to have a kind of standard setup for doing it. 103 00:05:59,800 --> 00:06:02,420 So like something that you could plug a dev kit into 104 00:06:03,220 --> 00:06:05,840 to find what the pin mapping to the device under test is, 105 00:06:05,880 --> 00:06:07,400 and then you have all the same facilities, 106 00:06:08,060 --> 00:06:09,720 all the same code running on the thing 107 00:06:09,800 --> 00:06:11,180 that's actually running the test. 108 00:06:11,860 --> 00:06:14,660 And then one problem I had with the one 10 years ago 109 00:06:14,760 --> 00:06:16,880 was that I was using the Linux USB stack. 110 00:06:17,120 --> 00:06:19,160 and one of the things that we're testing is USB, 111 00:06:20,320 --> 00:06:22,920 what would happen is I'd actually crash the Linux kernel 112 00:06:23,700 --> 00:06:25,960 or the Linux kernel would get in a bad state 113 00:06:26,100 --> 00:06:28,420 and Dan's reached out to them at one point 114 00:06:28,540 --> 00:06:30,340 where like, hey, we found this bug and they're like, 115 00:06:30,420 --> 00:06:34,980 well, that's only a bug if your USB device is not working correctly, 116 00:06:36,400 --> 00:06:38,380 which we happen to from time to time. 117 00:06:38,500 --> 00:06:41,360 And so one thing I wanted to achieve with the hardware 118 00:06:41,380 --> 00:06:45,500 and the loopboard is that it doesn't do USB straight into your computer. 119 00:06:45,800 --> 00:06:49,020 it translates USB over to a network connection. 120 00:06:49,640 --> 00:06:50,860 And once it's in a network connection, 121 00:06:50,900 --> 00:06:53,360 you can do all the USB stuff in Python 122 00:06:54,080 --> 00:06:56,540 without ever involving your actual Linux kernel. 123 00:06:57,200 --> 00:06:59,140 And so you could do all the testing that way instead. 124 00:06:59,660 --> 00:07:01,000 And that's a lot of boilerplate code 125 00:07:01,100 --> 00:07:04,700 that LMs can do a reasonable job at generating in Python. 126 00:07:05,220 --> 00:07:06,940 So that's just part of it. 127 00:07:08,819 --> 00:07:12,000 August 2026 marks 10 years for you working on CircuitPython. 128 00:07:12,580 --> 00:07:12,740 Yeah. 129 00:07:13,259 --> 00:07:15,260 We've talked a lot about what you're working on, 130 00:07:15,560 --> 00:07:18,660 but looking past, do you have a favorite memory that you want to share? 131 00:07:18,840 --> 00:07:21,600 Or is there something that you're really, really proud of in that time? 132 00:07:22,220 --> 00:07:23,480 Yeah, I was thinking about this. 133 00:07:23,660 --> 00:07:27,760 I don't, a lot of the memories I have around CircuitPython are like actually me, 134 00:07:28,840 --> 00:07:33,360 going from this person that was on show intel to somebody who, like, worked closely with Phil and Limor. 135 00:07:34,300 --> 00:07:35,620 And I've been like super lucky. 136 00:07:35,940 --> 00:07:40,980 And like the project, like, I hadn't actually heard a MicroPython when they asked me if I wanted to work on it. 137 00:07:41,480 --> 00:07:43,960 But I had done Python and I just discovered embedded. 138 00:07:44,180 --> 00:07:46,680 And I got super lucky with the whole thing. 139 00:07:47,460 --> 00:07:50,340 So I think a lot of my, like, highlights are around that. 140 00:07:50,560 --> 00:07:54,380 One highlight I thought of was actually the Pycons where we gave hardware away 141 00:07:54,480 --> 00:07:58,420 and the swag bags, just having a lot of people excited about it. 142 00:07:58,880 --> 00:08:03,560 I think that because we're 10 years old, like, CircuitPython's quite mature now. 143 00:08:04,120 --> 00:08:06,800 So a lot of my experience right now, because I haven't been to conferences, 144 00:08:07,100 --> 00:08:11,560 is around, like, somebody just randomly saying, like, oh, yeah, I use CircuitPython for that. 145 00:08:11,740 --> 00:08:12,720 I'm like, wait what? 146 00:08:13,320 --> 00:08:18,440 Like my Makerspace used it for their like authentication, like let people in the room sort of stuff. 147 00:08:18,520 --> 00:08:19,200 And I was like, really? 148 00:08:20,280 --> 00:08:21,540 So I'm really surprised by that. 149 00:08:22,660 --> 00:08:25,420 And then you had said like what I was most proud of as well. 150 00:08:25,520 --> 00:08:36,300 And I think what I'm proud of with CircuitPython is that a lot of the decisions that I had a lot of influence over when we first started have proven out to be good ones. 151 00:08:36,960 --> 00:08:43,120 Lots of small modules that are standardized across different microcontrollers, the design of that a 152 00:08:43,180 --> 00:08:49,000 that we've built hundreds of libraries on top of in a way that we could then come along later 153 00:08:49,320 --> 00:08:54,460 and make available on Linux, single-board computers like Raspberry Pi via Blinka as well. 154 00:08:54,980 --> 00:08:58,320 It's like that's all proven out to be the right call. 155 00:08:59,000 --> 00:09:04,440 And also the behavior of CircuitPY of like you write to the file and it auto reloads. 156 00:09:04,480 --> 00:09:07,560 Like that was something new and still unique to CircuitPython. 157 00:09:08,320 --> 00:09:13,100 And I think like people think that's what CircuitPython is, even though we, 158 00:09:13,120 --> 00:09:17,720 we've relaxed that. For a while, that was our requirement, and that requirement's been relaxed. 159 00:09:17,880 --> 00:09:23,000 But I'm very, very proud of the fact that those decisions we made in that first six months, 160 00:09:23,440 --> 00:09:28,200 like, I've really played out. And it's not often that as a software engineer, 161 00:09:28,320 --> 00:09:35,920 I'd get that sort of long, long-life feedback. So, yeah, really proud where we've come with it. 162 00:09:37,200 --> 00:09:41,200 The Fruit Jam just turned one. When J.P. was on the show earlier this year, 163 00:09:41,280 --> 00:09:44,720 he shared a story of how the two of you talked in New York City back in 2017 164 00:09:45,540 --> 00:09:47,960 about building a CircuitPython powered mini computer, 165 00:09:48,340 --> 00:09:49,860 which is what the Fruit Jam is. 166 00:09:50,620 --> 00:09:51,600 With that dream realized, 167 00:09:51,800 --> 00:09:53,500 what do you see in the future for CircuitPython? 168 00:09:54,700 --> 00:09:56,420 That was definitely something I wanted to do. 169 00:09:56,600 --> 00:10:01,800 I only have very old memories of like those like bespoke single task computers 170 00:10:02,120 --> 00:10:03,120 like the Commodore 64, 171 00:10:03,920 --> 00:10:05,700 but that doesn't mean that I didn't think it was cool. 172 00:10:06,420 --> 00:10:08,360 And same with like the fantasy console stuff. 173 00:10:08,440 --> 00:10:09,600 The Fruit Jam definitely, 174 00:10:11,040 --> 00:10:13,020 I did a lot of the foundational work for it, 175 00:10:13,100 --> 00:10:15,840 and then folks, especially like Tim Foamyguy, 176 00:10:16,060 --> 00:10:17,940 like really, really ran with it. 177 00:10:18,380 --> 00:10:20,260 And it's been awesome to see what people have done, 178 00:10:20,840 --> 00:10:22,580 including John and Cooper as well. 179 00:10:23,120 --> 00:10:25,480 So I think it's really cool that the fruit jam 180 00:10:25,880 --> 00:10:27,120 has done as well as it has. 181 00:10:28,500 --> 00:10:31,440 There's this thing that I've really wanted to do 182 00:10:31,500 --> 00:10:34,160 with CircuitPython that I still haven't been able to do, 183 00:10:34,760 --> 00:10:36,500 which is being able to program from your phone. 184 00:10:37,280 --> 00:10:39,180 And if you see my, like, annual writings, 185 00:10:39,320 --> 00:10:40,980 I'm always like, we've got to crack this. 186 00:10:41,440 --> 00:10:43,280 Like, how do you program for your phone thing? 187 00:10:43,380 --> 00:10:47,180 And, like, we did a lot of work on Bluetooth and a Bluetooth workflow, 188 00:10:47,620 --> 00:10:51,760 and we had PyGlider and FileGlider and these apps that can work with it, 189 00:10:51,840 --> 00:10:53,260 and they just never took off. 190 00:10:53,680 --> 00:10:56,900 We did Web Workflow, like, using the website after that, 191 00:10:56,980 --> 00:10:58,320 and, like, even that got more traction. 192 00:10:59,540 --> 00:11:04,240 And I think the core of it is that, like, it's really terrible to code on your phone. 193 00:11:04,720 --> 00:11:07,080 Like, it's terrible to input text and edit text. 194 00:11:07,640 --> 00:11:09,220 And so my hope is that with, 195 00:11:09,340 --> 00:11:13,080 LLMs will be able to not need that anymore. 196 00:11:13,800 --> 00:11:16,220 You'll be able to tell your phone, like, make the LED blink faster. 197 00:11:16,760 --> 00:11:20,060 And CircuitPython is simple enough, but it can modify that. 198 00:11:20,720 --> 00:11:23,600 So I'm really optimistic for that future. 199 00:11:24,080 --> 00:11:29,460 The BLE workflow has rotted a little bit, but that is definitely something on my vision 200 00:11:29,700 --> 00:11:30,340 for CircuitPython. 201 00:11:30,680 --> 00:11:35,780 A lot of what my vision is around workflow, because that's core to how you interact with 202 00:11:36,210 --> 00:11:36,340 it. 203 00:11:36,720 --> 00:11:39,220 More broadly than that, like what features we have, 204 00:11:39,340 --> 00:11:42,640 really depends on like, what can microcontrollers do 205 00:11:42,800 --> 00:11:44,160 that we don't allow you to do. 206 00:11:44,840 --> 00:11:48,140 So one thing that we haven't really taken advantage of yet 207 00:11:48,280 --> 00:11:52,280 is like newer display bus protocol called DSI, 208 00:11:52,780 --> 00:11:55,760 which allows you to do like higher resolution screens 209 00:11:55,860 --> 00:11:57,580 and stuff that end up in phones. 210 00:11:58,120 --> 00:11:59,900 And like, that's something that I would like, 211 00:12:00,220 --> 00:12:02,260 we actually do support, but I don't see us 212 00:12:02,660 --> 00:12:04,660 like really pushing people yet on. 213 00:12:05,260 --> 00:12:07,480 There's like Can Bus, I think we could do a better job 214 00:12:08,160 --> 00:12:09,240 with I3C is. 215 00:12:09,340 --> 00:12:17,820 out there. So yeah, it's a mix of like workflow thinking and what other things can microcontrollers 216 00:12:17,940 --> 00:12:22,480 do that we don't make easy. The other thing that we don't make easy that we could make easier is 217 00:12:22,880 --> 00:12:27,060 async, so being able to do multiple things at once. I want to watch a button and make an LED 218 00:12:27,340 --> 00:12:33,620 animation and have an HTTP request or HTTP server going at once. And I've gotten more 219 00:12:33,860 --> 00:12:39,220 comfortable with asyncio in Python and I think we could do a better job of having basically 220 00:12:39,240 --> 00:12:44,580 async versions of our APIs now so that you could do asynchronous spy or asynchronous iSquard 221 00:12:45,180 --> 00:12:50,220 Z, which would allow you to do kind of both things at once. So that's another big thing that 222 00:12:50,640 --> 00:12:56,940 that I've kind of like in my brain said like maybe Cirquiv511 is where we do that. And we could 223 00:12:57,380 --> 00:13:02,580 leverage like Zephyr and the real type operating system under the hood to like basically say like 224 00:13:02,800 --> 00:13:09,200 to really use that so that you can, none of your async IO tasks are happening. Then you can actually 225 00:13:09,220 --> 00:13:14,720 sleep and coordinate all the way down into the operating system underneath too. 226 00:13:16,000 --> 00:13:17,040 So yeah, there's more to do. 227 00:13:18,280 --> 00:13:20,520 Yeah, I did a project a year or two ago that used asyncio 228 00:13:20,920 --> 00:13:23,220 And it's pretty hard to wrap your head around at first. 229 00:13:23,300 --> 00:13:25,720 But once you do, it was just so powerful. 230 00:13:26,460 --> 00:13:30,940 But things that were blocking, like doing an HTTP request, get in the way of like an LED 231 00:13:31,220 --> 00:13:31,780 matrix scrolling. 232 00:13:31,920 --> 00:13:33,680 So figuring that out took a little bit of work. 233 00:13:34,060 --> 00:13:34,620 Yeah, yeah. 234 00:13:34,760 --> 00:13:37,280 And I think the answer is like there's really no better way to do it. 235 00:13:38,180 --> 00:13:42,820 Like, ASyncIO is not great, but a lot of smart people have thought about it for a long time, 236 00:13:43,140 --> 00:13:46,740 and there's not a great way, more obvious way to do it. 237 00:13:47,380 --> 00:13:50,480 So I think we could do a better job of, like, natively supporting that. 238 00:13:51,160 --> 00:13:56,980 I know it's more often used in MicroPython, but it's usually that they've built a layer on top of it 239 00:13:57,500 --> 00:13:59,520 that does it instead of, like, the native APIs. 240 00:14:00,340 --> 00:14:01,600 So, yeah, we'll take a look at that. 241 00:14:03,060 --> 00:14:07,620 Tell me about the custom RP2350 Game Boy cartridge you designed that runs CircuitPython. 242 00:14:07,660 --> 00:14:11,080 Okay, well, let me take you back seven years. 243 00:14:11,560 --> 00:14:13,000 I think it's been seven years, maybe eight. 244 00:14:13,920 --> 00:14:21,620 I had this idea that I could make any cartridge-based system 245 00:14:23,240 --> 00:14:24,500 programmable by CircuitPython. 246 00:14:24,700 --> 00:14:29,300 They basically using, making the cartridge dynamic 247 00:14:29,520 --> 00:14:32,620 to basically talk to the thing through the CPU. 248 00:14:33,380 --> 00:14:37,440 So, like, for example, okay, I'm on a Game Boy, 249 00:14:37,560 --> 00:14:39,280 and I want to show this thing on the screen, 250 00:14:39,500 --> 00:14:41,120 well, I use these instructions, 251 00:14:41,460 --> 00:14:43,080 I have the CPU run these instructions 252 00:14:43,230 --> 00:14:45,080 in order to set the data the way that I want. 253 00:14:45,800 --> 00:14:47,680 And so I had thought of this, 254 00:14:47,800 --> 00:14:50,140 and at the time it was like SAMD51, 255 00:14:50,190 --> 00:14:51,940 it was kind of the new hotness. 256 00:14:52,560 --> 00:14:54,400 And so I got it pretty far 257 00:14:55,160 --> 00:14:57,140 the ability to like cue up instructions 258 00:14:57,380 --> 00:14:58,980 that the Game Boy would execute for me, 259 00:14:59,700 --> 00:15:01,720 but it would like, at some point something would happen 260 00:15:02,300 --> 00:15:04,640 just like crash the Game Boy and you'd be done. 261 00:15:05,320 --> 00:15:06,400 And I was like, ah, this is like, 262 00:15:07,040 --> 00:15:07,440 I was using, 263 00:15:07,580 --> 00:15:09,520 DMA and the CMD-51, I was like, 264 00:15:09,540 --> 00:15:11,600 there's something around this that's just not quite 265 00:15:12,630 --> 00:15:13,460 right. So I had to 266 00:15:13,560 --> 00:15:15,380 basically put it away. I was like, I 267 00:15:16,280 --> 00:15:17,400 don't feel like I can 268 00:15:17,520 --> 00:15:19,040 figure out why this is happening. 269 00:15:19,760 --> 00:15:21,280 So I had this design for a cart that you would 270 00:15:21,440 --> 00:15:22,880 insert into it. And then 271 00:15:23,040 --> 00:15:25,260 RP2040 came along and it was like, 272 00:15:25,320 --> 00:15:26,580 oh, PIO is really interesting 273 00:15:27,260 --> 00:15:28,960 because it can offload the, like, 274 00:15:29,260 --> 00:15:31,360 let me watch this Game Boy bus and make sure that I 275 00:15:31,990 --> 00:15:33,420 have a data back to it when it's 276 00:15:33,480 --> 00:15:35,040 reading. But the problem was that 277 00:15:35,220 --> 00:15:36,980 2040 didn't have quite enough pins. 278 00:15:37,420 --> 00:15:42,040 to be able to do both the Game Boy Bus and the few other things that I wanted to do. 279 00:15:42,380 --> 00:15:46,520 For example, the cart also has MIDI input and output on it. 280 00:15:47,280 --> 00:15:51,400 The new one also has StemaQT, so you could plug a Stemakutie board in there as well. 281 00:15:52,400 --> 00:15:54,040 So the RP2350 came out. 282 00:15:54,160 --> 00:15:58,640 It has PIO that's a little better than RP2040, but it also has more pins. 283 00:15:59,260 --> 00:16:00,940 So I have lots of pins on this cart now. 284 00:16:01,820 --> 00:16:06,060 And it turns out they're 5-volt tolerant as well, so it only level shift the data lines. 285 00:16:06,260 --> 00:16:07,720 I don't have to worry about the address lines. 286 00:16:08,520 --> 00:16:11,320 So yeah, it's on V8 right now, 287 00:16:12,120 --> 00:16:15,100 and that version originates from SAMD days. 288 00:16:15,720 --> 00:16:19,880 And I've got it where it is running CircuitPython within a Game Boy Cart. 289 00:16:20,230 --> 00:16:23,820 I use a thicker PCB, and I made it slightly bigger, 290 00:16:23,890 --> 00:16:25,480 so you don't need to put it in a shell. 291 00:16:26,140 --> 00:16:29,960 SAMD versions, you had to, like, get an old Game Boy Cart shell 292 00:16:30,120 --> 00:16:32,700 or 3D print yourself one and cut holes in it or something 293 00:16:33,400 --> 00:16:35,060 for the MIDI outputs and stuff. 294 00:16:35,280 --> 00:16:38,340 but I had seen somebody do a Game Boy cart 295 00:16:38,460 --> 00:16:39,460 where you just make it thicker 296 00:16:39,660 --> 00:16:40,960 and you can just slot it right in. 297 00:16:41,520 --> 00:16:42,440 So that's what I have working. 298 00:16:42,940 --> 00:16:44,900 It's able to boot up. 299 00:16:45,840 --> 00:16:49,140 Somebody else had made an RP 2350 cart called the Crocko Cart. 300 00:16:50,000 --> 00:16:53,520 They're really geared towards being a loadable, 301 00:16:54,140 --> 00:16:56,720 like load whatever game you want on it and play it. 302 00:16:57,260 --> 00:16:58,480 So they actually have hyper-ram 303 00:16:58,640 --> 00:17:00,200 and they have to do other tricks for that. 304 00:17:00,700 --> 00:17:04,160 But they did have an example where they can have PIO-read, 305 00:17:04,360 --> 00:17:09,819 the address, look it up in memory and using DMA and then get it back to another PIO, 306 00:17:10,100 --> 00:17:12,579 like all automatically without the CPU being involved. 307 00:17:13,280 --> 00:17:19,319 And so I've gotten that working by having like a 64K cart within CircuitPython. 308 00:17:19,579 --> 00:17:24,500 And then right now I'm working on getting it so that when you say, hey, like tell the Game 309 00:17:24,500 --> 00:17:26,040 Boy to do these things, these instructions. 310 00:17:26,800 --> 00:17:32,260 I'm working to get that in memory so that when these things happens, it does the thing that you want. 311 00:17:32,940 --> 00:17:34,140 And I'm hoping to have it done this week. 312 00:17:35,240 --> 00:17:37,840 I've committed to being done with this project by the end of the week. 313 00:17:38,440 --> 00:17:43,000 And it's looking like we'll probably have it available from Adafruit as well. 314 00:17:43,940 --> 00:17:48,840 Lady Ada was telling me that they want to get kind of in the business of having some more weird designs 315 00:17:49,240 --> 00:17:50,600 where we just say like, here it is. 316 00:17:51,180 --> 00:17:54,380 And we don't make any huge promise about how well it works. 317 00:17:54,500 --> 00:17:55,620 But here's this weird thing. 318 00:17:56,240 --> 00:18:00,940 And the Game Boy Cart is like totally that niche of like it's not for beginners really. 319 00:18:01,080 --> 00:18:02,820 It's for that person that really does want 320 00:18:02,840 --> 00:18:07,600 want to get in the Game Boy weeds and program it from a microcontroller. 321 00:18:08,460 --> 00:18:11,200 And obviously, I'm interested in doing it from CircuitPython. 322 00:18:11,950 --> 00:18:13,100 So, yeah. 323 00:18:13,640 --> 00:18:17,240 And part of that vision is that people will be able to actually program the games in Circuit 324 00:18:17,410 --> 00:18:19,080 Python and then run them on the Game Boy. 325 00:18:19,460 --> 00:18:19,920 That's right. 326 00:18:20,060 --> 00:18:25,680 So you're running your game on the cart, and the cart is telling the Game Boy what to do. 327 00:18:26,580 --> 00:18:31,920 So the Game Boy says, okay, like I finished a frame, and CircuitPython under the hood says, 328 00:18:31,940 --> 00:18:33,260 okay, here's the instructions to run. 329 00:18:33,880 --> 00:18:35,840 And I'm going to have it say, like, okay, check to make sure 330 00:18:36,080 --> 00:18:37,120 if there's a button pressed. 331 00:18:37,860 --> 00:18:39,500 And then I'll give that back to CircuitPython. 332 00:18:39,680 --> 00:18:41,200 So you can say, like, hey, is there a button pressed? 333 00:18:41,760 --> 00:18:43,820 And then you can decide what to do within CircuitPython. 334 00:18:44,220 --> 00:18:46,880 And you could say, like, hey, move this sprite from here to here. 335 00:18:47,020 --> 00:18:50,760 And, like, that will translate to, like, tell the Game Boy to do these instructions 336 00:18:51,060 --> 00:18:52,880 that set the memory for the Sprite. 337 00:18:53,560 --> 00:18:53,640 Right. 338 00:18:54,000 --> 00:18:55,760 So the game is running in CircuitPython. 339 00:18:56,580 --> 00:18:58,720 And CircuitPython is telling the Game Boy what to do. 340 00:18:59,540 --> 00:19:01,180 So there's a little bit of subtlety there of, like, 341 00:19:01,240 --> 00:19:03,640 We're not actually running a lot of logic on the Game Boy. 342 00:19:03,760 --> 00:19:04,880 It's just more like straight line. 343 00:19:05,720 --> 00:19:11,600 Like, okay, load this memory, this value at this address that makes so sound play or something. 344 00:19:12,400 --> 00:19:14,760 So it's this weird hybrid of it. 345 00:19:15,560 --> 00:19:19,440 It'll be fascinating to see what the makers and coders out there can do with that. 346 00:19:20,300 --> 00:19:21,320 I'm very excited to see it. 347 00:19:21,380 --> 00:19:29,720 I think I'm like much more confident in the ability of PIO and the RP2350 to keep up with what people want to do versus the SAMD version. 348 00:19:30,420 --> 00:19:32,040 So, yeah, I'm looking forward to it. 349 00:19:32,160 --> 00:19:36,000 I was thinking about sending John one of my early carts, 350 00:19:36,640 --> 00:19:40,940 but it's looking like hopefully we'll have it in the store and not too long, 351 00:19:41,960 --> 00:19:42,980 again, with caveats. 352 00:19:43,120 --> 00:19:46,800 But, yeah, it seems to be going pretty well. 353 00:19:47,560 --> 00:19:48,080 Well, that's great. 354 00:19:48,740 --> 00:19:50,280 Scott, thanks so much for coming on the show. 355 00:19:50,700 --> 00:19:52,400 Thanks for having me, and thanks for doing the show. 356 00:19:53,700 --> 00:19:55,740 Thank you for listening to The CircuitPython Show. 357 00:19:56,260 --> 00:19:59,400 For show notes and transcripts, visit CircuitPythonShow.com. 358 00:20:00,340 --> 00:20:01,880 and help keep the show ad-free. 359 00:20:02,340 --> 00:20:05,540 Join the supporter tier for exclusive content and early access. 360 00:20:06,220 --> 00:20:08,880 Learn more at CircuitPythonshow.com slash support. 361 00:20:09,520 --> 00:20:11,300 Until next time, stay positive.