 Greetings, Risk 5 friends. Yes, finally it's another Risk 5 video. I have finally received in the mail all the parts that I need to continue. Well, it depends on your definition of continue. You see, I'm still working on the register card. Now, I said register card singular. The original idea was that I was going to have 32 register cards, one card for each register, and I would have a large backplane, and that's why I sort of did some yak shaving with my termination videos. So, what I've decided to do instead is go with a single card, and I'm not really going with an FPGA. No, this is actually a RAM. I'm building a Risk 5 processor, not on an FPGA. So, let me explain what's going on. So, here is a very, very simplified block diagram of the registers in the Risk 5 processor. It's essentially a register file, which just means it's a bunch of registers that can be addressed. And we have a destination address and a source 1 address and a source 2 address. The destination writes to the register file and source 1 and source 2 read from the register file simultaneously, effectively. So, what this actually means is that this is like a 3-port RAM, and if I add the display in, this is actually a 4-port RAM. Now, we've only got one writer and three readers, so this is actually fairly simple. And all a multi-port RAM means is that you can read and write simultaneously to different addresses. The more ports, the more addresses you can read and write simultaneously. Now, they do make a 4-port RAM chip. Of course, I don't need nearly that many registers. I only need 32 registers, not 4K of them. And this is only by 8, and our registers are by 32. Nevertheless, I could use this. So, here is an internal diagram of the chip, and you can basically see that the memory array is over here, and then you've got one, two, three, well, three, four ports. The problem is that when I went to Digikey to buy these, they didn't have enough. The other problem is that this is a 5-volt chip, and my entire system is 3.3 volts. So, instead of that, I decided to go with these dual-port RAMs. Now, dual-port is not quad-port. Nevertheless, I can combine them in order to effectively make a quad-port RAM. The reason I can do that is that I can split this into two, and I can write to both registers, or I can write to both copies of the register. And then one copy could be, say, for source one, and the other copy could be for source two. And then, of course, I could have a third copy for a display. Now, my idea was that I would have, first of all, because these are by 16s, I would have to have two to make them by 32. So, this is one copy, and this is a second copy, and you can see on the other side, I've also got one copy and the second copy of the data. So, I can write to both copies, and then they're a source one and they're a source two. And I can have a second card that's just for the display. Now, here's a block diagram of the dual-port memory. So, there's the memory array, and there's one port over here, and the other port over here. They're pretty much symmetrical. Now, there is some arbitration logic over here, where if you try to write simultaneously to the same address on port one and port two, only one of them will win, and there's some arbitration logic in here to decide that. But I'm never writing on both ports simultaneously. I'm only ever writing on a single port and reading from the other port. So, that's great. Now, the other interesting thing is here. You can see that there is an upper byte and a lower byte. So, you could write only to the upper byte, or read only from the upper byte, and read and write only to the lower byte, or you could do both, which is interesting because some of the risk five instructions want you to only write to the upper byte or the lower byte. And of course, if you've got 32 bits, then you could write any one of the four bytes. Now, the other advantage of using a RAM chip is that the address decoder is already in the RAM chip, so I don't have to decode the destination address or the source address and then route signals to 32 cards. So, this isn't as disintegrated, I guess, as using just plain old buffers and 8-bit and 16-bit registers, but I am using a RAM and RAMs were available, you know, from the 70s and 80s, so I don't think I'm cheating that much. And the other nice thing is that it's only going to be one card or actually two for the display, and it's definitely a lot cheaper in terms of there's only one card or two for the display. These are a little bit expensive, but they are less expensive overall than buying 32 copies of a register. Now, take a look at that footprint. That is a quad flat pack, specifically a thin quad flat pack, TQFP, and it's 100 pins around. Also, the pins are 0.5 millimeters apart, which is just barely within the realm of hand soldering. Nevertheless, I'd have to do four of them. So, instead, I bought these solder stencils, and these are stainless steel, stainless steel or go home, and basically they just fit on top of the printed circuit board. They're very easy to align, and then you just tape it down, and you can squeegee, with this squeegee, some solder paste on, and then you remove this, and then you just put the chips on, and then you put it in a oven, and the chips will sort of self-align. Now, the problem is that this is a double-sided board. So, what do you do? You can't just, you know, paste one side, put the chips on, put it in the oven, and then turn it around, paste the other side, and then put it in the oven because now the one side is going to melt, and you also can't simultaneously, you know, paste one side and paste the other side. So, what I bought is two different temperatures of solder paste, and this is pretty cool because what you do is you take the high-temperature solder paste, and you do one side, and you run it through the oven, then you turn it over, and you use the low-temperature solder paste, and then you put it in the oven using the low-temperature profile, so that it never reaches the high temperature that this side would require to melt. So, you're never actually melting the side that you did. So, this is going to be a new procedure or technique for me, and we'll see how it actually comes out. Okay, so let's get started. I will start on this side, and of course I'm going to be using the high-temperature solder paste. This is the low-temperature solder paste. We can see that the melting point is 138, and for reflow it peaks out at 165, and that is well below the melting point of the high-temperature solder paste, which is 183. So, this gets set aside, and we'll go and use that, and I've got these little L shapes, which will help to align the board, and I've got the stencil, and I've actually got two stencils. One is designated front or top, and the other is the bottom. I think this is the top. Nope, it's not the top. This is actually the bottom. Not that it really matters, and the way that I can tell is that the capacitor placements are actually slightly different. Like, this is wider than this, so that's how I can tell. So, the first thing that I'm going to do is tape down the L's. Just tape one down randomly, and then sort of get everything nice and tight. Tape down the other L pretty much just like that. All right, so that's not going to move. Now, I've got my stencil, and I'm just going to tape one side, and now I get to align this, looking at the pads through the essentially what's a great. So, if you move the grate a little bit, the pads will become misaligned, and you can easily tell. So, this is how you can easily tell that my stencil is now perfectly aligned. So, the next thing that I'm going to do is grab some paste, and let's see. We have, this is the needle. It's funny that they only supply one needle. You usually need a hell of a lot more, and this is the plunger. Just goes in just like that. This is the cap. Put the needle on, and then we will just squeeze a line on the stencil. Not a whole lot. I may in fact need a little more. Better to have a little more than not enough. You really want to do this in one go. I think that's probably sufficient. Okay, and does this cap fit on here? Not really, but okay. Well, all right. So, I'll leave that there, and then I have a spreader, and basically the idea is that you want to go at something like a little less than a 45 degree angle, and then you just want to spread the solder paste in an even way. Without pushing too hard, hard is okay, because what you don't want is the solder paste to squeeze underneath the stencil, but as long as you're applying constant pressure across the entire spreader, hopefully the stencil won't lift up. So, let's see if I can do this. Unfortunately, now I'm doing this left-handed, which is really not great. So, I'm just going to reach over and do this with my right hand. I can tell that this isn't probably not working very well. Well, maybe it does. So, now what I'm going to do is I'm going to go again from the very beginning. I have a little too much solder paste on there. So, I, this is about the fourth try, so I think I'm just going to live with it and hope that I don't have to use the soldering, the desoldering braid too much on that. Well, those are all the components on the front side, or the bottom side put on. Well, it's out of the oven, and you can probably see on the right side here that something's going on. The rest looks okay. And if we look at it here under the microscope, we can see that that right side definitely has too much solder on it. So, hopefully I can just run a bit of desoldering braid on it. And this is the other side that I thought I did pretty well. All in all, it's a pretty bad showing, I think. And I heard one tip from EEV blog that basically says, now if you look at the solder mask, you can see that it goes around the pad. And what they actually suggested is to pull that in slightly so that it might even overlap the pad a little bit. And that might help with the solder staying within the pads. Okay, well, I hit things with the desoldering braid and touch things a little up with some solder. And for the most part, it came out okay. The only thing that might be a little odd is it's really hard to see. But if you look over here, the fact that this pad is shiny means that there's no solder whatsoever over here. And I did push at this pin, and it does seem to be firmly affixed to the pad. I push gently. So all of these pads do appear to be electrically connected. And I did, you know, spot check a few of them to make sure that the pin was connected to the pad. And everything seemed to be okay. So despite the fact that there's not a lot of solder here, I think enough got between the pin and the pad. And here is my test circuit. So I have the card put into this slot, which is just a breakout board. And I have source one address to zero, source two address is zero destination address is also zero. I also have those byte low and byte high controls to zero. So all the bytes should be enabled. And I have the output for source one and the output for source two enabled. I also have LEDs on one of the bits. This is just bit 15 for source one and source two. And I am able to write bit 15 through the destination. And currently I have the destination right control line set to one, which means we're not going to write anything. We're just going to read whatever is in the RAM at address zero bit 15. And I've got the power ready to go. And really what I want to do is just first of all, turn on the power and see if the magic smoke comes out because if it does, then I'm just going to have to find out what I did wrong and re spin the board, which is always a pain. I have one capacitor, one large bulk capacitor for the power supply. There are of course individual capacitors next to each chip on the board. So here goes. Let's turn on the power and we've got zero. That means that I screwed it all up. Or did I? Full power requires about 160 milliamps, which makes sense because these are SRAMs. Now let me just touch the SRAM to see how hot it's getting. It's not getting hot at all, which is a good thing. I do sense some mild heating, but as long as it's not burning, I think the magic smoke is fine. So yes, this is SRAM. There's a lot of bits in here and it does take quite a lot of current to run it. In fact, if we take a look at the current, we can see that the dynamic operating current, this is when the chips are all selected, which is what I have, is typically something like 150, 140, 130 milliamps. So this is well within range. So I'm looking at the LEDs and they are not lit. So what I'm going to do is I'm going to write, or at least attempt to write, a one bit by strobing the right line low. All right. So one of the LEDs went on and the other one did not. So that's interesting. Let me attempt to write a zero bit. So let me strobe right. Okay. So the LED remained lit, which means that there's something wrong in my wiring. Now on the schematic and on the board, this half is the lower 16 bits and this half is the upper 16 bits. So really all I was testing was this half. So assuming that maybe there's something wrong with this half and assuming I didn't screw up the wiring globally, let's test this half by testing one of the bits there. So I'm going to turn on the power. Okay. Now it looks like both LEDs are lit. So what I'm going to attempt to do is write a zero. Okay. See that worked. Both LEDs went out and let me go ahead and write a one and that worked. Both LEDs are lit again. Now I also have the read enable. So if I change this to low, that LED goes out because now I've disabled the output. This is the output. There we go. So now we've got this output. Great. All right. Let me again write a zero just for fun. Okay. That worked. So we know that one half is okay. It's likely that the other half is okay, but maybe there, you know, maybe one of the pins that I thought was soldered actually isn't soldered. Okay. Well, this was the chip that I determined wasn't working or that I speculated wasn't working. So I actually desoldered it and put in a new one. And this time, of course, I drag soldered everything and I tested each and every connection. And luckily, my multimeter probes are small enough that I could just touch every pin. And I did actually notice that even after drag soldering, that some of the pins were just not soldered. They were sort of sitting up above the printed circuit board. So maybe, you know, the solder just didn't wick in. So I did multiple rounds of testing and I've determined that all the connections now on the chip, this particular chip are good. And then for good measure, I went around and looked at all of the other chips and they also seemed to be okay. So let's go ahead and put this in the tester and see if I can finally write that bit over there. So turning it on and this LED is actually lit. So what I'm going to do is write a zero bit. Okay, excellent. And write a one bit. And okay, unfortunately, this bit died again. Well, okay, I don't know what happened. Maybe I'm just looking at the LED from the wrong angle, but it is definitely lit. And if I write a zero, they're both definitely not lit. And then if I write a one again, they are both definitely lit. So, you know, it's entirely possible that maybe this LED is a little flaky or maybe it's just, you know, a little bit off because there's very little current going through these LEDs. So anyway, that does seem to work. I think what I'll do is I'll switch one bit. I'll just choose a random bit. Right now I'm at bit zero, I believe. So I'm just going to choose bit one. So I'll move these three connections up one bit and we'll see if that works. Okay, I have moved the three bits up one position and let's take a look. Okay, right now we're reading a zero. So I will write a one and that works and I will write a zero and that also works. So at least that bit works. Now, of course, what I would want to do is test all 32 bits and all 32 addresses. But to do that, I'm going to need a lot more pins, a lot more wires, a lot more jumpers and a device that can actually stimulate this and receive all the bits. So how many bits do I need? Well, first of all, just for the addresses, I'm going to need five for the source one, source two and destination. So that's already 15 outputs to the card. I'm also going to need all 32 destination bits. So that's a 32 extra going in. So what are we at now? 47. I will also need the control line to write. So that's already 38. It would be nice to test the output enables, but I'll just keep them enabled. So we're still at 38. Now, receive, I'm going to receive 32 bits from source one, 32 bits from source two. So that's 64. Now I'm not counting the low and high byte control lines at this point. I'm just going to keep them low and test all of the bits. So we've got, what did I say? 38 going in and 64 coming out. That's something like on the order of 100. Now, of course, I don't have any test boards that can input or output 100 bits. I'm waiting for an FPGA board to come in that I could probably write something fairly simple that simply outputs a bit at one clock and reads the bits in during another clock. And then just does that. So all we're doing is we're collecting 32 maybe on one PGA, FPGA 32 on another one. And hopefully I can test it that way. But for now, this kind of seems like it's working at least one bit at a time. So until next time, I'll see you. Bye bye.