Home » electronics » The Good, the Bad and the Ugly

The Good, the Bad and the Ugly

The next thing I got obsessed with was the keyboard. At first I had planned to get an old keyboard off eBay and reverse engineer it. So I bought an old VT-260 keyboard and removed its circuit board to expose the raw key matrix connections and I spent a fair bit of time with a multimeter working out how that matrix was organized. I got as far as having my own microcontroller reading the keyboard and displaying simple scan codes. But by the time I had done that, I had decided that the keyboard itself was not really what I wanted LEO-1 to have. I wanted something special.

You may recall my admiration of the ICL 2900 series mainframes. Well, the keyboards those things had were absolutely gorgeous and nothing like anything I’ve seen before or since. I wanted LEO-1 to have a keyboard like that, but sadly, not everything is available on eBay. The closest I could come to that would be to make my own keyboard with a similar layout and similar keycaps. So I started reading about custom keyboards and found that there is a whole subculture of people who are really into keyboards. I found a great YouTube channel by this funny bloke who calls himself Chyrosran22 and watched all his videos. After a month or two of this I think I knew more about keyboards than I know about my own mother so it was time to take a step back and regroup.

ICL 2900 keyboard

ICL 2900 keyboard

While looking for keyboards on eBay, I had discovered a cool device called a Rubidium Frequency Standard which piqued my clock-obsession — and so I spent a few months building my own atomic clock! I already have enough clocks in this room and didn’t need another one, but I couldn’t resist. I had lost my way. It seemed that I was just finding excuses to postpone finishing LEO-1 and looking back I can now see that I was terrified that I wouldn’t be able to make it work. If it didn’t work, it would be the biggest waste of time and money and I would look like such an idiot for even attempting something as absurd as trying to build a contraption as complicated as this.

Even so, I had been working on the PCB design for the Memory Board and the Control Board during the autumn and they were pretty much finished. Eventually after obsessively checking it over and over again, I had the Memory Board manufactured and I populated it. My initial tests with switches were promising, but then something terrible happened. In 2015 I had seen a very weird problem when testing the ROMs where the data bus would go into continual oscillation for no apparent reason. I thought I’d solved it with bus termination resistors, but now this problem came back to bite me in the arse once again, this time on my nicely made PCB. I couldn’t understand why all these people out there could build entire CPUs on breadboards with loads of untidy wires and have it all work perfectly, but I couldn’t even get a ROM to work on a neat PCB. At one point I just considered picking the whole thing up and placing it into the trash, but of course that was only a fleeting thought. I tried all kinds of hacks and guesses but really had no idea what was going on. This problem only happened on ROM not on RAM or any of the other devices. I blamed the ROM chips; they must be buggy. I managed to crowbar an old-school EPROM into the socket and would you believe it, the problem happened on those too. I checked the data sheet over and over again and couldn’t see anything that could explain it. Then I realized what I was doing. I was using switches to change the address bus for testing, and I was doing it while the ROM was chip-enabled and also output-enabled. My VDU does that and doesn’t have any trouble, but I wondered what would happen if I followed the process that the real CPU would. The address bus would only change when the ROM was not enabled, and the output-enable would only be on for a moment. Well, when I started testing it like that, the problem went away. I visualized the problem as this: when you change the address, the internal circuitry of the ROM will ‘rattle’ as the device finds the correct cell to output. If the device is output-enabled, this rattling will appear on the data bus as a randomly changing mess lasting some tens of nanoseconds. This is high-frequency business; you don’t want that noise getting onto the data bus in the first place. Possibly, the length and layout of the PCB traces could cause frequencies like that to start an oscillation, and if the changes are ‘evil’ enough, it could create power supply glitches, ground bounce or such, which would upset the ROM, cause it to rattle some more… and around you go, ad infinitum. This is all speculation. The real cause is still somewhat of a mystery, but the important thing was that I found that as long as the rattling doesn’t get onto the data bus, you’re safe. Unfortunately, I also found that this happens if the ROM’s chip-enable and output-enable are asserted at the same moment, and my CPU design actually did that. The only way it would work properly would be if the chip-enable came first, then the output-enable, on a different tick. I was going to have to change the design of the CPU’s sequencer. It was an easy fix, and a lucky catch at the eleventh hour, especially since I had not ordered the PCB yet.

Oscillation

Ugly things on the data bus

 

You may recall that I have a terrible habit of going off at a tangent and ordering things that I hope to be able to use in the future, even when I’m not sure that any of it will work. Well, I had ordered a small thermal receipt printer a month before, so with the memory board working, I decided to try it out. This also enabled me to test the device expansion ports. I hooked up a UART to the memory board and the printer, and manipulated it as a device using the test switches. I was able to manually make the printer print a single character. So this means LEO-1 will almost certainly be able to use that printer too. Finally happy with these results, I decided to press on and finish the control board.

“You’re all clear kid, now let’s blow this thing and go home!” — Han Solo

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s