 All right. So we have programmed our digital board with the counter and now what we need is some sort of Arduino that is 3.3 volts and also has plenty of IO. We need specifically at least, what is it, 11 address lines times 2 is 22 plus 2 command lines plus reset and clock. So that's 26 lines. You're not going to get that in an in an Arduino that runs off of an Atmel chip. So there are chips that do it, boards that do it. This one is a Teen C 3.5. You can get one from SparkFun. It's relatively cheap. I know that we're used to very, very cheap Arduinos, but still for Arduinos with this many IO pins, this is a pretty good price. The 3.5, there's also the 3.6 that you can get. That's a little faster, but it has, I believe, the same number of pins. It's also breadboard compatible, which is nice. It also comes with this neat card, which tells you where all the pins are. So front and back, which is pretty nice. So the other thing that you're going to want is some kind of a display. Now I have an Adafruit display. This is a graphic LCD touchscreen. You can pretty much get anything you want. Again, as long as it is 3.3 volts, because again, the FPGA will only output 3.3 volts and will only accept 3.3 volts. It is not 5 volt compliant. It is not 5 volt tolerant. So everything that you have must be 3.3 volts, otherwise you'll fry your electronics. And who wants that? So the other thing that you're going to want to get is a bunch of jumper wires. So here are the jumper wires that I use. You can find them on eBay. Everybody sells them. They're sometimes called DuPont wires. I have no idea why. It's not like DuPont makes the wires, I guess. And you will want probably an assortment of male to male, male to female, and female to female wires. Because if you do use the specific boards that I'm using, such as the display, you're going to want something that connects to the pins or whatever. In any case, it's good to have a whole assortment. And these are 40 conductors. They're colored. They're color coded, which is nice. They're color coded according to the resistor, to the resistor color code, which is interesting. And you can pull them apart. So you can have as many as you want in one ribbon as long as you only want up to 40. And they do come in different lengths. I've seen 20 centimeters and 30s and 40s. So you're going to want a whole bunch of those. And now, first, the very first thing is to get the TNC working with the LCD. So what you are going to want to do is also download TNC-DUINO, which is the Arduino IDE, along with the TNC drivers, basically, for Arduino. And that will get you going. So let's write a simple program first that can access the LCD and display a hexadecimal number. All right. So having downloaded TNC-DUINO and installed it, I have written a short program which will print the 11-bit number that we get as output from the FPGA. I have not hooked up the FPGA yet. I just want to be sure that I have the display running before I actually hook up the FPGA and do anything with it. So this is adapted from the HX8357 example, the Hello World example. So basically, you set up a chip select and a data slash control line. You can set the reset line to negative one, which will use the Arduino's reset line in order to reset the LCD. Otherwise, you would have to reset the line by pulsing some other digital line. So this is convenient to do. So the next thing that you do is you instantiate one of the HX8357s. You give it the lines that you're using. It will use hardware SPI. So you have to connect this to, you have to connect the LCD to Miso0, Mozi0, and S-Clock0 on the on the teensy. And it will just use the hardware library, the hardware SPI, which is a lot faster than just bit banging. So in the setup, all we do is we tell the LCD to begin, which initializes it. We fill the screen with black. Then we're going to set 11 digital pins to inputs with pull ups. And the reason that we use pull ups instead of not is that right now, again, the pins are not hooked up to the FPGA, which means that if the pins are not connected to either ground or 3.3 volts, they're just left floating, which means that their voltage is indeterminate and they can flip back and forth. An input pull up will cause them to be hooked up via an internal resistor to 3.3 volts. So by default, if they're not connected to anything, they are actually set to one. So this enables me to just hook a wire to ground and start poking at the pins and, you know, making them all grounds, making them all zeros. I set the rotation to one. What this means is that along the X axis is now the wide axis of the LCD, and the Y axis is the short axis of the LCD. So now the screen is wider than it is shorter, wider than it is vertically. Okay, so I set the text color, foreground color to white, and background color to black. Setting the background color to black is important because if you don't, it essentially fills the background of each character with essentially a clear color. So if you had previously put a character in a position and then overwrite it with another character, you would get both characters on top of each other. So what black does is it fills any non-character pixel with black. And then I set the text size to three because it was kind of small. In the loop, basically all I do is I set the cursor to zero, zero, which is the upper left of the screen. And then I've written some routines to get the 11-bit address from the pins on the TNC and print them out. Getting the address is fairly straightforward. You just go through the pins one by one and read them and collect them into a 16-bit data variable and then return that. There are more efficient ways of reading multiple pins. However, they are in general less readable. It can be done. And the unfortunate thing is that typically digital pins on Arduinos are not on the same port. Well, okay. I should say that consecutive pins on an Arduino are usually not on the same port. They're usually spattered all over the place. So you don't really get much of an advantage writing multiple pins on the same port anyway. So to print a 16-bit value is fairly straightforward. You just group them in groups of four bits, which is one hexadecimal digit, and then you print them out. And that's it. So I will put this on GitHub. The link is down in the description. And now let's take a look at the... All right. So here is the TNC and here is the LCD. You can see that it is actually displaying 77F right now. The reason that one of the bits is zero is that I have one of these wires hooked up to ground. This yellow wire right here, you can see that I have... I hope you can see this. I have soldered a header along the middle. That was the only place that the reset signal was available. All the other pins are available around the outside. So if I move the pin around, then maybe you can see that I'm changing the bits. So that works. So what remains to be done is to hook this up to the FPGA and send some commands at it and see what it does. So now that we've validated that the LCD works, we're going to connect the Arduino or the TNC to the FPGA. And the way we're going to do that is we're just going to connect outputs 3, 2, 1, and 0 to reset clock and command. And then we are going to set them up as outputs, set them all to zero, and set up the LCD. And then the first thing we're going to do is reset the counter. So we put reset high, and then we pulse the clock and then put reset low. This is a synchronous reset, not an asynchronous reset. So the reset doesn't actually happen until the positive edge of the clock. And then in our loop, we are going to set the command to zero one, which is the command for increment. Remember it was none, which is zero, increment, which is one, and load, which is two. Then we're just going to wait 10 milliseconds, pulse the clock, 10 milliseconds, pulse it low, and then keep going. Print the address and just go round and round and round and round. So basically, we should just see the counter counting up. And when we apply power, of course, the counter should start at zero. So let's take a look. And I did get these address lines backwards. Of course, if you're reading pin 22, and then you're shoving it all the way out to the high end of the byte, then obviously that is the high end of the address. So that's just a quick correction. And here are the lines for command and reset and clock. And this ribbon cable is for reading the address. I didn't connect up the load address. I guess if this works, I don't really want to do any more tests, just for fun, because I just want to see it working. So let's turn it on. And there we go. It's counting. And it did start from zero, as expected. I can turn the power off, turn the power on again. It starts from zero. Excellent. So I think the next thing that we're going to do is probably see about maybe implementing one opcode, just to see what sort of other hardware we're going to need to implement. So until then, bye.