but then wither away -Lao Tzu
Homebrew Z80 computer: Step 1
I've been wanting to build a homebrew computer, start with something "simple" and work my way up. Since I'm already mired in vintage computers I began thinking about 8-bit processors of the past like the MOS 6502 and the Zilog Z80. I’ve seen a number of contemporary projects centered around these chips, and after some research and consideration, I decided to use the Z80. Furthermore, I would only use new parts that can be purchased from mouser.com today.
One of the first milestones I set out for myself was to build up a breadboard and a front panel, reminiscent of an Altair 8800 or IMSAI 8080. I'd consider this a successful test if I could use it to add two numbers. Something to get my feet wet, and show the basic operation of the CPU. I finally hit that mark this week.
The traditional Z80 comes in a 40 pin DIP chip and has 8 data pins, 16 address pins, and other timing/control lines. On my front panel, I basically just connected a switch and LED to all the address and data pins, then LEDs for various outputs, and a switch to trigger a single clock pulse from a monostable 555 timer.
With everything wired up, I was ready to flip switches and run my program to add two numbers. Looking through the Z80's instruction set, I planned out a sequence that loads a number into the accumulator, then adds another number to it. For "output" I decided to use an instruction that loads the contents of the accumulator to some address on no importance.
assembly => hex => binary ld a,n 3E 00111110 02 00000010 add n C6 11000110 03 00000011 ld (bc),a 02 00000010
Of course, to actually use this with my front panel, we need the binary from the actual byte sequence represented by the assembly code (shown above). I can flip switches on and off, representing 1s and 0s, and then step the clock signal to the CPU. In this example we're adding the numbers 2 and 3, just so I can quickly verify that 5 or 00000101 is our desired result.
I'm quite pleased with how this turned out, and plan to add things like memory and a serial interface before moving on to custom PCBs and more complext I/O. For now, you can see my schematics and more photos below or click the image above for video of operation.
Live Action Adventure Games
Samantha's friend and former roommate decided she'd like to go to Huntsville Escape Rooms for her birthday. If you haven't heard of this, Escape Rooms are a recent craze where a small group of people are locked in a room with a series of puzzles and a time limit. The goal is to find clues and solve riddles that will eventually let you unlock the door and "escape". A quick google search suggests that Escape Rooms are soon to be in every major city, and they can vary in theme and scope.
Sam and I arrived first, and waited for the rest of the team. The place was busy on a Saturday night. I could see other teams of people exiting the building, high on success, or resilient in defeat. "We still hadn't found everything before the time ran out. Next time we'll get it!"
Once the rest of our team arrived, we gathered in the lobby. The Huntsville Escape Room's "flight attendant" greeted us jovially and made sure our paperwork was in order. We had purchased tickets online a week in advance, but there was still a matter of signing waivers. Once complete, we were handed off to a room attendant who briefed us on safety, procedures, and the story of our chosen room.
It is perhaps worth noting that we were not truly trapped in this room. Beside the door lock, our ultimate goal, was a green "exit" button. This would allow us out in case of panic or potty breaks. However, if used, that player may be forfeiting the game. Still, I believe it was thoughtful of them to include this. Teams are also monitored by the room attendant through close-circuit cameras. A text display in the room could then give hints or gentle reminders not to actually destroy the room.
Our chosen puzzle/room was named “Psych Ward”. I overheard other patrons say it had a low success rate, assumably because of a more difficult set of problems. The story itself was about a mad scientist who is held in a psych-ward but makes plans to unleash biological weapons on the town. We are to discover his dastardly plans and escape the room. Unfortunately, this story was lost in the puzzles. Some items stayed with the theme: crazy scrawlings on the wall, empty pill bottles, and circled passages in psychology text books. But who exactly let this patient have some of the more esoteric devices? Why are we puzzling our way out of this room while the presumed hospital staff are now ignoring and obstructing a team of investigators?
The puzzles we faced were not terribly difficult. Some seamed ripped straight from the first chapter of a Mensa Mighty Mind Benders book. If you've played adventure games like Myst, 7th Guest, or Dr. Brain, then you may already know what to expect. I do feel we saw a good balance between math problems, word problems, and spacial problems. People with those individual skills can handle their puzzles with easy.
To be fair, we did see a few hints from the aforementioned room-attendant. I still didn't see any puzzle we couldn't handle, and our hints often reinforced what steps we were already taking. I'm told that teams can request to not receive any hints. But without knowing what to expect, it may help keep things enjoyable for your first time.
I think the biggest challenge of this Escape Room was just time management. They threw a large number of puzzles at us in a limited time. I feel good about our team's performance in that regard as well. We escaped the room with 8 minutes to spare. Second to time-management, may be team-management. No fighting for leadership. No sticking all 6 players on a single puzzle. We all understood the game, and spread out to work in 2's or 3's.
Overall I'd say my first Escape Room was mearly good, not great. It was entertaining. I'm glad to have tried it. But it was also kind of expensive, and doesn't feel like it would have any replayability. That may be the biggest challenge for the Escape Rooms businesses themselves. Turning out new content, changing up puzzles, and keeping people interested in the fad for as long as they can.
Update: A week after my mediocre experience with the escape room, I believe I have in fact been bitten by the bug. I daydream about the next challenge. What nearby city might offer bigger rooms, deeper stories, and who of my friends I can convince to go with me.
Building a Novena Computer
My friend Shapr bought himself a Novena computer. The Novena is a monumental project from the venerable Bunnie Huang. A well known hardware hacker who, like many of us, wanted to build his own laptop computer. Bunnie's computer would go a step further by being as open source as possible.
The design was completed and put up for order on the site crowdsupply.com back in 2014. crowdsupply.com is kind of like kickstarter, but focused on mostly finished projects that just need their first bulk order and fulfillment met. Still a bit of a wait for folks who order their products. Shapr finally received his early 2015.
I happened to be at Makers Local 256 the night that Shapr was unpacking and setting up his shiny new Novena. So he enlisted my help with actually swapping out the faceplate, mounting the LCD, and screwing all the screws. It's a really fun an flexible design. The "laptop" reminds me more of old luggables. It's designed to sit on a table in front of you. The screen pops up, revealing the beautiful electronics inside. The main board only fits one way, but everything else utilies a grid of mounting points. Everything about the Novena screams open, open, open.
Big thanks to Shapr for letting me experience his Novena. I would definitely want one of these in my own collection.
New DFM! Same great taste!
The "Sound Producing Amplifier Module" or "S.P.A.M." is hitting that point in it's life cycle where I can't really dedicate enough time to fufil orders, and still solder them all by hand. A good problem, to be sure. So as we hop from revision 5 straight to revision 7, I'm looking towards Designing For Manufacture. In the case of this amp, that means moving to mostly surface mount components.
I was mildly nervous that different tolerances and characteristics of surface mount components would affect the performance of the amplifier. Looking back, this is a silly thought. I made careful selection of components with all the same values. So despite the packaging, nothing really changed. Still, I felt it worth comparing the new prototype with the old rev.
I put put both amps on the bench, and hooked up an HP-35660a dynamic signal analyzer. There is about a 5db change in response from 64Hz to 1000Hz. Above 1000Hz the test goes a bit crazy, but all still within 10db. As you can see from the photos, the two amplifiers perform almost identically. I'm not really sure why I expected to see any difference, but I feel good to have gone through the effort.
Rediscovering an old C.U.G.
30 years ago today, The Terminator was #1 in the box office, Debi Nicolle Johnson graced the cover of playboy magazine, and Vol.2 No.8 of “Eight by Eight” newsletter was published for the members of the North Alabama TI-99 Computer Users Group
Fast forward a few decades. After this year's retro gaming and computing night, I had a TI-99/4a and assorted peripherals donated to my collection. As I dug through the boxes, what I was most impressed with finding were documents. Next to software disks, the original documents and writings for these old computers are to be coveted. Some previous owner of this computer had put the original users manual into a three ring binder. Nestled in that binder with the manual, were 2 years worth of xeroxed, stapled, and mailed newsletters for a local Computer Users Group.
User groups were and are a great way to disseminate knowledge. Sure, your computer probably came with a manual, but those barely scratch the surface. Computers books weren't as readily available at your local library. Reaching out to others, with a shared interest, was a great way to learn the ins and outs of your own machine, as well as get reviews and demos of what other hardware or software was available. People would even write in the newsletter that there seemed to be a “TI information void” before finding this user group. To this day, user groups are a fantastic way to learn about specific systems and/or softwares.
This now 30 year old newsletter follows the same general format found in the other 2 years of newsletters reviewed. It opens with general club reports from the Editor, President and various Committee chairs. Of particular note, this issue has a great guide on how to add a second floppy disk drive to the TI-Peripheral Expansion Unit, often refereed to as the “p-box.” This unit came with space for one drive, but many drive controller cards could support 2 drives. This required some hacking of the case and the power supply, to allow for the second drive.
Also of note, is the news that a major TI-99/4a peripheral manufacturer was filing for bankruptcy. Looking back from where we are now, it should be hardly surprising, as the Computer system it self was released 6 years prior, and discontinued by TI 2 years before this publication. Which brings me to my next point.
The whole arch of these newsletters (at least Vol 2 and 3, that I have) becomes all the more interesting when we frame them with the fact that the TI-99/4a had already been discontinued, and many newer and more robust home computers were taking it's place. In February of 1985, one member even writes, thanking TI for getting out of the home computer market. Citing that the TI-99/4a and it's peripherals were now cheaper, and other companies seemed freer to create 3rd party software and hardware. It would seem to be true then, that the hay-day of the little TI-99/4a would come in this time after TI's official support.
Subsequent newsletters are full of tips and reviews of products that could expand your computer's memory, improve performance of core components, and squeeze every last bit out of your code. However, even with all this great information and software available, we can see the tone of the newsletters decline. Pleas for participation become more urgent and promises are made, of better things to come. On the one hand, it is claimed many times that the turn out from the North Alabama 99er's exceeds that of other user groups in the area. However, as 1985 becomes 1986, we see a lot more events that involve either other TI-99 user groups from other areas, or user groups for whole other systems. It is never really said, but I imagine that this kind of “mixing” became more important, just to keep interest going.
I feel this is all the more obvious when a bit of googling found me 3 more volumes, from just two months after my last hard-copy newsletter. It seemed like the club had imploded. First, Wanda was no longer editor, Then the same woman who had stepped in as editor, helped fill the role of president. Entire committees were no longer mentioned, and others seemed to be doing double-duty. The actual colapse of the group is only speculation on my part. But the evidence of drama was clear, and many members may have finally lost interest and/or upgraded away from their venerable TI-99/4a.
I will say that, upon finding this kind of treasure, I was thrilled by the fount of knowledge present. The people and the drama were of little interest to me. However, as I read and studied more of these newsletters, it is the human side of things that I find requires more rumination. To see people drawn together into a community based on shared interest, is something humans have done before, and are still doing. So while preserving the machines themselves is a fun technical problem. I would say that it is also the words and ideas, expressed by these early computer hackers, that are to be coveted.
You never forget your first
Or do you?
I have very strong memories of my first personal computer. I was about 6 years old and it was an Ericsson PC. This was an IBM-XT clone with an Intel 8088 processor and an amber screen. First, it was in the family office, and later in my room when my dad got something newer. First learning how to use a computer was such a formative experience in my life that I knew I would never forget it.
However, as I get older and I find myself talking with younger computer geeks, I feel like I have noticed a trend; the question, "What was your first computer?" often eludes younger people. Young people with a passion for computers. Young people working in Information Technology jobs. More often than not, they have a vague memory of their first computer. "Some beige-box" or "It was a Dell something or other." are answers I've heard, while performing my very amateur study. So what's going on here? Is their ability to remember getting worse? Is their first experience with a computer truly less magical? Is it just kids these days!?
Well, I discussed this phenomenon with colleagues, and have found a few good ways to explain the trend I'm seeing. To start, I do think people who got their first personal computer in the early to mid 80's have a lot less to remember. There were fewer options and fewer models. So you could tell me that your first computer was a TI-99/4A and I'll know exactly the computer your talking about. But just telling me that you owned a Dell in the late 90's, doesn't tell me much about what hardware was in it, or what software it was running. And it would be a bit unreasonable of me to expect you to remember some esoteric model number, etc.
The other point I'm willing to concede is that the Personal Computer had become increasingly more common in the home all through the 90's. People born in 1990 or later have a much better chance of growing up with a computer already in the home. They were barely cognizant when they truly first saw a computer. So even if they fell in love with computing later, they are unable to recall all the details of the first. You could ask folks in my own generation to try and recall their first color TV, and you'd get a similar response; even though the color TV was just as transformative an addition to the home for the generation before.
So while I might feel shocked when younger computer geeks don't have magical memories of their first computer, I can understand the reasons. Memory from early childhood is frequently fragile, the Personal Computer has become nearly ubiquitous, and available models and options continue to increase every year. Not remembering their first computer doesn't negate their love of computers, it just shows their age, in a way. It's worth pointing out that there will even still be outliers to this, who DO have some great stories of their first computer.
Playing for the first gate
A recent addition to my computer collection is a Tandy Color Computer. It also came with a copy of the notable Dungeons of Daggorath. This game featured prominently in a book that Samantha and I both love. So I toted it all over to her place so we could play it for Date-Night.
Dungeons of Daggorath, released in 1982, is an RPG that features a first person view and real-time fighting system. The player is charged with the dispatching of an evil wizard while navigating a maze and fighting other enemies. Input is given with typed commands like "Turn Left", "Pull Right Sword", and "Attack Right." These can be abbreviated as "P R SW" or "A R" (learning this instantly doubled my survival time.)
As mentioned above, this game and system were featured in the book Ready Player One by Ernest Cline. In the story, the main character must win this game to open the first of three gates, marking a players progress through a bigger contest. winning the game is of course no small feat, and With my few short hours of play, I have a new found respect for anyone completing such a challenging game.
Not invented here
Two big questions to ask as you begin any journey are: "Where do you want to be?" and "How are you going to get there." Before even starting a project, it's good to know what it's going to look like when you're finished, and what tools are you going to use make it. I have a vision of what I want my web site to look like, but a daunting number of tools to choose from.
Wordpress, Twitter Bootstrap, Django, 960 Grid, Wikimedia, just to name a few. They all would give me a powerful set of tools and features. If I use one of these frameworks, and bend it to my will, I can claim some flexibility and proficiency in learning to use a new tool.
However, even though many of these frameworks are, in some ways, just a collection of pre-made CSS and Java Scripts, it still has it's own conventions. A language of their own. Many of these frameworks are like this. "oh great, ANOTHER thing to learn before doing this." It's also easy to see some frameworks as rather bloated for my little blog, if I'm not using half the features.
If I re-invent the wheel, I'm being "stubborn", or maybe even projecting that I "don't play well with others." However, I also show that I am able to build a wheel. I like to learn and explore systems back to first principles. I've enjoyed learning bits of Latin and German, and seeing how they apply to the English that I speak. Some people overlook it, but I think that a high-level programmer should understand at least some of the Assembly code underlying their computer systems. In this way, I'm already eagerly teaching myself HTML5, CSS3, MySql, and PHP for building and serving web sites.
I'm still a bit undecided on this subject. Perhaps the best part about running this site myself, is I can change my mind later. Tao Ex Machina went live (as it were) with just some static HTML and CSS. I'm currently expeimenting with providing some back-end features with PHP. In another year, who can say?
Adventures in CSS and reactive design
CSS is supposed to make coding web pages easier and more flexible.
But sometimes it behaves in unexpected ways.
When starting this page, I wanted to practice more contemporary web design. More HTML5 and CSS3 with less tables and dancing gifs. I Looked at some examples, and settled on a site that follows 960-width design on a large screen, but still adapts to mobile devices and everything between.
Many design sites stated that all I would need is a
float:left; and a handful of
div containers. But things seemed to slide around the page without rhyme or reason. A floated image would leave the bounds of it's own div. Text slides up under it. Then the browser just sits there and laughs at you when you want to center something horizontally AND vertically.
However, perseverance is rewarding. I read more documents. Looked at more examples. Tried 50 different things. Asked a few friends, and finally find a solution. This hinged on giving the #logo and #title
display:inline-block; and the containing div geting
overflow:auto;. Now both elements in my title-bar behave partly as an inline element and partly as a block element. They will sit next to each other vertically, but also drop a line if there isn't room for the element. And as long as the wrapper around those elements doesn't have a defined height or width, setting
overflow:auto; seems to let it adjust to the height and margins of the containing elements.
Trying to center the title didn't help either. Here I did make a couple concession. Fist, setting BOTH the #logo and the #title to
vertical-align:middle; seems an easy enough way to vertically center both elements together. The image is basically setting the bar for the text. But I could never get the title to exactly center itself horizontally while the logo sat there on the left. SO what you see is really just a trick of margins. setting the left side to a relative value. (14% looked good enough to me.)
Lastly, actually adjusting the horizontal center of the logo and the title when on something like a mobile device is really just a trick of the code. Defining some alternate CSS based on the browser width. CSS has a built in function for this that I used:
@media screen and (max-width: 600px) The CSS tags defined after this only apply if the browser is LESS than 600px. (This value works well on my DROID 4, but might need to be adjusted for iPhone4S and newer) The only CSS attributes defined differently in this block are:
margin-left:auto; margin-right:auto; for both my logo and title elements.
Et voilà, My page adjusts just how I felt it should Thanks for the tips: Barbra, David, Jesse, and Charlotte.