So, a show of hands, who here has suffered a scrum meeting? Be honest, there's no shame in it? A scrum meeting. Okay, so in a scrum meeting you're supposed to say what you did the day before, and what you're doing that day, and then you're supposed to wait for another hour as, like, round robin goes around, and then you've wasted the first hour of your day and you've got nothing done. And I had the misfortune of doing these every morning. First thing, every day of the work week for several months. And it really, really took a toll on my soul. Because, you know, when you're talking about doing work instead of doing the work, it gets really frustrating, right? So I decided that I didn't want to do that anymore, and so I stopped doing that, and instead I made this, and I hope that you like it. This is a clone of the Casio 3208 watch module called the Goodwatch. It's completely open source and open hardware. Everything is available on GitHub. It's a replacement board that fits within the original Casio watch. So you can have, like, a watch that's good to wear, that has, like, the right metals and materials and all that stuff, is comfortable, has years of battery life. So we're not talking a smartwatch here. And at the same time, there's room for additional features. So not only is this programmed in C, and you can have a reverse Polish notation calculator instead of the algebraic one that it came with, but you can also do really crazy stuff, like a disassembler for it. Or you can add extra hardware. So this includes a 70 centimeter amateur radio. The next revision runs from 300 megahertz to 1 gigahertz using the watch band itself as a random wire antenna. So you can receive radio signals and you can transmit them, and you can use it to help reverse engineer other devices without having to bring out a full software-defined radio, without having to pull out your laptop, and without having to run the expensive, power-hungry and heavy tools. Because as you're wandering around here, if you have a laptop bag and you've got your radios and you've got your antennas, the weight of all of that can add up. So wouldn't it be nice to just have your entire toolkit on your wrist whenever you might need it in a way that you can forget about it the rest of the time? So I'm not the first to make a replacement board for a wristwatch, and I'm not the first to play with this radio chip. So as far as background goes, there's this thing called the Pluto watch, which is a replacement for the Casio F91W. This watch is famous because there was a moral panic over them being used in improvised explosive devices, where the alarm ringer would set off an explosion, prompting even TSA warnings about giving extra attention to people wearing the Casio F91. The Pluto watch also uses an MSP430 related to the one that I'm using, but they add a MEMS compass to it. So in addition to running your own code on the watch, you can also tell which way is north just by swinging your wrist around. About 10 years ago, TI came out with the Chronos development kit, which uses the same CPU that I use. The Chronos had a number of problems with it, though. It's really heavy, and it's really bulky. So you've got a fixed watch band that's uncomfortable. In the summer, your wrist will fill up with sweat. And it doesn't have a full keypad, so you need to go through awkward menu rings in order to reach anything that you like. There's also the Faraday RF kit, which again uses the ChipCon 430 chip that I'm using. They add a power amplifier for the 900 megahertz band. So you can just buy one of these things and have a half watt transceiver that's compatible with the wristwatch. Their firmware and their hardware are also open source, although little to no code is shared between them and my watch. And then, of course, a few years back, at TorCon, Michael Osmond and I did a lecture called Real Men Carry Pink Pagers. It's me on the left and Mike on the right. And we reverse engineered these pink children's text messaging toys in order to make a spectrum analyzer, a garage door opener, a reflexive jammer for APCO P25. The radio in these things is not a software-defined radio. It's not very good for reverse engineering a signal. But after you understand what that signal is, it's an excellent radio for talking to it or for making a receiver or a transmitter. And then there's the RF cat running on the Yardstick One hardware. This is by Atlas and Michael Osmond and those folks. This is a nice little tool that allowed you to write your radio definitions in Python on your own workstation while receiving from the real antenna with the real radio. The register settings for the RF cat are compatible with my watch. So you can prototype a receiver in Python on the hardware that's easy to prototype for and then move that definition to run inside of the watch as a radio application that you can keep with you at all times. So when you have an existing watch and you want to replace it, you first need to understand what goes where and why. So the Goodwatch 10 left out the radio and was my prototype to figure out that the LCD layout was correct, that the keypad layout was correct. I began by using a micrometer, a vernier caliper, to measure all of the dimensions of the PCB. So first I needed to know how wide it is, how tall it is, where the screw holes are. And I drew all this out on paper and then recreated it in the CAD software. And I did this for the front of the board, for the back of the board. And then I made my own board that matched those dimensions. So every keypad pin has to be in the same place. Every LCD pin has to be in the same place. Into this board I placed the ChipCon 430 F6137. This is the CPU of my device. You can also use the 6147, which is a related chip that's more modern. But each of these has 32 kilobytes. It has 4 kilobytes of flash. It has 4 kilobytes of SRAM. It has a built-in LCD driver and a built-in radio and a bootloader ROM that allows you to flash it over a serial port. And all of this comes for free inside of the chip so that I could build the entire watch around a single chip and a couple of support components. It's important to keep it to as few devices as possible because the chip packaging takes a lot of surface area on the board and also a lot of vertical height. So I wanted to have room for another chip to have a separate radio and CPU. They really had to be the same device. And similarly, I don't have room for an external LCD controller. So I had to find a part that contained both the CPU and the LCD controller and the radio in a single component in order to fit everything. And that got me a watch with a working display, with working keypad inputs. I initially bootstrapped it by building a watch that has these little blue fly wires coming out of it for reflashing. This also allows me to read back the de-message log from the watch. And I use this for all of my software development so that as I'm developing the code, I'm doing it on a tethered watch where temporarily I have no power concerns and where I get full logging. On the left is my recreation of the board, the Goodwatch 10. On the right is the original board from Casio. And you can see that even though the components are in different places, all of the pads are in identical locations. Because I'm less concerned about the cost of the individual PCB, I was able to do silver coating to prevent oxidization. You'll note that the copper has sort of dimmed down over the years in the original. And instead of an epoxy blob, I use a QFN chip. I drafted this in KiCad, so there are no licensing requirements to be able to edit the PCB or to manufacture your own. You can grab the files from the website, send it off to China, and receive your own package of 200 boards. They cost under a dollar apiece if you're doing a quantity above 100. But having the board is only part of it. You also need to know which pins do what. So the black bar here that is blocking some of the pins on the far west of the LCD, those pins are called commons. And a common is connected to very many segment pins. And you can think of this as like a row and column for a driver. And you have very few rows and very many columns. And then they're wired up to fit the individual pixels of the LCD display. So these are the common pins. These are the commons. And these are the segments. And I recovered these by using sticky tape. Or the little sticky notes, right? You take a razor blade and you chop off the end of it. And then by sticking this onto the PCB, you can selectively introduce a failure in a single pin of the LCD. I had to do this because I don't quite have enough LCD pins on my chip to drive all of the pins of the physical LCD hardware. So I needed to find which pins I could block off while keeping every digit of the display legible. To figure out which pin does what, you just introduce failure in a whole bunch of them at a time. So with the black bar there covering the far west pin, I now know that a quarter of the LCD pixels will refuse to light. And if I move that just one over, then a different quarter fail to light up. And a little bit further, a different quarter fail to light up. And so on. And whenever you cover up a pin that knocks out a quarter of the pixels, you're covering a common pin. And whenever you cover a pin that knocks out one, two, three, or four of the pixels, then you're covering up a segment pin. And this is how you figure out how to wire it to the chip. You don't actually care about which pixel is connected to which pair yet. Because you can figure out the rest of that by software. So instead of running through and tapping each and every one of these and measuring which pixels go out at which time, which would take forever, instead I just wired it up in software, lit up all of the pixels, and then selectively turned them dim. And then for each dim one, I was able to come up with its address, which is which common meets which segment. And that way I was able to write the LCD driver, after my hardware prototypes arrived, so that they didn't block each other. As far as the software went, MSP430 chips are well supported by GCC, and a complete development toolchain is available inside of most standard Linux distributions. So in Debian, you can build this firmware, either in stable or in testing, just by installing the compiler and building it. You don't need any external packages or external package sources. And then the actual programming happens through a serial port. So these little test probes that are connected to the sides, those are connected to the pins that allow me to force the chip into its bootloader mode. And then the bootloader appears as a serial port with documented commands. And a Python script can check the model number, erase flash, load in the programming, reboot. It can also dump a copy of RAM, so that I can do core boots, I can do core dumps from a running watch, in order to load a real RAM image into my debugger, to see what particular variables were. Or, I can dump the dmessage log. So when I run printf, there's no room on the LCD to cover the full kernel log. So instead, printf just writes to a memory buffer, and by dumping that memory buffer out, I can use printf debugging to see what went wrong. And then the ads are implemented by rows and columns again. And whenever you push a button, it connects that row to that column. So if we push the upper left button, which is a seven, that will connect pin two dot two to pin two dot three. And the two will be bridged and there will be a circuit between them. So what we do is we set all of the rows to be input pins and all of the commons to be output pins. And the inputs we pull lightly low, and the outputs we pull slightly low. strongly high. And when they connect, the inputs will jump high and that tells us which column touched which row by then cycling all of the other pins off. And again, we implement this as a table in which the high nibble of each byte is the scan code and the low nibble of each byte is the actual ASCII character. So that the driver can return the ASCII character of the key that's being pressed rather than the scan code. So that your source code can remain readable. Power management matters a lot if you're building something that has to run on a 1.6 millimeter thin coin cell battery for years. If I have to replace the battery every day or if I have to recharge the watch every day, it will become too much trouble and I'll stop wearing the watch and then I won't really have a wearable. So, I'm going to show you a few examples. The main CPU has a variable clock rate. And CMOS chips, when they're digital, they waste just a little bit of energy when the transistors flip. So, if you have a gate, when that gate transitions, then a little bit of energy is lost and after the transition and before the transition, it's almost perfectly static. It leaks very, very little energy. So, the power consumption is almost linear with the clock speed. And also, the power consumption is almost zero. So, a watch doesn't really have to do that much when it's idling. It only needs to display the time. So, I can run the entire CPU at 32 kilohertz until momentarily I need more speed and then I'm able to jump it up to 1 megahertz. And then my idle CPU draw can be as small as 5 microamps. I implemented a reverse polish notation calculator. So, like the old Hewlett-Packard calculators, whenever you enter a number, it pushes it on a number. And then you have a number that is written to the stack. Whenever you hit an operator, it pops the last two values off the stack and pushes the result. This allows the calculator to be written quickly and with very small source code. New functions can be added. There is a timer. Each of these applications is written as, like, a small little module of C code, so that you can fork any application to add new pieces to it. There are bugs, though. Because when you implement something like this, the the documentation says it's supposed to work a certain way. And then you actually get it running and faults occur. You might have forgotten to check for an error message or there could be a mistake in the documentation. You need a way to debug this so that you can work out all of these kinks and then have a stable platform. So one of the applications that I wrote was a hex editor. And the hex editor allows me to view all of the CPU's memory. And it shows, I have room for eight hexadecimal nibbles on the screen. So the left four digits are the address and the right four are the value. I had two of the prototypes of this watch and I was in Budapest and I had no tools with which to work on them. Except for what I could borrow from a friendly hacker space. So the watch on the left is keeping accurate time and the watch on the right is losing an entire minute every day. And I needed to figure out why. So I used the hex editor to check the error flags of the real time clock value. And they all looked good. And then I checked the crystal and I was able to find that the low frequency crystal had faulted and that when the low frequency crystal faults on this chip, it defaults to a software backup. And the software backup was wasting a ton of time. So I was able to debug this without opening the case or any of that just by using the hex editor. As long as you have a hex editor, you might as well add a disassembler. So you can disassemble the firmware of the watch on the watch itself and then reverse engineer it with pen and paper. It has a power on self test. So every time I've been able to identify a faulting condition, I add a check for that to a routine that runs through and check the clock. And then I can do the test. And that's all of them at start up and all of them if you press the number 7. This allows me to recognize things like clock faults or things like leaving the radio on that can sabotage the power consumption. Because if a minor bug were to leave anything powered up that oughtn't be, that could wipe the battery out in a day or two and the watch will die. Then we need a radio. Because there's no point in having a fancy watch with a disassembler if it doesn't also give you like a really cool tool on the side. So I'm going to show you how to do that. I'm going to show you a little bit of the other side. To add a radio to the non radio version, I needed to add a crystal. It's a 26 megahertz crystal that provides the timing needed for the phase lock loops and the other analog pieces of the radio. And I also needed a filter chain. Without the filter chain, when you transmit, you would also transmit on harmonic frequencies because the digital chip can produce a square wave but not very well a sine wave. So I have a digital chip. I'm going to do an So, the original radio models are restricted to the band between 430 and 435 megahertz because of a band pass filter. The upcoming version extends this to support the full range of the chip by using a low pass filter above the 900 megahertz band. So you will transmit harmonics if you transmit in the lower frequencies. This causes no trouble for reception. I needed an antenna. So this little green wire here in the back actually connects the watch band as a random wire antenna. So that the watch band is the antenna for all reception and transmission. This is not a very good antenna, but it is more than good enough. In tests we were able to transmit Morse code across four city blocks in West Philadelphia. Received indoors. Now, radio software also has to be carefully considered. If you're building your first watch from my design, you'll get the digital parts working before you have the radio properly wired up. So it needs to gracefully downgrade. When the watch powers up, if it's unable to start that 26 megahertz radio crystal, if it can't fire that up, it assumes that it's not populated. And then it disables all radio features. Or if you need a model that you can wear inside of a skiff, you can just not populate that component and then you have a non-radio watch. It was also very important to have a way to quickly prototype radio functions separately from the GUI. For those purposes, the watch can be assembled with a built on chip antenna outside of a wrist watch. And then. All of the firmware can be communicated with over a serial port so that you can ask it to receive packets or transmit packets. And in this way you can prototype any new protocol entirely in software as a desktop Python application without having to involve the GUI of the watch. So you don't need to push the teeny little buttons to try the thing when you're trying to get it to work for the very first time. There's also code plugs. There's a text file that lists all of the frequencies that you might use. And then you can use this text file to add your own channels or things that you're interested in to tune between them in the tuner application. Radio power management also matters a lot. I told you before that with the radio off, the CPU consumes 5 microamps at 32 kilohertz and 160 microamps at 1 megahertz. Just receiving. Not transmitting. It takes 15 seconds. 10,000 microamps. Transmitting can cost up to twice that although for a shorter period of time because you can shut the radio off after your transmission completes. This is a ton of power by comparison. It's for this reason that I can't really write like set it and forget it pager application. The watch can't be idly listening because idly listening costs a ton of power. Transmitting is a lot easier because it's only using energy for the time that you push down the button. So we have a Morse code mode where you can push the side of the watch as a Morse code key and then send that to any single sideband receiver within range. So here we have a Yesu 817 and we had this set up at a bar and then my buddy took the watch four blocks from the bar and was saying hello in Morse code. And we accurately received it. You can also send more complicated packets. This is GMSK transmission that we use as like a fast data rate packet format for dumping larger files. So one of our contributors is working on dumping the D message log over the radio so that in debugging we can just ask the watch to flush its logs out and then have a desktop nearby with a receiver. This can also be used for automated real world power management. So if I want to record the battery of a watch dying over a long period of time, then I can put a reduced capacity battery into a watch and set it to transmit its voltage every night at midnight and get a nice little graph of the voltage falling over time. Now this is great for talking to like abstract things. But in addition to abstract things. You also want to talk to specific things. So I bought a relay controller. All of these cheap relay controllers seem to use the same protocol of sending either a wide burst for a one and a short burst for a zero or the other way around. I call this the eights and E's code because if you receive it with accurate timing and you assume that they're a nibble wide. Then the long ones become E's and the short ones become eights or one-zero-zero. You can reverse engineer these using universal radio hacker. Connect it to any SDR and then it takes a recording and allows you to zoom in and out on the signal. You can change the thresholds. You can change the encoding. You're basically just trying to measure the width of one short bit. So here I have short bit selected. And then once you know that width. Yeah. you're able to program your own radio transmitter to mimic the signal which you copy out as a packet in hexadecimal. So the result of that will be this set of register values which are compatible with the RF cat. So you can take anything that's been reverse engineered to talk to an RF cat and you can then port it over to the watch. You also need the packets themselves. So here we have four strings broken apart into eight lines and these are for the A, B, C and D buttons of the transmitter. And then at the end of it you have a working signal that you can send. You can also send this between devices. So here I'm transmitting as Morse code to my hand held radio. And then I can send it to my watch. And then I can send it to my watch. And then I can send it to the Kenwood D74. Or you can use it for receiving on the reverse engineering end. So this cute little black radio on the left that's like a bit thicker but almost as small as my watch. You can buy these online from China and they arrive. And they just call them walkie talkies. And they don't tell you what frequencies they use and they're not externally programmable. But it would be really handy to know what frequency it's on because if no one else is using it, maybe that would be cool for you. Or maybe you want to move it over. So the watch in the middle is running a frequency counter application that tells me that the transmitting frequency is 450 megahertz. And the Kenwood on the right has found that it's actually 450.05 megahertz. This is really close. We're off by 50 kilohertz. And all the time of trying to guess what the frequency would be, of having to set up a waterfall on a software defined radio. All of that can be skipped. Just don't. All I can do is just put this one in my pocket. Just by asking the wristwatch what frequency the transmitter next to it is running. I used this at B-Sides Knoxville in order to figure out what the frequency of the two-way radios they were using was. So then I could call the staff on their own radios having reverse engineered their frequencies without using a desktop or software-defined radio or laptop or anything heavy. The only tools that I used to reverse engineering this were my watch and my handheld. You can also hit other items. So like this is a doorbell that I've reverse engineered to be remote controlled by my wristwatch. And I can be sitting on the couch at home and just reach over and knock the thing off and it ding-dongs, you know. So many things that can be done with this platform. Once the basic problems of power management and radio access are solved, and all of those have been solved in this project. We have clean C source code that is well commented and well documented. The wiki explains how individual applications were written. The development environment is simple enough that you can now sit down and write a feature in an afternoon. Last Friday I implemented a new feature called radio access. It's a feature that we call the Shabbos mode for this. So you can actually turn off the keypad and the side button and have no buttons that you might accidentally press that would change even a single transistor until the recessed button on the side is pressed to exit the mode. You can reverse engineer radio protocols and port them over. So any on-off keyed 2FSK or 4FSK transmitter or receiver can be re-implemented on this platform. For example, if you want to use radio access, you can use the first and quickly prototyped Python and then re-implemented in stand-alone C. Isn't that nifty? Okay. Code is available on GitHub. The source code is available as well. The third revision of the watch will be arriving on Monday, which adds additional frequencies for the 900 megahertz band and the 300 megahertz band. And have at it. Thank you kindly. This is Ruger. He's a very good dog. Another round for Ruger, please. So I'm finished with plenty of time to spare. Do we have any questions? Yes? Did you order the most BCP already assembled or did you assemble it yourself because when you published the course, I try to assemble it, but there is like I needed the micro scoping . Yeah, yeah. And I still didn't get it, so I've been trying to buy it already. Ok, so I have no plans to manufacture this. But the license allows it. If Sind Studio or anyone want, to manufacture this, they have my blessing. I made this as a hobby project because I thought it would be cool. I really enjoy designing electronics and building them at home, but I do not enjoy dealing with the hassles of manufacturing. If you want me to do that, you really have to pay me. For the, so, but no, there are no preassembled boards available so far. If you can find a student who is good with soldering or has the microscope eyes and steady hands, you might also try, like, fixing equipment problems. Like, if you have brighter lights or if you have a better vise or maybe you need, like, more coffee or less whiskey or those sorts of things. The soldering on this is rather difficult. It is 0201, which is American, not metric. It's not that bad. But it is 2 mils long and 1 mil wide for some of the smaller components. You will need very bright lights and steady hands and solder paste or a flux pen. Do not use lead-free solder. That's a communist conspiracy. All right. Any other questions? Oh, yes. Sorry. The, the software is a little bit different than the hardware. For now, you should just be running everything from the get master. The software is backward compatible with every hardware release. So, it, like, we've not broken hardware compatibility at all yet. The, the new boards that arrive Monday add a better ground plane stitching. So the battery ought to work even as it gets lower. So the, the life will increase. And then the revision after that adds the, the wider radio bands. And that requires a different set of components. Yes? With your typical usage, what battery run times do you get? The question is what battery lifetimes do I get with my typical usage? And the answer is that it varies by what I'm doing and by whether there are any hardware faults. So, for example, I missoldered the resistor in one of my units. And then whenever I send a radio transmission, the radio transmission would be really squeaky quiet. And the battery life would just drop off of a cliff. So, that's, that's, that's, that's, that's, that's the problem. For units which do not have physical faults, I'm getting battery life on the order of, like, two or three years, I think. They're, they no longer die from old age. When I have them die, it's because of a software bug or because I screwed up somewhere. And the software bugs are becoming fewer and further between. So. Great. Thank you kindly. Thank you.