1 00:00:00,000 --> 00:00:08,080 So there, yeah, a few things that I had planned to have devices for all of us, the programming devices, it didn't work out. 2 00:00:08,960 --> 00:00:18,940 The source code is not online yet either, so we have a few inadequacies to work around, but we are hackers, so we're excellent at producing workarounds when we need them. 3 00:00:20,060 --> 00:00:27,680 I think success is defined by we have a badge, we want to program it, and we understand the workflow, right? 4 00:00:27,680 --> 00:00:38,380 We kind of understand what we have to do maybe in the office at home if we want to change the behavior of our badge and a number of other similar devices because it's a similar workflow. 5 00:00:41,820 --> 00:00:46,060 Now, there's going to be, I'm going to show a few tools, and we don't have a full day. 6 00:00:46,160 --> 00:00:52,980 We have an hour, an hour and a half, so the tool set I'll show is a very small subset of what's possible. 7 00:00:53,380 --> 00:00:57,500 This is always the case where there's a lot of different tools. 8 00:00:57,680 --> 00:01:05,080 This is just the way I'm doing it, and please feel free to ask if you think there's a better way or a way you prefer. 9 00:01:05,220 --> 00:01:06,460 I might know about that. 10 00:01:06,520 --> 00:01:07,340 I can help you out. 11 00:01:07,940 --> 00:01:14,080 Before we get started, it might help to distribute badges to the people. 12 00:01:14,160 --> 00:01:24,480 If you haven't purchased a badge and you would like to in order to program it now, if there's a small group that wants to do that, I think we can handle that quickly. 13 00:01:25,640 --> 00:01:27,400 Is there anybody who? 14 00:01:27,680 --> 00:01:29,380 Still wants to purchase a badge? 15 00:01:30,440 --> 00:01:32,160 Okay, so there's one or two people. 16 00:01:32,220 --> 00:01:32,740 That's fine. 17 00:01:33,840 --> 00:01:41,300 In the meantime, because this will take a few minutes, you may want to download. 18 00:01:41,320 --> 00:01:50,900 Well, first of all, if you haven't got an Internet connection set up, you'll need to download some things. 19 00:01:50,940 --> 00:01:57,240 You can quietly, passively observe as well if you prefer, or if you don't have your computer with you, 20 00:01:57,240 --> 00:01:59,280 and you just have a phone, it's fine. 21 00:01:59,480 --> 00:02:00,920 You have fun with that as well. 22 00:02:01,060 --> 00:02:09,480 But there will be a hands-on component to this workshop, and it's over an hour long, so we have enough time to do that. 23 00:02:10,340 --> 00:02:15,760 What we will be downloading, this is my preference at least. 24 00:02:16,980 --> 00:02:18,460 It's called Platform.io. 25 00:02:19,100 --> 00:02:20,920 I don't know if I can make this bigger. 26 00:02:20,980 --> 00:02:21,360 I'll try. 27 00:02:23,780 --> 00:02:25,120 Yeah, that seems to work. 28 00:02:25,800 --> 00:02:27,140 Well, the title bar doesn't. 29 00:02:27,240 --> 00:02:27,580 It'll get bigger. 30 00:02:27,700 --> 00:02:34,840 But the URL is simply platform.io.org. 31 00:02:35,200 --> 00:02:40,840 So you want to maybe read through there a bit, and you want to learn how to download and install it. 32 00:02:41,460 --> 00:02:48,720 What it really involves is downloading Atom, but it's all on the page there for installation. 33 00:02:49,140 --> 00:02:56,640 And while you do that, I think we'll just take care of the one badge that we still have. 34 00:02:57,240 --> 00:03:00,260 You need to get set up, and I'll turn the microphone off. 35 00:03:04,660 --> 00:03:12,780 Yeah, there's going to be two things that if each of us want to individually program on our own computers, 36 00:03:13,080 --> 00:03:16,920 we'll need two things, two new things that you may not have yet. 37 00:03:16,980 --> 00:03:24,040 That's this Platform.io, and there's a command line utility. 38 00:03:24,120 --> 00:03:25,780 It's called AVRdude. 39 00:03:26,280 --> 00:03:27,220 So this is... 40 00:03:27,240 --> 00:03:29,220 This is how I installed AVRdude. 41 00:03:30,740 --> 00:03:36,040 I know I'm getting too far ahead, but for anybody who's quite advanced, I don't want to get you bored. 42 00:03:36,340 --> 00:03:36,840 And so... 43 00:03:39,680 --> 00:03:41,260 Well, first of all, let's do a search. 44 00:03:41,460 --> 00:03:49,440 If you're on a DPKG-style distribution, then you use APT or something. 45 00:03:49,760 --> 00:03:53,580 Obviously, the RPM ones are Yum, Zyper, and so on. 46 00:03:55,620 --> 00:03:56,060 AbdCache. 47 00:03:56,140 --> 00:03:56,940 So we can search. 48 00:03:57,240 --> 00:04:00,360 For AVRdude. 49 00:04:02,040 --> 00:04:02,480 Yeah. 50 00:04:02,820 --> 00:04:06,140 So it's kind of running off the end, but I think it's clear enough. 51 00:04:07,520 --> 00:04:08,860 This is the other... 52 00:04:08,860 --> 00:04:10,260 So this is not Platform.io. 53 00:04:10,340 --> 00:04:18,360 This is the second piece of software that I'm talking about, which is part of our suite or our workflow. 54 00:04:19,300 --> 00:04:24,640 So we will need Platform.io, and we will need AVRdude. 55 00:04:24,960 --> 00:04:27,140 And both of these two pieces have alternatives. 56 00:04:27,240 --> 00:04:33,580 But with a limited amount of time, it's going to be kind of a demonstration using the tools that I've been using before. 57 00:04:34,800 --> 00:04:43,840 So having said that, short explanation of what programming means and how a badge starts out. 58 00:04:45,540 --> 00:04:46,660 So imagine... 59 00:04:46,660 --> 00:04:52,480 In fact, you can see that three of these badges, there's four, three of them are lit up. 60 00:04:52,560 --> 00:04:56,400 That's because there's a microcontroller controlling the LEDs. 61 00:04:56,400 --> 00:05:03,280 And doing things with them, turning them off and turning them on in succession to create this animation, right? 62 00:05:03,380 --> 00:05:15,160 That's a program that's running on the MCU, just like a program could run on a MPU, a microprocessor unit. 63 00:05:15,360 --> 00:05:17,180 This is a microcontroller unit. 64 00:05:17,340 --> 00:05:25,620 And one of the big differences is that the storage of a microcontroller unit is directly inside, embedded inside the... 65 00:05:26,400 --> 00:05:29,600 The plastic housing of the chip. 66 00:05:30,260 --> 00:05:38,260 So this is what some people refer to as on-chip debugging or on-chip programming. 67 00:05:38,540 --> 00:05:43,240 It's a very different procedure as what we have with MPUs. 68 00:05:43,260 --> 00:05:43,600 A question? 69 00:05:44,020 --> 00:05:45,020 Yeah, on the platform. 70 00:05:46,460 --> 00:05:47,180 Right. 71 00:05:52,240 --> 00:05:56,080 So Atom is what you'll probably choose. 72 00:05:56,400 --> 00:06:03,140 Atom is a generic web editor, which I think, what is it, Jithub uses? 73 00:06:03,340 --> 00:06:04,240 Is that right? 74 00:06:04,680 --> 00:06:08,300 Jithub kind of develops Atom for general use to... 75 00:06:08,960 --> 00:06:10,300 Yeah, it's an editor. 76 00:06:10,480 --> 00:06:20,120 And the beauty of Atom is that you can load plugins, components on top of that to make it a full-fledged IDE, for example, which platform IDE is. 77 00:06:20,520 --> 00:06:22,040 That's what they're using for it. 78 00:06:22,320 --> 00:06:26,360 Now, I assume that if it gives you a second option... 79 00:06:26,400 --> 00:06:30,320 VS Code or whatever, that you can try that as well. 80 00:06:30,400 --> 00:06:35,120 It sounds like a more Microsoft-style type of thing. 81 00:06:35,180 --> 00:06:41,880 If you want to experiment with that, if you have a Microsoft distribution running on your computer, maybe it's a better choice. 82 00:06:43,020 --> 00:06:46,580 I'll try to help, but I don't have any experience with Microsoft. 83 00:06:47,220 --> 00:06:52,520 In any case, so back to what these microcontrollers are doing with the lights. 84 00:06:52,940 --> 00:06:56,380 So they're controlling the lights in a very simple way. 85 00:06:56,400 --> 00:06:57,800 Turning on, turning off. 86 00:06:58,020 --> 00:06:59,300 That's what a microcontroller does. 87 00:06:59,500 --> 00:07:08,780 When I receive them from the factory, I receive them on a reel like this, and there are 1,000 or 1,500 microcontrollers on there, on these little chips, right? 88 00:07:09,280 --> 00:07:18,420 And then I place them on these boards, solder them so that they are, yeah, soldered onto the board. 89 00:07:18,580 --> 00:07:23,960 And as soon as I flip the switch and turn it on with a battery or an energy source, basically nothing happens. 90 00:07:24,120 --> 00:07:25,920 Because the factory does not know. 91 00:07:25,920 --> 00:07:36,680 So if I'm controlling lights or if I'm detecting a door that opens or if I'm measuring voltage or measuring temperature, they just have no idea what my application is. 92 00:07:36,820 --> 00:07:39,000 So they arrive in an empty state. 93 00:07:39,320 --> 00:07:41,860 That's kind of what would happen if I turned it on. 94 00:07:41,960 --> 00:07:43,480 This one here is not lit up. 95 00:07:43,660 --> 00:07:46,860 It simply wouldn't light up because there's no program inside. 96 00:07:47,220 --> 00:07:55,900 And that's what this workshop is about, to find a way to get our own programs inside the MCU so that when you turn them on, it does what you want. 97 00:07:56,740 --> 00:07:57,180 Question? 98 00:07:58,140 --> 00:07:58,700 Another question. 99 00:07:58,900 --> 00:08:01,240 How do you start designing these batteries? 100 00:08:01,560 --> 00:08:07,560 Is there quite a set of sites that I can go to and just guess what gets on the ID or on the image or whatever? 101 00:08:09,080 --> 00:08:10,360 It's kind of a total question. 102 00:08:10,620 --> 00:08:13,660 Yeah, it's not relevant, but I like the question. 103 00:08:14,320 --> 00:08:20,720 So the question is, how do I, I think it's kind of personal, how do I start to design a new badge? 104 00:08:22,860 --> 00:08:25,900 This, okay, well, I'll give you a very practical answer. 105 00:08:25,920 --> 00:08:34,320 I'm designing badges for a quite well-known cryptocurrency conference in Europe, which will take place in October. 106 00:08:34,500 --> 00:08:40,160 I don't know if they want me to announce this because their badges will control entrance, and it's quite expensive. 107 00:08:40,420 --> 00:08:45,260 So they probably don't want people to know how to knock off the badges. 108 00:08:45,820 --> 00:08:51,340 And so this is a full set of requirements that they're giving me. 109 00:08:51,360 --> 00:08:55,080 They're asking me questions about are they able to change the shape? 110 00:08:55,080 --> 00:08:55,900 Can there be circles? 111 00:08:56,180 --> 00:08:57,280 Can there be route-outs? 112 00:08:57,340 --> 00:08:58,140 Can there be squares? 113 00:08:58,380 --> 00:09:00,120 And these are all questions I have to answer. 114 00:09:00,320 --> 00:09:04,220 I won't get too far into it, but, for example, the route-outs need to have round edges. 115 00:09:04,420 --> 00:09:15,080 Because what they're doing is sinking a drill bit into the PCB and then going around and removing surface area. 116 00:09:15,340 --> 00:09:17,240 So there's always going to be a round area. 117 00:09:17,340 --> 00:09:24,040 These are the kind of things you talk to customers or groups or coworkers, colleagues, project. 118 00:09:25,500 --> 00:09:25,900 People. 119 00:09:26,280 --> 00:09:28,100 And that's kind of how I get started. 120 00:09:28,400 --> 00:09:31,220 And then usually there's a lot of chaos involved. 121 00:09:31,760 --> 00:09:34,780 And then how cheap can I get the LEDs? 122 00:09:35,140 --> 00:09:37,100 Oh, they're only green, but I don't like that. 123 00:09:37,160 --> 00:09:40,640 But then, you know, trade-offs, okay, cheapness, wrong color, whatever. 124 00:09:41,200 --> 00:09:43,900 You know, I don't have any better answer than that. 125 00:09:45,080 --> 00:09:46,400 Yeah, so we'll see. 126 00:09:47,200 --> 00:09:49,520 There's going to be plenty of other badges involved. 127 00:09:52,140 --> 00:09:52,540 So. 128 00:09:55,080 --> 00:09:55,280 Right. 129 00:09:56,540 --> 00:10:02,040 That's what happens when I get these MCUs on a big reel from the factory. 130 00:10:02,100 --> 00:10:02,760 They're empty. 131 00:10:02,880 --> 00:10:06,740 I put them on the board, solder them, and then I need to program them. 132 00:10:06,860 --> 00:10:08,140 That's what everybody needs to do. 133 00:10:08,560 --> 00:10:12,220 And not everybody is producing hardware. 134 00:10:12,460 --> 00:10:17,580 But this is relevant for anybody here if you want to change the behavior of the MCU. 135 00:10:17,780 --> 00:10:19,180 Because they're not locked down or anything. 136 00:10:19,280 --> 00:10:24,100 You can just erase them so that they're factory state again or overwrite them with your own. 137 00:10:25,660 --> 00:10:27,860 This is not called software. 138 00:10:28,160 --> 00:10:35,160 Software would be if you connected a USB cable to this, and there was USB communication to your computer, 139 00:10:35,420 --> 00:10:41,980 and then you opened up a web browser or something, and then had some type of software, host software running. 140 00:10:42,440 --> 00:10:51,180 A lot of people believe they're running software on the badge or the wallet or something else 141 00:10:51,180 --> 00:10:54,720 when it's really only running on the notebook, and that's software. 142 00:10:55,080 --> 00:10:59,400 What's running inside the MCU, this little chip in the corner, that's firmware. 143 00:10:59,740 --> 00:11:02,460 It's important to know that distinction, right? 144 00:11:03,560 --> 00:11:04,120 Okay. 145 00:11:04,200 --> 00:11:07,940 So I don't see too many computers, but that's fine. 146 00:11:08,480 --> 00:11:14,920 We'll get started with a quick demonstration, and then I think whoever is following along and trying to do hands-on, 147 00:11:15,040 --> 00:11:20,120 we'll slow it down then, and I'll pay some individual attention to try to get things working. 148 00:11:20,400 --> 00:11:21,380 Does that sound okay? 149 00:11:22,100 --> 00:11:24,480 There is kind of one. 150 00:11:25,080 --> 00:11:25,420 Or two. 151 00:11:25,520 --> 00:11:28,060 I think there's two computers in the room. 152 00:11:28,520 --> 00:11:28,980 All right. 153 00:11:28,980 --> 00:11:29,400 That's fine. 154 00:11:31,820 --> 00:11:32,340 Okay. 155 00:11:32,440 --> 00:11:34,820 So the first thing is a demonstration. 156 00:11:35,740 --> 00:11:43,440 I'm going to show how to change the behavior of, let's say, I don't know, I'll take this corner one down here. 157 00:11:44,720 --> 00:11:46,660 So I will change that. 158 00:11:46,780 --> 00:11:53,620 What we have so far, okay, so let me just, let me create a new file. 159 00:11:55,080 --> 00:12:01,640 I have already downloaded node platform IO and installed it. 160 00:12:05,700 --> 00:12:10,940 So when I, can we see this? 161 00:12:11,080 --> 00:12:11,420 Right. 162 00:12:12,020 --> 00:12:18,240 So when I type Atom, you can't see that on that screen. 163 00:12:18,440 --> 00:12:18,760 Okay. 164 00:12:19,560 --> 00:12:19,980 Okay. 165 00:12:23,260 --> 00:12:23,640 If. 166 00:12:27,160 --> 00:12:36,880 Okay, so if I did this, then I would be presented with Atom's screen. 167 00:12:40,360 --> 00:12:43,880 And this is kind of the first thing I always see, an error message. 168 00:12:47,860 --> 00:12:50,820 That's how it looks when you've installed platform IO. 169 00:12:52,640 --> 00:12:54,160 Now, I'm a bit concerned. 170 00:12:54,220 --> 00:12:55,060 I think I have two. 171 00:12:55,080 --> 00:12:57,200 I have two copies of Atom running. 172 00:12:57,920 --> 00:13:06,720 I'll try to get rid of one of them so I'm not using memory unnecessary. 173 00:13:08,740 --> 00:13:10,020 Yeah, there's two there. 174 00:13:10,860 --> 00:13:11,620 All right. 175 00:13:11,680 --> 00:13:12,860 So now we have one only. 176 00:13:16,560 --> 00:13:18,960 I think you have Atom as well. 177 00:13:19,880 --> 00:13:24,160 Have you found a way to install platform IO on your Atom? 178 00:13:27,500 --> 00:13:29,980 No, I don't have Atom IO down, so I'm going to start asking the question. 179 00:13:29,980 --> 00:13:30,320 Okay. 180 00:13:30,760 --> 00:13:32,600 But it's working all, yeah. 181 00:13:34,380 --> 00:13:35,680 No questions about it? 182 00:13:35,780 --> 00:13:36,020 Yeah? 183 00:13:37,060 --> 00:13:38,760 So far, I have no idea, so I don't know. 184 00:13:38,760 --> 00:13:39,840 So I'm going to start asking the question. 185 00:13:40,300 --> 00:13:40,700 Okay. 186 00:13:40,740 --> 00:13:43,280 It's a package that you need to search for, I believe. 187 00:13:45,000 --> 00:13:46,840 I believe it's, let's see. 188 00:13:47,840 --> 00:13:50,280 There is something up here, packages. 189 00:13:51,200 --> 00:13:54,560 This is Atom and how to. 190 00:14:01,020 --> 00:14:03,620 Yeah, I'm not sure how. 191 00:14:09,820 --> 00:14:10,620 Hmm. 192 00:14:12,940 --> 00:14:19,220 I myself have forgotten how this works to install more packages. 193 00:14:25,340 --> 00:14:26,300 Maybe help. 194 00:14:28,860 --> 00:14:29,500 Atom. 195 00:14:30,240 --> 00:14:31,300 Welcome guide. 196 00:14:31,520 --> 00:14:32,700 I think that's it, yeah. 197 00:14:33,480 --> 00:14:38,640 Yeah, so once you do see the first screen, you can install a package here. 198 00:14:38,920 --> 00:14:40,040 Open installer. 199 00:14:42,240 --> 00:14:43,520 Search packages. 200 00:14:45,140 --> 00:14:46,420 Platform IO. 201 00:14:50,420 --> 00:14:51,060 And. 202 00:15:00,520 --> 00:15:01,800 Introduce oil. 203 00:15:06,900 --> 00:15:13,700 A package from iOS.burn 204 00:15:13,700 --> 00:15:13,720 ?� They're. 205 00:15:15,360 --> 00:15:16,000 The 206 00:15:16,000 --> 00:15:17,300 first step is 207 00:15:17,300 --> 00:15:20,080 this platform I. Oh ID. E. 208 00:15:20,100 --> 00:15:20,780 And all this 209 00:15:20,780 --> 00:15:21,420 does is 210 00:15:21,420 --> 00:15:24,380 allow us to edit in your program. And. 211 00:15:24,420 --> 00:15:25,060 Compile. 212 00:15:25,080 --> 00:15:36,940 it to the correct architecture, which is not Intel or AMD or ARM. In this case, we're doing 213 00:15:36,940 --> 00:15:41,540 Atmel AVR 8-bit. So that's the first thing that we're trying to do. That's what we're 214 00:15:41,540 --> 00:15:50,780 using Platform.io for. And so once you have the Atom editor installed, what I just did 215 00:15:50,780 --> 00:15:55,860 helps you find the Platform.io packages, and that's how you can install it. Mine just says 216 00:15:55,860 --> 00:16:02,160 uninstall because I already have it. I think there are two here to install, but that's 217 00:16:02,160 --> 00:16:07,880 all in the information of that Platform.io website where it explains how to install it. 218 00:16:08,020 --> 00:16:10,720 Did you get so far? Have you had any problems? 219 00:16:11,200 --> 00:16:16,840 No. Well, yeah, tomorrow I'll be done installing it with the . 220 00:16:17,720 --> 00:16:18,860 Tomorrow, yeah. 221 00:16:19,180 --> 00:16:19,740 . 222 00:16:19,740 --> 00:16:20,760 Tomorrow, yeah. 223 00:16:22,520 --> 00:16:23,080 . 224 00:16:24,700 --> 00:16:27,240 It's the other way around. Atom is the basis. 225 00:16:27,780 --> 00:16:28,340 . 226 00:16:28,340 --> 00:16:29,200 Exactly. 227 00:16:30,700 --> 00:16:31,260 . 228 00:16:37,160 --> 00:16:38,220 What's the question? 229 00:16:40,120 --> 00:16:40,680 . 230 00:16:42,320 --> 00:16:44,220 What? I don't think so. 231 00:16:44,480 --> 00:16:45,040 . 232 00:16:46,180 --> 00:16:50,740 No, no, no. You don't have to register anything. I know that Platform.io is 233 00:16:50,760 --> 00:17:20,740 very, very good for the web hosting sites, but platform.io, they optionally, I think there is some method to register but I've never done it. So I don't think it's needed. Did you try the searching for packages inside the Atom editor the way that I did this? That may be the distinction. There may be many ways to use platform.io, and I know that it's a very small group. I know the guy doing that is getting confused. He's a good one. So we're going to have to track him first. 234 00:17:22,660 --> 00:17:24,540 No, he's in Europe. 235 00:17:26,300 --> 00:17:30,480 He was invited to the village, but he couldn't make it. 236 00:18:01,380 --> 00:18:04,180 All right. 237 00:18:38,580 --> 00:18:41,380 Thank you. 238 00:18:57,500 --> 00:18:59,260 Okay, we're back there. 239 00:19:00,400 --> 00:19:10,980 I'm just trying to find this link. 240 00:19:16,340 --> 00:19:17,900 This is interesting. 241 00:19:31,560 --> 00:19:32,400 There we go. 242 00:19:37,800 --> 00:19:38,360 Okay. 243 00:19:55,100 --> 00:19:56,880 New base. 244 00:19:59,460 --> 00:20:02,260 All right. 245 00:20:34,760 --> 00:20:36,160 Okay. 246 00:20:38,920 --> 00:20:40,320 Okay. 247 00:21:15,160 --> 00:21:16,680 Oh, here. 248 00:21:16,800 --> 00:21:18,200 That's my screen there. 249 00:21:18,900 --> 00:21:19,520 Okay. 250 00:21:21,480 --> 00:21:22,660 Hello, world. 251 00:21:23,820 --> 00:21:24,520 All right. 252 00:21:30,900 --> 00:21:31,420 Okay. 253 00:21:33,080 --> 00:21:36,000 So I already have my platform I.O. set up. 254 00:21:36,060 --> 00:21:37,640 I'm just going to do this as a demonstration 255 00:21:37,640 --> 00:21:39,380 while they're still getting set up 256 00:21:39,380 --> 00:21:43,000 so that everyone knows a bit about how this is supposed to work. 257 00:21:45,880 --> 00:21:49,320 I searched from the help menu. 258 00:21:49,380 --> 00:21:50,260 The help menu has about... 259 00:21:50,260 --> 00:21:51,980 No, has a welcome guide. 260 00:21:53,620 --> 00:21:56,160 And in the welcome guide, there is on the right, 261 00:21:56,180 --> 00:21:58,480 at least for me, there is install a package. 262 00:21:59,200 --> 00:22:01,400 And under, I think... 263 00:22:02,460 --> 00:22:05,500 Yeah, under that, there's open installer. 264 00:22:07,920 --> 00:22:09,640 And where can you... 265 00:22:10,300 --> 00:22:13,360 Yeah, and at the top of that, you can search for platforms. 266 00:22:13,580 --> 00:22:18,720 Just be careful to type return after your text 267 00:22:18,720 --> 00:22:20,240 because otherwise it doesn't... 268 00:22:20,260 --> 00:22:28,300 doesn't search automatically right so I'll remove the settings and the welcome 269 00:22:29,580 --> 00:22:32,400 I don't need the welcome guide 270 00:22:40,740 --> 00:22:47,860 okay so platform I owe what I'm now interested in is making sure I can 271 00:22:47,860 --> 00:22:57,480 compile for the Atmel AVR 8-bit ISA the instruction set which is for which is 272 00:22:57,480 --> 00:23:02,380 what we're using with these MC use because these MC use are not arm based 273 00:23:02,380 --> 00:23:07,820 they're not made by Texas Instruments they're not Intel etc they are from Atmel 274 00:23:07,820 --> 00:23:17,080 and they use AVR 8-bit instruction sets so I'm going to look for platforms I 275 00:23:17,080 --> 00:23:17,840 think is the correct answer 276 00:23:17,840 --> 00:23:26,340 area here and for whatever reason the first one that comes up is at Mel AVR 277 00:23:26,340 --> 00:23:31,560 because it starts with A I believe is maybe alphabetical and just to show you 278 00:23:31,560 --> 00:23:37,060 if you're curious what else is available there are expressive there's I think 279 00:23:37,060 --> 00:23:42,620 these are all the ones I have installed so there's not many but sorry it's okay 280 00:23:44,640 --> 00:23:45,160 yeah 281 00:23:47,840 --> 00:23:49,200 I think there's two that you need. 282 00:23:49,340 --> 00:23:54,340 It's platform.io-ide and platform.io. 283 00:23:54,580 --> 00:23:56,620 Let me just show you the ones that I have. 284 00:24:14,180 --> 00:24:25,240 So I have platform.io-ide and it's possible that by simply installing platform.io-ide, 285 00:24:25,240 --> 00:24:26,340 it will... 286 00:24:26,620 --> 00:24:28,600 It will install the dependencies as well. 287 00:24:28,900 --> 00:24:33,660 If that doesn't happen and you suspect that something is not behaving correctly, 288 00:24:34,020 --> 00:24:40,380 then you will see that I also have platform.io-ide-terminal. 289 00:24:41,760 --> 00:24:42,360 Yeah. 290 00:24:42,520 --> 00:24:44,440 I'm not sure if it's needed or not. 291 00:24:45,900 --> 00:24:49,680 You can test and try on your own. 292 00:24:49,780 --> 00:24:51,000 I just have those two. 293 00:24:52,180 --> 00:24:52,780 Right. 294 00:24:52,860 --> 00:24:55,460 So what I was doing just a minute ago, 295 00:24:56,840 --> 00:24:59,940 is, okay, I'll give you a short one-minute tour. 296 00:25:00,080 --> 00:25:01,460 If I click on boards here, 297 00:25:01,600 --> 00:25:03,980 it's probably going to show things like Arduino, 298 00:25:05,500 --> 00:25:06,380 like BoosterPack, 299 00:25:06,620 --> 00:25:08,080 like, well, let's see. 300 00:25:08,140 --> 00:25:08,900 It's got Bitsy. 301 00:25:08,920 --> 00:25:09,900 There's quite a lot here. 302 00:25:12,860 --> 00:25:15,520 Adafruit, Bluetooth, whatever, Bluefruit, Micro. 303 00:25:15,880 --> 00:25:18,140 There's 96 boards. 304 00:25:20,080 --> 00:25:22,180 And there's just quite a lot of things. 305 00:25:22,340 --> 00:25:22,900 Let me... 306 00:25:23,620 --> 00:25:24,660 15 to a page. 307 00:25:24,780 --> 00:25:25,320 We can do a... 308 00:25:25,460 --> 00:25:26,220 1,000, though. 309 00:25:26,280 --> 00:25:27,720 Let's do 100 to a page. 310 00:25:30,280 --> 00:25:31,460 And alphabetical again. 311 00:25:31,540 --> 00:25:32,900 So there's lots of Adafruit. 312 00:25:33,240 --> 00:25:35,120 Arduino must be the next one, exactly. 313 00:25:35,240 --> 00:25:37,700 So there's Arduino Due, blah, blah, blah. 314 00:25:37,900 --> 00:25:39,300 There's lots of boards. 315 00:25:39,440 --> 00:25:45,040 You get the idea of what a board is defined as in the platform.io world. 316 00:25:45,420 --> 00:25:48,880 And at the bottom, there's a BBC Micro bit, for example. 317 00:25:49,080 --> 00:25:51,280 I think some of you know what that is. 318 00:25:51,380 --> 00:25:55,040 As far as libraries go, if I click on that in platform.io, 319 00:25:55,460 --> 00:26:03,900 it's going to give me options to load libraries to control serial buses like I2C 320 00:26:03,900 --> 00:26:12,040 or maybe temperature modules which work on digital basis or analog. 321 00:26:13,780 --> 00:26:15,640 These are all the libraries. 322 00:26:15,760 --> 00:26:20,600 So we have sensor libraries, control libraries, et cetera. 323 00:26:20,920 --> 00:26:25,280 Let me just see the ones I have installed to give you an idea. 324 00:26:28,820 --> 00:26:30,080 What, I have none? 325 00:26:30,860 --> 00:26:31,740 That's impossible. 326 00:26:32,080 --> 00:26:33,100 What's built in? 327 00:26:38,480 --> 00:26:41,860 So, Esplora, Ethernet, GSM. 328 00:26:41,920 --> 00:26:43,180 These are the type of libraries. 329 00:26:43,400 --> 00:26:48,760 So we've taken a look at boards, libraries, devices at the very bottom. 330 00:26:50,960 --> 00:26:54,480 Oh, devices is simply what platform.io has detected. 331 00:26:54,480 --> 00:26:55,300 It's connected. 332 00:26:55,300 --> 00:26:56,340 It's connected to your computer. 333 00:26:56,760 --> 00:27:02,160 So if you have a USB connection, serial, or I don't know what the other options are, 334 00:27:02,200 --> 00:27:07,000 I guess over Ethernet, those are the devices that it tells you you have connected. 335 00:27:08,480 --> 00:27:12,420 Possibly if I connect my programmer, it will detect that. 336 00:27:12,540 --> 00:27:14,160 Let's just see if that's the case. 337 00:27:16,760 --> 00:27:17,240 Refresh. 338 00:27:17,720 --> 00:27:21,940 I kind of doubt it will work, but it is connected over USB, so maybe. 339 00:27:22,540 --> 00:27:23,600 It didn't work. 340 00:27:23,780 --> 00:27:24,240 Okay. 341 00:27:24,300 --> 00:27:24,900 Well, all right. 342 00:27:24,900 --> 00:27:26,320 I'm not going to spend time with that anyway. 343 00:27:26,520 --> 00:27:32,180 The very last of all of these areas, which make any sense, I mean, we've seen the home already. 344 00:27:32,940 --> 00:27:35,120 And the account, I don't have an account. 345 00:27:35,340 --> 00:27:36,780 It's not needed. 346 00:27:37,740 --> 00:27:41,640 The very last that I've shown is now the platforms. 347 00:27:42,600 --> 00:27:47,700 And as I mentioned, there's a few here, Tiny, Teensy, Espressif. 348 00:27:47,720 --> 00:27:49,060 These are the ones that I have installed. 349 00:27:49,860 --> 00:27:51,400 There are quite a lot of others. 350 00:27:52,120 --> 00:27:54,880 And Admiral AVR is the one that we need to use. 351 00:27:54,880 --> 00:27:58,840 We need to use to program these badges, because that's the architecture and instruction set. 352 00:28:02,080 --> 00:28:04,920 So I hope that's clear enough. 353 00:28:05,180 --> 00:28:10,440 So this is kind of very complex IDE that gives you a lot of features and functionality. 354 00:28:11,080 --> 00:28:16,340 It's definitely more than the Arduino IDE, although you could use it as well. 355 00:28:16,880 --> 00:28:21,120 We don't have enough time to do every IDE in the world and Visual Studio and whatever 356 00:28:21,120 --> 00:28:21,520 else. 357 00:28:21,560 --> 00:28:23,860 You can probably find a plug-in for that as well. 358 00:28:24,340 --> 00:28:24,860 Okay. 359 00:28:24,880 --> 00:28:26,560 But we're going to stick to PlatformIO. 360 00:28:28,200 --> 00:28:29,140 I like it. 361 00:28:29,580 --> 00:28:38,180 And so here, there will usually be maybe some, let's see what it gives us. 362 00:28:38,240 --> 00:28:47,980 Sometimes we get examples and things, AVR 8 and 32-bit MCUs here, examples, for example. 363 00:28:48,300 --> 00:28:54,860 And under boards, it tells you what boards are using the AVR 8-bit and 32-bit. 364 00:28:55,320 --> 00:28:58,500 Instruction set, what I like to do is go right to examples. 365 00:28:58,840 --> 00:28:59,680 You see that here? 366 00:29:00,800 --> 00:29:05,460 It's kind of hard to see at an angle for all of you, but if you take a look at examples, 367 00:29:05,560 --> 00:29:09,240 you have a few different ones, like Arduino Blink is this one. 368 00:29:09,440 --> 00:29:12,960 You can choose that, but you can choose a lot of others as well. 369 00:29:13,320 --> 00:29:15,180 Arduino Blink is good enough for us. 370 00:29:16,900 --> 00:29:20,140 And you can kind of see the style of the things you need to do. 371 00:29:23,540 --> 00:29:24,840 This is not so interesting. 372 00:29:24,860 --> 00:29:28,640 The INI file, let's see all the files we have. 373 00:29:28,760 --> 00:29:29,960 This one is maybe good. 374 00:29:32,400 --> 00:29:35,040 So this is kind of, oh, this is all there is. 375 00:29:35,540 --> 00:29:39,100 So that makes it a great first case example. 376 00:29:39,160 --> 00:29:41,200 That's all you need to program and type. 377 00:29:42,240 --> 00:29:52,120 And just like all Atmel or at least Arduino framework programs, you have a setup block 378 00:29:52,120 --> 00:29:54,380 and then a loop block. 379 00:29:54,380 --> 00:29:59,200 The setup just does things one time, and the loop will obviously loop. 380 00:29:59,320 --> 00:30:03,020 This is kind of the way microcontrollers are made to work. 381 00:30:03,680 --> 00:30:09,180 And if you look at the source code there, it's kind of small, but I think you can see 382 00:30:09,180 --> 00:30:09,680 it well enough. 383 00:30:09,720 --> 00:30:10,580 It's very simple. 384 00:30:10,660 --> 00:30:15,920 It does a delay so that your blinks are separated by a delay of some amount. 385 00:30:16,040 --> 00:30:22,320 And the digital write is simply setting a voltage on a GPIO pin, which in this case 386 00:30:22,320 --> 00:30:24,360 is the LED bill. 387 00:30:24,380 --> 00:30:29,300 It's a built-in pin somewhere in a header file that's defined, I think, as pin number 388 00:30:29,300 --> 00:30:30,320 13 or something. 389 00:30:30,800 --> 00:30:32,400 And you set it as high. 390 00:30:32,820 --> 00:30:33,820 And okay. 391 00:30:33,960 --> 00:30:35,900 So that's really very clear and easy. 392 00:30:36,060 --> 00:30:42,280 And that's similar to what we're doing here on a very basic level. 393 00:30:42,800 --> 00:30:44,540 There is a couple problems. 394 00:30:44,800 --> 00:30:51,580 If you, this is not so intuitive, but if you take a close look at the badge, you count 395 00:30:51,580 --> 00:30:53,620 the number of contacts on the MCU. 396 00:30:53,620 --> 00:30:54,480 There are eight. 397 00:30:55,310 --> 00:31:03,340 Now two of those are immediately used for the ground plane and the voltage pin. 398 00:31:03,640 --> 00:31:05,400 So you have six left. 399 00:31:05,720 --> 00:31:11,180 Because there is a button connected to that, a tactile switch, that will take up one more 400 00:31:11,180 --> 00:31:18,440 and you have five possible inputs and outputs, GPIO, general purpose, input, in or out. 401 00:31:18,620 --> 00:31:23,600 So with five contacts, you're trying to drive 16 outputs. 402 00:31:23,600 --> 00:31:23,720 Seven LEDs. 403 00:31:24,640 --> 00:31:31,160 And if you look at the structure of a program, you'll a voltage to one pin and it turns 404 00:31:31,160 --> 00:31:35,240 it on to the high parameter or it turns it off through the low. 405 00:31:35,480 --> 00:31:41,280 So you could do that to five different LEDs, and all the other 11 LEDs, you wouldn't be 406 00:31:41,280 --> 00:31:42,080 able to touch them. 407 00:31:42,160 --> 00:31:47,160 There would be no direct connector, connection to the five contacts on the MCU. 408 00:31:49,320 --> 00:31:53,120 So it's been a long time since this problem has been solved. 409 00:31:53,180 --> 00:31:53,580 Anduum, there, that's great. 410 00:31:53,580 --> 00:32:02,460 Basically, it's a multiplexing problem where you want to have more than one input or output for one contact on the MCU, 411 00:32:02,660 --> 00:32:04,040 and it's called Charlie-plexing. 412 00:32:04,080 --> 00:32:05,380 I can't remember why. 413 00:32:05,520 --> 00:32:09,080 Maybe the person who solved the problem for the first time is named Charlie. 414 00:32:09,160 --> 00:32:09,560 I don't know. 415 00:32:09,640 --> 00:32:10,620 Does anybody know? 416 00:32:11,620 --> 00:32:13,220 Anyway, so that's what we're doing here. 417 00:32:13,260 --> 00:32:20,180 We're doing Charlie-plexing, so we're connecting a multiple of LEDs with a resistor in between, 418 00:32:20,180 --> 00:32:28,720 and it's a bit complicated and not worth mentioning in detail, but this is what we're doing. 419 00:32:28,800 --> 00:32:37,080 We're just doing it in a more complex manner so that we can control more LEDs with the small amount of contacts we have from the MCU. 420 00:32:37,560 --> 00:32:40,140 So what should we do? 421 00:32:40,220 --> 00:32:50,160 We could compile this, and if we're really lucky, this LED, which is defined as LED, 422 00:32:50,180 --> 00:32:55,580 built in, would map to one of the LEDs, which I have chosen. 423 00:32:57,000 --> 00:32:59,720 I'm actually quite curious because I haven't tried this. 424 00:33:00,120 --> 00:33:01,660 I mean, it's a 50-50. 425 00:33:01,920 --> 00:33:04,520 It's a less than 50-50 chance, but let's try it. 426 00:33:04,900 --> 00:33:09,640 So to compile this, how do we do that? 427 00:33:11,260 --> 00:33:13,080 Somewhere there must be. 428 00:33:14,400 --> 00:33:19,800 I've kind of forgotten from the examples how to. 429 00:33:20,180 --> 00:33:20,880 To compile. 430 00:33:23,260 --> 00:33:24,320 How do we do that? 431 00:33:26,480 --> 00:33:28,580 So I'm just going to cut and paste, I think. 432 00:33:31,680 --> 00:33:32,120 Whoops. 433 00:33:34,440 --> 00:33:35,800 That's too much text. 434 00:33:42,200 --> 00:33:47,240 Let's just imagine that for the first time we're getting exposed to a new platform. 435 00:33:47,340 --> 00:33:48,600 We don't know how it works. 436 00:33:50,180 --> 00:33:52,480 So I'm just going to create a new project. 437 00:34:02,020 --> 00:34:03,880 I've totally forgotten how. 438 00:34:06,020 --> 00:34:07,640 Okay, let's go back home. 439 00:34:08,040 --> 00:34:13,000 New project here from the home screen project name. 440 00:34:13,280 --> 00:34:13,480 Okay. 441 00:34:19,440 --> 00:34:33,280 Defcon test board, and we will do, what is the correct board name here? 442 00:34:34,320 --> 00:34:37,280 I'm going to cheat here because there is. 443 00:34:40,960 --> 00:34:43,140 The board is called AT Tiny. 444 00:34:46,660 --> 00:34:50,980 We're still in demonstration mode, so this may go a bit too fast. 445 00:34:52,280 --> 00:34:57,520 AT Tiny, and it's 13A. 446 00:34:57,700 --> 00:34:58,600 There it is. 447 00:34:59,580 --> 00:35:01,760 And framework that we want is Arduino. 448 00:35:02,820 --> 00:35:04,920 Location, use the default location. 449 00:35:05,240 --> 00:35:05,880 Finish. 450 00:35:05,920 --> 00:35:09,440 So this is now creating a new project called Defcon test. 451 00:35:11,440 --> 00:35:19,200 And I have on the left here now, Defcon test, and libraries, everything is set up the 452 00:35:19,200 --> 00:35:20,020 way I need to. 453 00:35:20,200 --> 00:35:22,600 So it did a bunch of work for me. 454 00:35:22,720 --> 00:35:27,180 I even have a main.cpp area with a loop and a setup. 455 00:35:27,500 --> 00:35:33,100 So I'm just going to erase this because I have copied the example from before. 456 00:35:33,340 --> 00:35:34,080 See that? 457 00:35:34,200 --> 00:35:35,860 So this is what I copied before. 458 00:35:36,320 --> 00:35:39,260 And it's the blink example for the Arduino. 459 00:35:39,260 --> 00:35:44,980 Arduino, because it is a VR 8-bit, it can possibly work. 460 00:35:45,120 --> 00:35:46,740 I'm just concerned about this here. 461 00:35:47,480 --> 00:35:49,240 This might not work. 462 00:35:50,160 --> 00:35:56,160 But because I'm an adventurous person, I'm just going to try and compile it. 463 00:35:58,740 --> 00:36:00,940 Up here, there is a build. 464 00:36:03,120 --> 00:36:04,300 Save and build. 465 00:36:07,780 --> 00:36:08,460 Failed. 466 00:36:08,560 --> 00:36:09,240 I'm sorry. 467 00:36:09,260 --> 00:36:11,960 So this file is going to move to util delay h. 468 00:36:13,380 --> 00:36:15,940 It's going to move to util delay h. 469 00:36:16,980 --> 00:36:17,460 No. 470 00:36:17,580 --> 00:36:18,140 All right. 471 00:36:18,200 --> 00:36:24,300 So that was a good try, but I'm going to quit while we're still on time. 472 00:36:26,480 --> 00:36:33,400 Instead of doing that, I'm going to take source code from what I know is good. 473 00:36:35,580 --> 00:36:36,900 Let's get rid of this here. 474 00:36:37,280 --> 00:36:37,760 Okay. 475 00:36:41,020 --> 00:36:42,860 How do I get rid of this? 476 00:36:43,240 --> 00:36:47,140 There's an i.o. build on the left, very left bottom. 477 00:36:48,140 --> 00:36:49,980 Maybe that's just your build profile. 478 00:36:50,500 --> 00:36:51,560 You mean that there? 479 00:36:51,900 --> 00:36:52,200 Yeah. 480 00:36:54,080 --> 00:36:55,020 Build target. 481 00:36:56,200 --> 00:36:56,960 All right. 482 00:36:58,300 --> 00:36:59,200 Target, target. 483 00:37:02,700 --> 00:37:04,340 What do you mean build target? 484 00:37:04,980 --> 00:37:05,980 Good question. 485 00:37:06,100 --> 00:37:07,240 What do you want me to do there? 486 00:37:07,300 --> 00:37:07,740 I'm going to go to the next slide. 487 00:37:07,740 --> 00:37:15,480 Now, yeah, I think trying to use an example from a different board is, this was kind 488 00:37:15,480 --> 00:37:18,500 of an exotic test that I wanted to try. 489 00:37:18,720 --> 00:37:22,480 So I'm going to erase the text that I just copied there. 490 00:37:23,560 --> 00:37:28,680 And we're still in demonstration mode, so I'm going to copy this file, which I know 491 00:37:28,680 --> 00:37:29,080 is good. 492 00:37:29,180 --> 00:37:34,040 It's not the one that's running on the badges exactly, because that's not uploaded yet, 493 00:37:34,200 --> 00:37:37,260 but I'm quite sure that it will work. 494 00:37:39,680 --> 00:37:42,080 And we'll need one more file. 495 00:37:44,820 --> 00:37:47,520 This looks okay, right? 496 00:37:47,680 --> 00:37:49,960 And we need one more file. 497 00:37:50,080 --> 00:37:50,900 This one. 498 00:37:54,280 --> 00:38:05,800 Yeah, this is C. So I will create a new file in this project and put that inside 499 00:38:05,800 --> 00:38:06,320 there. 500 00:38:06,320 --> 00:38:07,720 And it's untitled. 501 00:38:07,760 --> 00:38:16,760 We'll call it, we'll call it main.h. 502 00:38:19,740 --> 00:38:21,820 I hope that's the right place. 503 00:38:22,660 --> 00:38:24,800 Oh, yeah, yeah, yeah, yeah, no. 504 00:38:27,520 --> 00:38:28,940 Should put it in temp. 505 00:38:34,600 --> 00:38:35,880 All right. 506 00:38:35,880 --> 00:38:40,680 It's not in the right place, so let me just put it there now. 507 00:39:02,220 --> 00:39:09,240 Projects, flat IO, yeah, that's it. 508 00:39:12,800 --> 00:39:33,880 And over here, flat, so, and then we'll move it to where it should be, namely, DEF CON, where did it go? 509 00:39:41,080 --> 00:39:46,240 So, now I need to find the place where this new project is stored. 510 00:39:53,880 --> 00:39:56,800 Platform, documents, platform, IO, projects. 511 00:39:57,660 --> 00:39:59,720 All right, sorry about this. 512 00:40:05,120 --> 00:40:05,720 Documents. 513 00:40:08,360 --> 00:40:08,960 Documents. 514 00:40:11,060 --> 00:40:21,240 Main, platform, IO, and projects, DEF CON test, projects. 515 00:40:22,320 --> 00:40:26,340 So, that must be correct now, but it's still not. 516 00:40:26,840 --> 00:40:27,560 No. 517 00:40:30,200 --> 00:40:32,040 Okay, so that looks okay. 518 00:40:32,140 --> 00:40:35,860 Our main.h is in the correct place. 519 00:40:36,640 --> 00:40:39,080 Main.cpp is... 520 00:40:41,860 --> 00:40:43,540 Looks okay as well. 521 00:40:43,760 --> 00:40:47,240 Oh, I haven't saved it. 522 00:40:49,200 --> 00:40:51,420 So, I'll just save all the files now. 523 00:40:53,700 --> 00:40:54,700 Save all. 524 00:40:56,300 --> 00:40:58,300 And I have the home here. 525 00:40:58,420 --> 00:40:59,840 I have the cpp here. 526 00:41:02,320 --> 00:41:05,540 And there is a main.h as well. 527 00:41:06,160 --> 00:41:07,600 Let's cross our fingers. 528 00:41:07,680 --> 00:41:09,420 I saw a lot of red there. 529 00:41:09,420 --> 00:41:10,940 I'm not sure why. 530 00:41:11,100 --> 00:41:11,980 Oh, no configuration. 531 00:41:12,600 --> 00:41:13,620 Ah, okay. 532 00:41:14,320 --> 00:41:15,140 That's why. 533 00:41:19,640 --> 00:41:23,220 So, platform, IO, ATtiny. 534 00:41:24,400 --> 00:41:26,860 And it's saying no configuration. 535 00:41:27,440 --> 00:41:28,500 Now it works. 536 00:41:28,580 --> 00:41:28,780 Okay. 537 00:41:29,380 --> 00:41:30,400 Okay, success. 538 00:41:30,740 --> 00:41:32,840 So, what I just did was... 539 00:41:34,680 --> 00:41:38,720 I cut and pasted a bunch of source code, 540 00:41:38,720 --> 00:41:41,380 which I know works for this architecture, 541 00:41:41,780 --> 00:41:45,880 and the pin assignments are similar to what I used 542 00:41:45,880 --> 00:41:48,760 for the LEDs soldered onto the board. 543 00:41:49,300 --> 00:41:52,380 So, this is not exactly what's running on these boards 544 00:41:52,380 --> 00:41:57,580 because that source code I'm too disorganized right now, 545 00:41:57,600 --> 00:41:59,340 and I haven't uploaded it yet. 546 00:41:59,760 --> 00:42:04,420 But this does work, and I have copied it into this file, 547 00:42:04,920 --> 00:42:07,220 and there's a main.h file as well, a header, 548 00:42:08,000 --> 00:42:08,600 which is... 549 00:42:08,600 --> 00:42:09,580 It's not very long. 550 00:42:10,440 --> 00:42:12,280 And so, I just built it. 551 00:42:12,340 --> 00:42:14,060 I can build again to show you. 552 00:42:14,100 --> 00:42:15,320 It goes pretty fast. 553 00:42:15,540 --> 00:42:18,100 So, build, and then down here, 554 00:42:18,240 --> 00:42:20,720 it basically says what it's doing, and it succeeded. 555 00:42:21,280 --> 00:42:26,500 What it did, really, is used a gcc.avr version 556 00:42:27,100 --> 00:42:29,760 of the compiling environment. 557 00:42:30,060 --> 00:42:33,080 This is not Intel, but it did a lot of tricks 558 00:42:33,080 --> 00:42:37,140 because it understands what architecture it's building for. 559 00:42:38,260 --> 00:42:42,080 And I should be able to find the binary now. 560 00:42:45,300 --> 00:42:48,780 If I just go back one, and let me put this at the top. 561 00:42:50,920 --> 00:42:52,520 I think it's called... 562 00:42:52,520 --> 00:42:57,480 Yeah, it's in here, and ATtiny13, and there it is. 563 00:42:57,520 --> 00:43:00,560 There's the firmware. 564 00:43:01,120 --> 00:43:02,460 Let's show both of them. 565 00:43:02,980 --> 00:43:07,020 The hex is the one that we're going to copy over this one. 566 00:43:07,060 --> 00:43:07,120 Here it is. 567 00:43:07,120 --> 00:43:08,700 So, now... 568 00:43:12,740 --> 00:43:13,320 Let's see. 569 00:43:13,660 --> 00:43:15,300 AVR dude command. 570 00:43:17,720 --> 00:43:21,340 I've kind of forgotten how it is, but I can find it quickly. 571 00:43:25,240 --> 00:43:26,520 All right, here it is. 572 00:43:32,120 --> 00:43:34,380 So, the next thing we need to do here 573 00:43:35,720 --> 00:43:36,160 is... 574 00:43:36,160 --> 00:43:39,360 What does AVR dude do again? 575 00:43:41,080 --> 00:43:43,700 AVR dude takes a binary. 576 00:43:44,700 --> 00:43:46,140 It does other things as well, 577 00:43:46,200 --> 00:43:48,480 but it takes a binary like the one we just produced, 578 00:43:48,600 --> 00:43:53,860 and it programs a chip like this one 579 00:43:53,860 --> 00:43:55,360 over a USB connection. 580 00:43:56,560 --> 00:43:59,680 So, we don't have USB logic in this hardware. 581 00:44:00,100 --> 00:44:01,960 We'll need some kind of middleman 582 00:44:01,960 --> 00:44:03,680 that understands the USB commands 583 00:44:03,680 --> 00:44:05,760 and everything coming from AVR dude. 584 00:44:06,160 --> 00:44:12,800 And then, transfers it in a protocol that can handle, 585 00:44:12,920 --> 00:44:15,580 which is SPI, the Serial Peripheral Interface. 586 00:44:16,040 --> 00:44:17,960 So, that's what I'll demonstrate now. 587 00:44:19,840 --> 00:44:22,280 Firmware.hex, I think that's the name of the file. 588 00:44:22,380 --> 00:44:23,740 We're going to flash that and write. 589 00:44:24,020 --> 00:44:25,120 This is a command. 590 00:44:25,520 --> 00:44:27,080 I'm going to change the fuses. 591 00:44:27,220 --> 00:44:28,800 I think we need to ignore... 592 00:44:28,800 --> 00:44:30,840 The fuses is basically... 593 00:44:30,840 --> 00:44:34,840 Every microcontroller has usually an internal clock. 594 00:44:35,080 --> 00:44:35,980 You can tell it to... 595 00:44:35,980 --> 00:44:38,880 To reduce the clock speed. 596 00:44:39,380 --> 00:44:43,140 You can sometimes change a fuse 597 00:44:43,140 --> 00:44:45,200 so that it's no longer programmable. 598 00:44:45,400 --> 00:44:46,580 There's internal fuses. 599 00:44:46,580 --> 00:44:48,960 These are the type of things that AVR dude can manipulate. 600 00:44:51,180 --> 00:44:53,740 And here, I'm telling it to release 601 00:44:53,740 --> 00:44:58,540 the halving of the internal oscillator. 602 00:44:58,720 --> 00:45:00,280 When you get these chips from the factory, 603 00:45:00,520 --> 00:45:03,100 they're made to run very slow. 604 00:45:03,540 --> 00:45:05,260 And if we did that, 605 00:45:05,340 --> 00:45:05,960 then all of these chips would run very slow. 606 00:45:05,960 --> 00:45:08,680 And this animation would just be very slow. 607 00:45:08,840 --> 00:45:09,500 It wouldn't be nice. 608 00:45:09,740 --> 00:45:17,920 So, I always release this fuse, the 3A fuse, right? 609 00:45:18,040 --> 00:45:20,220 And this is the programmer that I have, 610 00:45:20,320 --> 00:45:21,560 which is the C command. 611 00:45:21,920 --> 00:45:23,140 And if I do nothing at all, 612 00:45:23,620 --> 00:45:25,120 because it's not connected to anything, 613 00:45:25,280 --> 00:45:27,800 it will give me some errors, right? 614 00:45:27,920 --> 00:45:30,140 Command failed because it's not connected to anything. 615 00:45:33,640 --> 00:45:35,940 But if I do it again after I connect it, 616 00:45:35,940 --> 00:45:37,340 I can connect the programmer, 617 00:45:40,000 --> 00:45:41,360 which looks like this. 618 00:45:41,520 --> 00:45:43,840 I'll try to raise this up a bit. 619 00:45:44,660 --> 00:45:45,960 I mean, it's going to be hard to see. 620 00:45:46,040 --> 00:45:46,520 I apologize. 621 00:45:47,040 --> 00:45:53,240 But you can understand that my computer is this. 622 00:45:53,400 --> 00:45:56,520 And then I've got a couple of cables for power and so on. 623 00:45:56,620 --> 00:45:59,880 And this white thing here is an Atmel. 624 00:46:00,380 --> 00:46:01,500 It's called an ICE. 625 00:46:01,820 --> 00:46:03,580 I'm not sure what that stands for. 626 00:46:03,820 --> 00:46:05,920 It's a serial programmer. 627 00:46:05,920 --> 00:46:16,560 So, this is necessary because there's no way to connect a USB cable directly to this board. 628 00:46:17,120 --> 00:46:20,420 If you have a board like a Raspberry Pi or something 629 00:46:20,420 --> 00:46:23,640 where you can directly connect a USB cable to it, 630 00:46:23,680 --> 00:46:25,040 then you can program directly. 631 00:46:25,440 --> 00:46:29,120 This is kind of a bad example because a Raspberry Pi has no microcontroller. 632 00:46:29,780 --> 00:46:31,720 But because we don't have that, 633 00:46:31,780 --> 00:46:33,980 we need a serial programmer like this. 634 00:46:35,140 --> 00:46:35,700 Okay? 635 00:46:35,700 --> 00:46:44,180 So, now I'm going to connect that to this orange board at the bottom. 636 00:46:44,920 --> 00:46:47,460 When I turn this on for the first time, 637 00:46:48,640 --> 00:46:50,340 that's the animation that begins. 638 00:46:51,400 --> 00:46:53,060 It's a fast animation. 639 00:46:53,960 --> 00:46:58,160 When I click, it goes to a slow animation. 640 00:46:59,440 --> 00:47:04,440 And the third option is kind of a strange Cylon thing there. 641 00:47:05,700 --> 00:47:06,080 Okay? 642 00:47:06,180 --> 00:47:07,500 So, I think that... 643 00:47:08,940 --> 00:47:17,760 So, I'm going to connect and program the new thing on there. 644 00:47:18,520 --> 00:47:19,860 If I can just... 645 00:47:19,860 --> 00:47:20,260 There we go. 646 00:47:21,800 --> 00:47:23,800 So, this should work now. 647 00:47:25,900 --> 00:47:26,500 Oops. 648 00:47:26,600 --> 00:47:27,660 That happens sometimes. 649 00:47:33,880 --> 00:47:34,480 Oh. 650 00:47:34,620 --> 00:47:35,680 I didn't have it on. 651 00:47:35,700 --> 00:47:36,080 Okay. 652 00:47:38,540 --> 00:47:40,280 I think we're still okay. 653 00:47:40,540 --> 00:47:42,020 So, these are the files. 654 00:47:42,160 --> 00:47:43,860 And now I'm going to turn it on. 655 00:47:47,540 --> 00:47:48,060 Okay. 656 00:47:48,180 --> 00:47:49,220 Now that's working. 657 00:47:49,280 --> 00:47:51,300 You can see it's writing at the bottom. 658 00:47:52,240 --> 00:47:53,760 And if you look at the badge, 659 00:47:54,020 --> 00:47:57,820 it's lighting up a lot of the LEDs. 660 00:48:00,040 --> 00:48:04,100 So, now it's no longer beginning with the fast animation. 661 00:48:05,160 --> 00:48:05,680 So, now it's no longer beginning with the fast animation. 662 00:48:05,700 --> 00:48:06,780 It's a bad example. 663 00:48:06,780 --> 00:48:08,320 I should have done something more pronounced. 664 00:48:08,600 --> 00:48:10,180 It's starting with a slow animation. 665 00:48:10,420 --> 00:48:12,300 The next one is a fast animation. 666 00:48:13,000 --> 00:48:14,480 The third one... 667 00:48:15,080 --> 00:48:15,600 Yeah. 668 00:48:15,760 --> 00:48:17,920 I did almost the same thing. 669 00:48:18,280 --> 00:48:18,660 Okay. 670 00:48:18,720 --> 00:48:20,100 To make this more pronounced, 671 00:48:20,300 --> 00:48:21,960 I'm going to change the source code. 672 00:48:22,160 --> 00:48:23,580 And that will be the end of the demonstration. 673 00:48:23,820 --> 00:48:27,360 And I'll walk around and try to get people started on doing other things. 674 00:48:29,900 --> 00:48:34,040 We can change things, I think, close to the bottom here. 675 00:48:34,040 --> 00:48:34,360 We can change things, I think, close to the bottom here. 676 00:48:34,740 --> 00:48:36,960 So, here's the loop. 677 00:48:38,380 --> 00:48:39,980 We'll start with... 678 00:48:42,600 --> 00:48:47,620 We'll start with a... 679 00:48:48,480 --> 00:48:50,020 We'll start with five. 680 00:48:51,660 --> 00:49:01,340 We'll just do five, zero, one, two... 681 00:49:01,340 --> 00:49:02,700 We'll just do five, zero, one, two... 682 00:49:02,700 --> 00:49:03,060 We'll just do five, zero, one, two... 683 00:49:04,060 --> 00:49:04,660 Three. 684 00:49:05,300 --> 00:49:08,060 And that means that our maximum... 685 00:49:08,060 --> 00:49:09,900 I think it's at the top. 686 00:49:12,340 --> 00:49:13,980 Three is the max. 687 00:49:15,160 --> 00:49:15,940 Was it... 688 00:49:15,940 --> 00:49:16,660 Yes, three. 689 00:49:16,740 --> 00:49:18,040 So, this should be correct. 690 00:49:18,120 --> 00:49:19,420 So, I'll go back. 691 00:49:21,700 --> 00:49:22,300 Build. 692 00:49:25,840 --> 00:49:26,140 Success. 693 00:49:28,060 --> 00:49:28,660 And... 694 00:49:31,060 --> 00:49:31,660 Connect. 695 00:49:31,880 --> 00:49:32,260 Connect. 696 00:49:37,940 --> 00:49:38,340 Connect. 697 00:49:38,400 --> 00:49:40,440 I can't see. 698 00:49:40,520 --> 00:49:41,980 Okay, connect and program. 699 00:49:42,260 --> 00:49:44,480 Take a look at the badge if you can see it. 700 00:49:45,880 --> 00:49:48,320 While I'm programming, it's going to light up. 701 00:49:51,920 --> 00:49:53,620 It's interrupting all of the... 702 00:49:54,080 --> 00:49:54,480 Exactly. 703 00:49:54,680 --> 00:49:54,940 Okay. 704 00:49:55,600 --> 00:50:00,220 So, now, I turn it off, turn it on, and you can see that it has a new program on there. 705 00:50:00,260 --> 00:50:01,820 The very first animation is different. 706 00:50:01,820 --> 00:50:16,660 If I switch to the next animation, it's a different one, switch to the third, and there is no fourth, I believe, or maybe, okay, the fourth is the default end of animation, animation, and the first one comes back on. 707 00:50:16,840 --> 00:50:21,420 So I think that kind of demonstrated how this workflow works, right? 708 00:50:22,100 --> 00:50:23,580 There are lots of options. 709 00:50:23,660 --> 00:50:29,600 Instead of Platform.io, you can use Arduino, you can use AVRGCC and make files. 710 00:50:29,600 --> 00:50:33,020 There are different things to achieve the same results. 711 00:50:33,400 --> 00:50:35,920 I think we still have a half hour or so. 712 00:50:36,320 --> 00:50:44,760 So at this point, I'll take some questions and then walk around and try to help those with computers do what they're trying to do. 713 00:50:44,820 --> 00:50:45,160 Any questions? 714 00:50:45,720 --> 00:50:47,800 Do you need to get that serial programmer? 715 00:50:48,000 --> 00:50:49,160 What do you need to get? 716 00:50:50,400 --> 00:50:50,880 Right. 717 00:50:50,960 --> 00:50:58,040 Well, the one that I have, which I can tell works pretty well for Atmel architectures, is called the Atmel ICE. 718 00:50:59,600 --> 00:51:01,460 They have different versions of that, I think. 719 00:51:01,520 --> 00:51:03,380 A few years ago, they started with one. 720 00:51:03,500 --> 00:51:04,840 I'm not sure which one I have. 721 00:51:05,100 --> 00:51:06,920 Maybe it says a number. 722 00:51:07,860 --> 00:51:08,660 I don't know. 723 00:51:09,860 --> 00:51:16,060 It just says Atmel-ICE on there, and then there's a serial number and a date. 724 00:51:16,280 --> 00:51:17,600 So that'll work just fine. 725 00:51:17,840 --> 00:51:19,540 They're a bit expensive, though. 726 00:51:19,600 --> 00:51:24,040 I think they're $80, $90, something like that, and they're not worth it. 727 00:51:24,180 --> 00:51:25,200 Why do I say that? 728 00:51:25,320 --> 00:51:29,100 Because an Arduino will work just fine, almost anything. 729 00:51:29,260 --> 00:51:29,580 There's all sorts of things. 730 00:51:29,600 --> 00:51:32,540 There's all kinds of hacky projects. 731 00:51:32,800 --> 00:51:45,100 If you look at Hackster.io or a lot of online sites, you can download your own PCB from Oshpark, populate it, and create a programmer on your own. 732 00:51:45,900 --> 00:51:58,460 Obviously, the easiest answer for you, if you're trying to get started easily and quickly, is to do the same exact thing that I did and then copy that model number down and just pay the money and get it, and it will work just fine. 733 00:51:59,600 --> 00:52:04,100 The other thing that I might say is that there are two interfaces. 734 00:52:04,300 --> 00:52:11,600 That's where you can plug things in onto these badges, because I know some people, well, people have different preferences, right? 735 00:52:11,800 --> 00:52:16,900 They both have six contacts, so they're very easy to identify. 736 00:52:16,960 --> 00:52:26,700 In fact, going to the badge website, which you maybe didn't know there was a website, it's this here. 737 00:52:28,440 --> 00:52:29,580 This is what I'm talking about. 738 00:52:29,600 --> 00:52:43,780 These little interfaces there with six contacts, one of them, there are six holes, and in the other one here, there's six contacts as well, but they're not holes through the board. 739 00:52:45,000 --> 00:52:47,480 Either one of those work to program the boards. 740 00:52:47,740 --> 00:52:52,480 The one that the hand is pointing at now, it's called a tag connect interface. 741 00:52:54,240 --> 00:52:58,820 And the other one above, this is the traditional, actually. 742 00:52:59,600 --> 00:53:05,500 It's just 2.54 millimeter pitch header pins. 743 00:53:06,120 --> 00:53:12,600 It's not really a name, but it's a traditional Arduino programming interface. 744 00:53:14,220 --> 00:53:23,380 So some programmers come with cables for one or another, or even there are many other types. 745 00:53:24,580 --> 00:53:25,140 Question? 746 00:53:25,400 --> 00:53:28,080 So each of those, what connects any of the three? 747 00:53:28,140 --> 00:53:29,240 And that's in our board? 748 00:53:30,060 --> 00:53:36,280 So there's only one MCU, and the other two chips are non-programmable. 749 00:53:36,380 --> 00:53:42,420 They simply are storage, like a USB media stores things. 750 00:53:42,720 --> 00:53:50,100 Right, so you don't have to worry about those as far as programming goes, and that's why there are no interface plugs or connectors there. 751 00:53:50,260 --> 00:53:57,680 The connector really is just a wireless connector on the back of the antenna. 752 00:53:57,680 --> 00:54:00,600 That's how you access those, and that's the interface. 753 00:54:00,800 --> 00:54:04,840 The interface for the lights portion, that's what we're talking about now. 754 00:54:05,460 --> 00:54:13,380 And depending on what you like best, what I like best is this tag connect interface because of the way that I can very quickly program. 755 00:54:13,480 --> 00:54:23,560 I push down, it has the tag connect cables have kind of a spring action pogo pin assembly on there. 756 00:54:23,640 --> 00:54:26,340 So I can very quickly go from one to the next board. 757 00:54:26,340 --> 00:54:37,860 And there's no attaching a cable, but I must say that most people are more comfortable with the header pins and the traditional Arduino plugs. 758 00:54:38,400 --> 00:54:42,260 And it works just as well, and they're more available, they're cheaper. 759 00:54:42,380 --> 00:54:44,420 So that's why I put both of those on there. 760 00:54:44,520 --> 00:54:49,220 And if I wanted to go crazy, I could probably do three or four other alternatives. 761 00:54:49,260 --> 00:54:51,900 All I would do is put traces on there. 762 00:54:51,960 --> 00:54:56,000 It would be really easy, but it would be more confusing as well. 763 00:54:56,000 --> 00:54:59,500 And I would be populating more parts anyway. 764 00:54:59,680 --> 00:55:00,660 It's not important. 765 00:55:01,220 --> 00:55:04,400 So you have two choices on where to plug in. 766 00:55:04,500 --> 00:55:13,300 When I just plugged in myself, it's too small to show you, but I connected to this here. 767 00:55:15,440 --> 00:55:18,940 To this, I can't get it, there it is, to that. 768 00:55:19,100 --> 00:55:25,200 And that is when you saw all of this writing. 769 00:55:25,200 --> 00:55:27,120 And verifying happened. 770 00:55:28,040 --> 00:55:30,440 AVRDUDE is what programmed the badge. 771 00:55:30,740 --> 00:55:31,800 Any other questions? 772 00:55:37,960 --> 00:55:40,660 Yeah, well, there are two people. 773 00:55:40,860 --> 00:55:42,160 There's AGS and there's me. 774 00:55:42,220 --> 00:55:43,200 We're selling the badges. 775 00:55:43,260 --> 00:55:47,860 AGS has packages of badges for anyone who bought over his website. 776 00:55:48,200 --> 00:55:53,500 It was a pre-sale that happened a couple weeks ago, I guess. 777 00:55:53,640 --> 00:55:55,180 And a lot of people bought it. 778 00:55:55,200 --> 00:55:57,840 People bought badges, and he has their order numbers. 779 00:55:58,040 --> 00:55:59,800 So you need your order number if you did that. 780 00:55:59,900 --> 00:56:05,840 If you didn't buy it during that time, then I have badges as well for sale. 781 00:56:06,000 --> 00:56:07,340 In fact, I have all three now. 782 00:56:07,940 --> 00:56:12,300 The problem yesterday, I wasn't sure how many I had of all three, and I had orders to fill. 783 00:56:12,420 --> 00:56:15,000 So I was telling people we were sold out. 784 00:56:15,120 --> 00:56:15,740 It wasn't. 785 00:56:16,640 --> 00:56:18,860 I thought we were, and I was being honest. 786 00:56:19,240 --> 00:56:20,380 But we're not sold out. 787 00:56:20,420 --> 00:56:24,580 I think I have a couple handful left of the high-value premium badges. 788 00:56:24,580 --> 00:56:27,520 And I have a couple boxes of the regular ones. 789 00:56:28,340 --> 00:56:29,580 Any other questions? 790 00:56:29,640 --> 00:56:34,060 Was that halfway clear, the workflow, where we started with Platform.io? 791 00:56:34,160 --> 00:56:35,300 We typed. 792 00:56:35,420 --> 00:56:36,000 We edited. 793 00:56:36,220 --> 00:56:38,200 We developed and coded. 794 00:56:38,440 --> 00:56:39,800 We built and compiled. 795 00:56:40,140 --> 00:56:44,140 And then we had a firmware file, which ends with .hex. 796 00:56:44,360 --> 00:56:49,680 And then we used AVRDUDE to program that over a USB device onto the board. 797 00:56:50,860 --> 00:56:53,660 My question is, what does it do without any mods? 798 00:56:54,580 --> 00:56:58,520 What does it do without any modifications? 799 00:56:59,120 --> 00:57:02,880 I can't show it anymore, because I overwrote mine. 800 00:57:03,100 --> 00:57:11,840 But all of the badges that I sell, that I've produced, are the same as... 801 00:57:13,160 --> 00:57:13,920 What's that? 802 00:57:15,100 --> 00:57:16,760 Let me rephrase that. 803 00:57:16,880 --> 00:57:19,900 There are three different models, right? 804 00:57:20,000 --> 00:57:20,780 There is the regular. 805 00:57:21,520 --> 00:57:23,860 There is the alien. 806 00:57:24,580 --> 00:57:26,420 There is the nice blue color. 807 00:57:26,680 --> 00:57:33,720 And then there is the boss badge, with the two-tone colors and kind of the authoritative animation. 808 00:57:36,100 --> 00:57:43,000 Whichever you choose, your animation will match every other person that has chosen that badge. 809 00:57:43,840 --> 00:57:45,120 I don't know if that... 810 00:57:45,120 --> 00:57:46,420 I mean, that doesn't really answer your question. 811 00:57:46,520 --> 00:57:46,880 I'm just... 812 00:57:46,880 --> 00:57:47,540 . 813 00:57:51,180 --> 00:57:51,700 Right. 814 00:57:51,940 --> 00:57:53,240 So after you switch it on, 815 00:57:53,240 --> 00:57:56,660 the first animation appears just like everyone else. 816 00:57:56,800 --> 00:57:59,680 And you can change that by clicking on the switch. 817 00:57:59,880 --> 00:58:03,440 You need to hold it down, because it only samples at the end of the animation. 818 00:58:03,880 --> 00:58:07,860 So sometimes you click too quickly, and it won't register it. 819 00:58:08,620 --> 00:58:12,420 But if you click at just the right time, or if you hold it down long enough, then it will register. 820 00:58:12,580 --> 00:58:16,880 And then it goes to the next animation, which I... 821 00:58:17,880 --> 00:58:19,600 Which is part of the source code. 822 00:58:19,680 --> 00:58:20,020 Whoops. 823 00:58:20,840 --> 00:58:21,580 Where is it? 824 00:58:22,160 --> 00:58:25,540 Which I just modified in order to change the sequence. 825 00:58:26,220 --> 00:58:26,760 Right? 826 00:58:27,680 --> 00:58:30,720 And that's all that you can do with one button. 827 00:58:30,800 --> 00:58:32,620 You see, it's quite a limited device. 828 00:58:32,920 --> 00:58:33,320 Right? 829 00:58:33,380 --> 00:58:39,920 This is not measuring temperature, or you don't have a screen to get menus and things like that. 830 00:58:40,600 --> 00:58:41,920 Does that answer your question? 831 00:58:42,380 --> 00:58:42,920 . 832 00:58:49,740 --> 00:58:50,280 Yes. 833 00:58:50,480 --> 00:58:50,860 Okay. 834 00:58:51,580 --> 00:58:55,180 So the question is, does it have NFC features? 835 00:58:55,340 --> 00:58:56,500 And the answer is yes. 836 00:58:57,880 --> 00:59:03,280 It's difficult to answer, because, okay, first of all, I call this a split-brained badge, 837 00:59:03,560 --> 00:59:05,340 because there are really two sides to it. 838 00:59:05,400 --> 00:59:09,240 And that's why I wrote lights on one side and radio on the other. 839 00:59:09,780 --> 00:59:13,220 And there is no communication between the two sides. 840 00:59:13,540 --> 00:59:16,720 What would be very nice, and what would work for the... 841 00:59:16,720 --> 00:59:18,780 I think the battery's running out. 842 00:59:18,780 --> 00:59:20,520 Does anybody have batteries for the microphone? 843 00:59:21,500 --> 00:59:27,020 What we'll be working on for the next version of badges for the next conference in Europe 844 00:59:27,020 --> 00:59:38,700 is that once we place the badge onto a NFC device, the microcontroller understands that and lights things up. 845 00:59:38,860 --> 00:59:40,220 It's going to be a bit different. 846 00:59:40,300 --> 00:59:40,900 It's going to be good. 847 00:59:42,200 --> 00:59:47,500 But that will require that there's communication from the NFC radio side 848 00:59:47,500 --> 00:59:51,020 to the MCU-powered lights side. 849 00:59:51,460 --> 00:59:55,620 And our situation here at DEF CON, this is a split-brain. 850 00:59:55,660 --> 00:59:58,020 There is no communication between the two sides. 851 00:59:58,260 --> 01:00:06,260 So if you lay this onto an NFC reader-writer, an active NFC device which can supply power like a phone, 852 01:00:07,260 --> 01:00:16,500 then your radio logic, your radio circuits will work, but the MCU won't have any idea about it. 853 01:00:16,500 --> 01:00:18,480 You can even have the badge turned off. 854 01:00:18,580 --> 01:00:22,940 You can take the battery out, and the radio circuit still works. 855 01:00:23,680 --> 01:00:25,840 The way to use that... 856 01:00:25,840 --> 01:00:27,920 So there are two buttons over there as well. 857 01:00:28,240 --> 01:00:36,200 Try to imagine an NFC tag, a library card, or whatever has an NFC antenna loop inside. 858 01:00:37,400 --> 01:00:42,400 I'm not feeling too creative after so much lack of sleep, 859 01:00:42,600 --> 01:00:45,220 but if you can imagine an NFC application, 860 01:00:45,220 --> 01:00:49,960 maybe in your school or whatever, door access control sometimes. 861 01:00:50,460 --> 01:00:56,000 Sometimes it's a RFID device, but it's very similar in any case. 862 01:00:56,100 --> 01:01:02,500 There's a connected antenna, and there's no energy source for one of the two sides, for the passive side. 863 01:01:03,240 --> 01:01:06,060 Anyway, so this is the same thing with one exception. 864 01:01:06,300 --> 01:01:11,340 Instead of simply lying it on the reader and the reader automatically recognizing, picking up, 865 01:01:11,400 --> 01:01:12,640 and taking the information, 866 01:01:12,820 --> 01:01:15,200 which could lead to opportunistic damage, 867 01:01:15,220 --> 01:01:16,740 data theft, for example. 868 01:01:16,900 --> 01:01:21,260 If you, for example, embed an antenna on a table, 869 01:01:21,400 --> 01:01:23,120 that would be great at DEF CON, right? 870 01:01:23,260 --> 01:01:25,220 You're stealing people's data left and right, 871 01:01:25,340 --> 01:01:27,520 their wallet's going on the table, 872 01:01:27,580 --> 01:01:29,440 and you're reading their library card information, whatever. 873 01:01:29,800 --> 01:01:34,240 What we decided is to block or defend against that by putting switches on here. 874 01:01:34,440 --> 01:01:40,720 So if you lay your badges on a table that was manipulated by an attacker, 875 01:01:40,980 --> 01:01:42,680 they will not be able to get your data. 876 01:01:42,900 --> 01:01:44,680 It doesn't mean you should store... 877 01:01:45,220 --> 01:01:46,360 critical data on here. 878 01:01:46,440 --> 01:01:47,420 I recommend against that, 879 01:01:47,580 --> 01:01:50,920 but it does mean that you have a bit of protection, 880 01:01:51,120 --> 01:01:55,040 because you must use your finger and push on one of those two tactile switches, 881 01:01:55,240 --> 01:01:56,280 and at that moment, 882 01:01:56,420 --> 01:02:00,600 a reader or a writer can access the NFC circuit. 883 01:02:00,720 --> 01:02:02,580 Only then you take your finger off, 884 01:02:02,740 --> 01:02:03,840 and you're safe again, 885 01:02:04,020 --> 01:02:05,800 or marginally safe, 886 01:02:05,860 --> 01:02:07,420 safer than usual, right? 887 01:02:07,840 --> 01:02:08,900 Does that make sense? 888 01:02:09,120 --> 01:02:10,840 So if you have your library card, 889 01:02:10,840 --> 01:02:14,460 and you go to a coffee shop, 890 01:02:14,680 --> 01:02:19,820 and they have sometimes embedded chargers on the table, 891 01:02:19,940 --> 01:02:21,740 and you might have your telephone there, 892 01:02:21,860 --> 01:02:23,180 and your library card here, 893 01:02:23,420 --> 01:02:26,140 they can take your data easy enough. 894 01:02:26,380 --> 01:02:28,080 I mean, if you own the coffee shop, 895 01:02:28,200 --> 01:02:30,040 and you embed an antenna on there, 896 01:02:30,200 --> 01:02:33,360 there's going to be one customer who puts their wallet on the table, 897 01:02:33,460 --> 01:02:35,060 and then you have their data. 898 01:02:35,580 --> 01:02:40,440 But if that customer had a blocking factor, 899 01:02:40,440 --> 01:02:42,360 something like a tactical switch, 900 01:02:43,380 --> 01:02:45,660 tactile switch like these here, 901 01:02:45,880 --> 01:02:49,520 then they would need to first push on that 902 01:02:49,520 --> 01:02:51,180 to complete the circuit with the antenna, 903 01:02:51,440 --> 01:02:54,760 and only at that moment can data be read out of this, 904 01:02:54,880 --> 01:02:55,720 or written to it. 905 01:02:56,700 --> 01:03:01,220 And I can talk a bit about how to use an NFC tag in general, 906 01:03:01,440 --> 01:03:03,920 but this is kind of a... 907 01:03:03,920 --> 01:03:05,080 There's probably... 908 01:03:05,080 --> 01:03:06,720 If you search online, you know, 909 01:03:07,980 --> 01:03:08,840 NFC tag, 910 01:03:08,840 --> 01:03:09,400 this is... 911 01:03:09,400 --> 01:03:10,780 It's very basic. 912 01:03:10,940 --> 01:03:12,580 I don't have examples, 913 01:03:13,820 --> 01:03:15,420 but a lot of... 914 01:03:15,420 --> 01:03:16,480 A lot of what? 915 01:03:17,180 --> 01:03:18,960 Library cards, for example, 916 01:03:18,960 --> 01:03:23,160 have RFID or NFC embedded inside the plastic. 917 01:03:23,200 --> 01:03:24,700 You don't really see it unless... 918 01:03:24,700 --> 01:03:26,880 Sometimes you can with a very bright light. 919 01:03:27,460 --> 01:03:28,840 That's a radio circuit 920 01:03:28,840 --> 01:03:32,660 and an extremely small chip inside as well, 921 01:03:32,780 --> 01:03:36,000 which basically stores a very small amount of data. 922 01:03:36,080 --> 01:03:36,480 So it's... 923 01:03:36,480 --> 01:03:36,920 It's... 924 01:03:36,920 --> 01:03:39,060 It stores a number for you, 925 01:03:39,160 --> 01:03:40,580 an anonymized number, 926 01:03:40,680 --> 01:03:48,760 so your library customer 568540 or whatever, 927 01:03:48,960 --> 01:03:52,860 you lay down your library card on the reader, 928 01:03:52,980 --> 01:03:55,560 and then you can check out books that way. 929 01:03:55,780 --> 01:03:57,460 And if you don't return your books, 930 01:03:57,520 --> 01:04:00,000 then they match your number to your name and address 931 01:04:00,000 --> 01:04:01,500 and send you a bill, right? 932 01:04:01,660 --> 01:04:04,500 So that's one of about 50 million applications 933 01:04:04,500 --> 01:04:06,360 for contactless... 934 01:04:09,280 --> 01:04:10,420 radio applications. 935 01:04:10,700 --> 01:04:13,180 Contactless just means you're not plugging cables in 936 01:04:13,180 --> 01:04:16,200 and creating copper or physical connections. 937 01:04:16,280 --> 01:04:20,280 It's going over up to 1.5 millimeters of distance of space. 938 01:04:20,520 --> 01:04:22,620 It's a wireless interface. 939 01:04:23,160 --> 01:04:25,140 So that's what you have in these badges as well. 940 01:04:25,280 --> 01:04:28,520 All three of the badges which I sell have this feature. 941 01:04:28,700 --> 01:04:31,800 The only difference is that the less expensive... 942 01:04:31,800 --> 01:04:32,520 I like... 943 01:04:32,520 --> 01:04:34,340 I like to keep prices as low as you... 944 01:04:34,340 --> 01:04:36,340 You can see what prices are. 945 01:04:36,360 --> 01:04:40,780 I like this because it kind of democratizes badges. 946 01:04:41,640 --> 01:04:44,040 It's hard to find cheap badges at DEF CON. 947 01:04:44,240 --> 01:04:45,900 I like that, you know, anybody, 948 01:04:46,100 --> 01:04:47,820 regardless of how much money they have, 949 01:04:47,820 --> 01:04:48,720 can have a badge. 950 01:04:49,180 --> 01:04:51,500 But that means that I have to put less 951 01:04:51,500 --> 01:04:53,700 high-rated components on here. 952 01:04:53,800 --> 01:04:56,600 So the tactile switches are a bit clumsier. 953 01:04:56,740 --> 01:04:57,580 They're not as nice. 954 01:04:57,880 --> 01:04:59,620 They're not low profile. 955 01:04:59,740 --> 01:05:00,760 They click a lot. 956 01:05:00,960 --> 01:05:04,430 And the NFC EPROMs don't store very much information. 957 01:05:05,120 --> 01:05:06,340 They can just store two cases. 958 01:05:06,340 --> 01:05:07,060 64 kilobits of data. 959 01:05:07,480 --> 01:05:10,520 And the others can store 64 kilobits. 960 01:05:11,240 --> 01:05:13,760 So, yeah, people are always asking what the differences are. 961 01:05:13,920 --> 01:05:15,020 Those are a few of the differences. 962 01:05:15,440 --> 01:05:16,300 Any other questions? 963 01:05:20,000 --> 01:05:20,760 You're welcome. 964 01:05:21,980 --> 01:05:23,580 Oh, this screen is off. 965 01:05:23,760 --> 01:05:25,040 I was kind of... 966 01:05:25,040 --> 01:05:28,600 I was kind of hoping to get a bit further with hands-on, 967 01:05:28,720 --> 01:05:31,240 well, which isn't so relevant 968 01:05:31,240 --> 01:05:34,500 if we just have one or two people with computers in the whole room. 969 01:05:35,480 --> 01:05:38,860 But I think in other parts of the world, 970 01:05:38,920 --> 01:05:40,460 maybe again at DEF CON next year, 971 01:05:40,600 --> 01:05:42,820 we'll have similar situations 972 01:05:42,820 --> 01:05:45,680 where instead we'll be better prepared 973 01:05:45,680 --> 01:05:49,360 and we'll have one programming device 974 01:05:49,360 --> 01:05:54,700 for each of us at each table position, for example. 975 01:05:54,700 --> 01:05:55,600 That was my plan. 976 01:05:55,700 --> 01:05:56,700 I just didn't get to it. 977 01:05:57,620 --> 01:05:59,180 But I did do the demonstration, 978 01:05:59,480 --> 01:06:01,600 and I think that kind of clarified a bit 979 01:06:01,600 --> 01:06:03,420 of what must happen 980 01:06:03,420 --> 01:06:07,560 after one of these chips comes from a manufacturer, 981 01:06:08,600 --> 01:06:10,980 STMicroelectronics, or no, in this case, I'm sorry, 982 01:06:11,060 --> 01:06:13,100 this is Atmel itself, 983 01:06:14,220 --> 01:06:16,280 comes to the producer, that's me, 984 01:06:16,360 --> 01:06:18,700 and then they solder that on, and it's empty. 985 01:06:18,820 --> 01:06:20,480 What has to happen then 986 01:06:20,480 --> 01:06:23,980 in order for anything like lights to appear, right? 987 01:06:24,000 --> 01:06:27,140 You need to develop, compile, and then program. 988 01:06:27,500 --> 01:06:30,260 That's kind of the workflow, just in a nutshell. 989 01:06:31,740 --> 01:06:33,200 Yeah, so there is... 990 01:06:33,420 --> 01:06:36,720 There's still, you know, 10 minutes, 991 01:06:36,820 --> 01:06:39,100 but I think most questions have been answered, 992 01:06:39,200 --> 01:06:42,980 and we don't really have much time left. 993 01:06:43,120 --> 01:06:46,440 So I think we'll end it early, if it's okay with you. 994 01:06:47,340 --> 01:06:48,520 One last question. 995 01:06:53,080 --> 01:06:54,080 Yeah, that's fine. 996 01:06:54,140 --> 01:06:55,020 Should I come over to you? 997 01:06:55,100 --> 01:06:57,140 I'll wrap up here, and then... 998 01:06:57,680 --> 01:07:00,340 Or is it a question that I can answer like this? 999 01:07:01,640 --> 01:07:02,120 Yeah. 1000 01:07:03,500 --> 01:07:04,640 Okay, that's what we'll do next.