Monday, October 29, 2012

Convert your TRS-80 Color Computer MC-10 into something slightly better - with a Raspberry Pi

A friend and former colleague of mine recently dropped off a shiny new Raspberry Pi off to my desk. He had bought one for himself as well. Neither one of us had any idea of what to do with the thing. But I have always wanted to gut a classic piece of computing and stuff a new PC into the shell. This was a good opportunity to make use of a Color Computer MC-10 that's been in my basement for the past 10+ years.


The MC-10 was an attempt on the part of the Tandy Corporation (you know, the Radio Shack people) to compete with the success that was had by some other vendors who were cranking out cheaper and smaller computers like the (much more popular) Timex Sinclair. It was truly a worthless piece of shit. It shipped with 4K of RAM (16K was available as an expensive add-on accessory). It lacked a cartridge slot. So never mind playing "Dungeons of Daggerath" or plugging in a modem pack ... or a disk drive ... you get the idea. But in the late 80's and early 90's I was a kid attending an otherwise completely adult "Color Computer Club" where you could pop in monthly and hang out with some of the nerdiest and most socially awkward people you have ever had the displeasure of knowing. One of them owned one of these, and I envied it greatly.


When I found one in the box, with the power pack, booklet, and TV/Game switch, I had to buy it. And the price was right. Good Will charged me only $5.99 for what had previously sold for $119.95. So I bought it. Threw it into a pile in my basement, and forgot about it. Until now! I knew that once I got started, this poor thing would never be the same. Before I took a screwdriver to it, I hooked it up to a TV and showed my kids how a real man writes BASIC.

10 PRINT "DAD IS AWESOME";
20 GOTO 10
RUN

The kids were unimpressed. My son had the nerve to ask what else it could do. Kids these days. At that point, I split the case (voiding the warranty, I know). And here is what I found.


This thing was incredibly roomy inside. Or at least it would be with the circuit board removed. I laid my Raspberry Pi on the table to size things up. Looked possible. Next, I took a long look at the keyboard. Yeah, that's right, I wanted the keyboard to ACTUALLY WORK with my Pi.

I knew that this would be the toughest part of the job since I would be trying to recreate the functionality of a keyboard controller using GPIO pins on the Pi ... or something. I was hoping that the keyboard would be nothing more than a matrix keypad (regular old buttons in a columns and rows layout). The backing to the keyboard was a thick cardboard padding that could be removed with a couple of screws. I pulled it apart to expose the circuit traces.


Looked like a damned mess! I did some Googling and found that someone else had done a TRS-80 Model 100 Raspberry Pi conversion not too long ago. He had used a Teensy USB development board to turn a Matrix keypad into a USB keyboard. And it didn't look all that difficult. So I ordered a Teensy 2.0 (not the ++ model, just the regular $19 version).

While waiting for that to arrive, I pressed on. I had couple obstacles to tackle if I wanted this thing to actually be a USEFUL device. Namely, I needed to power this device - while providing additional USB ports. Oddly enough it looked like I could get away with powering the Pi from a USB hub ... while at the same time linking the Pi to the hub to provide additional ports. Here is what that scene looked like on my desk.


You will also see from that above picture that I was experimenting with how I would "map my ports" from the Pi to the MC-10 case. I have no intention of soldering to or otherwise bringing harm to my Pi. So any modifications would have to be done to my franken-MC-10. I started with extending the network by making a very short male to female cable and then glued the female end into the case. To give it some 'stature' I glued a small wooden block underneath of it. That also raised it to the correct height.

Once I knew that would work I got right to work at stripping away the plastic from the USB hub and giving it a home in the MC-10. It fit surprisingly well! Naturally there was nowhere for the ports to poke out of the back of the MC-10 so there was some Dremel work that had to be done. I suck at using rotary tools, so please excuse the crude cut-around work in these pictures. Also, the fun was cut short when my boss came back to my desk and said "what are you doing?? stop it!! that's loud ... and annoying!!".


I didn't want a bunch of cables running inside and outside of the case, which meant that I would have to make some modifications to the USB hub itself. Not a big deal really. I cut up an old USB A/B cable, and a micro-USB cable. I removed one of the USB ports from the hub with a desoldering wick and then hard-wired a micro-USB stump into it's place. This would power my Pi. I also soldered down a standard USB connector to make the bridge between the "B" port of the hub to the Pi. This actually makes the hub light up and become an additional three ports (originally four, but you know, one of those was pulled).


Being the master hardware modifier that I am (not) you can see that I used stacks of double-sided foam tape to lift the USB hub to the right height and to hold it down into my case. Here it is nicely mounted and connected into the case. Note that I later came along with hot glue and glued down some spots around the sides of the hub where you would be applying pressure when inserting a jump drive or something.


Another nice feature of using the USB hub is that it had a "self / bus" switch. This means you can use it like a powered hub with a power cable, or a non-powered without the cable. For my purposes it works like an on/off switch for my Pi! Neat! I could extend that switch to the side of the case? Nah.

A few days layer my Teensy USB arrived in the mail. The shipping was fast! I went right to work trying to get the keyboard working. And then spent the next couple of ... days ... figuring out what the hell I was doing. Step #1 was to connect the Teensy to a breadboard. The thick clear ribbon cable could then be aligned to pins really easily by just pushing them into the breadboard.


And then using the sample "Keypad.h" code that is readily available, I was able to start making keys do something!! But what was a column - and what was a row? I took a guess. Got it wrong. No problem, just reverse the pins I was using for each. But not all pins seemed to actually work. And after hours of non-progress I started researching.

 Unfortunately the MC-10 was never liked enough to be repaired. I imagine if it ever 'went bad' you simply threw it away instead of sending it off for an overpriced repair. Hell, I sent off a Color Computer 3 once for repair. It took two weeks and $80 to make it run again. At a cost of $119.95 for a new one ... well you get the idea. Being that there was no repair manual, I didn't have any technical reference guides to refer to.

I couldn't imagine that the keyboard for the MC-10 would be mapped like a standard Color Computer 2 or 3. This was a completely different sized keyboard, with LESS keys on it. But ... perhaps it would give me a start? So I tracked down a TRS-80 Technical Reference Manual on archive.org and drilled down to the keyboard schematic.

Would you believe that the key layout is nearly identical?


Over the next few days I used the Arduino development software - paired with the Teensy loader to write out a USB Keyboard routine using the above schematic as a rough reference for what letters and numbers fell into which columns and rows. The amazing thing about the layout is that it would have been FAR easier to create a schematic where "QWERTY" started off the first row, instead of "ABCDE". In other words, it's an alphabetical matrix ... with a wild run of paths around a printed circuit board to make it all work. Pretty neat.

I am sharing my code via PasteBin: http://pastebin.com/79gSmXy0

And for fun, here is a crappy screenshot from when I was demonstrating an early version of my code.


This is by no means a USEFUL keyboard. Still, I was impressed at how well it functions. I had a hard time getting multiple key presses to work (lot's of forum posts on this topic) ... and defining modifier keys was awkward. I have found some other efforts out on the web which handled this far more gracefully than I did.

Example: To make a capital letter, you would press the shift key once, and then press the letter. It works like a toggle key of sorts. But you also probably want a tab key. And a backspace key. And you know ... normal stuff like that. So hey, the keyboard is a work in progress. If I were to sit down and use this damned thing for more than 10 minutes ... I would probably plug in a REAL keyboard.

To finish things up ...

I removed the breadboard and did a hack soldering job to make the Teensy rig a little more permanent.  Although I did use a IC socket to solder to so that I could have my Teensy back for another project if I ever wanted to yank it out.

I remapped the composite video port to the lid of the case (the MC-10 had defined it as 'TO TV' and this still holds true).  And hey - I don't need that pesky TV/Game switch any more!

I installed a small internal speaker with an old audio cable, and what had been some cute little collectable character from Radio Shack that doubled as an external speaker.  He was on clearance for around four bucks.  I gave him a quick and painless death.

Some hot glue.  A couple strips of Velcro.  Oh, and an Airlink 101 ($11 from Amazon).  Boom!  It's complete!


Let me tell you, it's a tight squeeze, but this all fits back together very neatly, and without any of my parts rubbing together to cause me any trouble.

Now that I had my dream MC-10 ... what would I do with it?

I tried using the standard Debian Wheezy build from the Raspberry Pi site but I had some serious problems getting my Teensy keyboard to work correctly.  And yet when running any other distribution ... I didn't have any problems.  So I resorted to running the Arch distro for the Pi.

Once the OS was installed ... I added dosbox, and .... Kings Quest Part I.  Ah, here is something that my MC-10 could never do!  Run games for the Color Computer 3 with a 512k upgrade installed!  And yes, these games are the reason that I remapped the awkwardly placed arrow keys on my MC-10 keyboard.


Now I just need my mom to come stand behind me and ask "is your homework all done?" and it will be just like the good old days.

Thursday, December 29, 2011

I STILL BLOG.

It's been ages, and I mean ages since I have blogged anything. Mostly because I have nothing to share that anyone would want to read. I have somehow managed to fill my days and nights cooking, cleaning, doing home improvement projects, and sleeping. As for spare time at work - I don't have any. I am too busy working. But as I am wrapping up work orders that I have had for months and my phone is not ringing, I am feeling a slight sigh of relief.

I suppose I could work on my Android projects, but they aren't really making me much money any more, and I have for the most part abandoned them. I had high hopes that PVault would do better in the MiKandi market. But after a few attempts to revitalize and update the app, I am not really seeing any reward from it. Some of the worst apps I have ever made still bring me the most money. And for the record, we are talking about a few cents a day. ;-)

I have been looking into streaming media players to replace my Wii as my primary Netflix device and it looks like I will probably be buying a Roku sometime soon. Yesterday I noticed that they have a development kit and it got me excited about the possibilities for building my own "channels" for streaming content. But I'm not sure I have the desire to run out and learn an entirely new language so that I can pay someone to stream my content to the masses - and then wonder if advertisers are ever going to pay me.

So hey, Ray is still alive and well. And he may (or may not) be thinking of new things to do with this site to justify the hosting fees.

Wednesday, November 24, 2010

Google Market Account Banned (Happy Thanksgiving)

Well, congratulations to all of you assholes who went through the trouble of downloading my applications only to flag them, and/or leave retarded comments such as "Flagged". I'm not sure why people feel the need to play policemen (or policewomen, or in the case of Cashelle, police-transexual), but consider yourselves a special breed of asshole and take this day to congratulate yourself between your bible readings, hating of gays, and watching recorded episodes of Fox and Friends on your DVR. THIS ... is YOUR day.

By the way ... you are aware that for $25, I can be right back at this? And I can easily make $40 a day in advertising revenue, per application. But hey, enjoy this moment. Because I am going to take some time off to enjoy the holiday and work on some all new and ultra-offensive applications - just to piss you off.

In the new year I will be working on getting some new applications on the MiKandi market (which allows mature content) and I will be restoring all of my old apps there to bring them back to life. Be sure to check out my stuff there.

In related news ... Google now has content ratings to ensure that you are targeting your applications to the right audience. The categories are "All", "Pre-teen", "Teen", and "Mature". That would indicate that you can create applications with mature content, right? Wrong! All the same guidelines apply that applied before. So if your application contains something to do with gambling, it should be rated mature. But only play-gambling. Not real gambling. And if your application deals with adult-ish content, it should be rated mature. Just make sure it has nothing to do with pornography, nudity, or ... anything sexual. Yeah. I don't get it either!

Look for an update here soon folks, and HAPPY THANKSGIVING TO ALL YOU TURKEYS!

Sunday, August 22, 2010

Dr. Zoidberg Soundboard


After creating my Professor soundboard and updating it several times I decided it was time to branch off and attempt to create a new soundboard using my existing design. With that, I created the long awaited Dr. Zoidberg soundboard for Droid phones.

If you are a Zoidberg fan (or even a Futurama fan) you need this on your phone.

Coming soon - Zapp Brannigan!

Saturday, August 07, 2010

Good News Everyone!


I have posted my first application to the Android Marketplace. The "Ultimate Professor Farnsworth Soundboard". I have spent countless hours pouring through Futurama episodes these past two days and then had to figure out how to package them up. You actually have to pay to publish apps to the Google Market and so I am asking for a very nominal fee of $.99 for it to recoup my 'investment'.

I actually still have a lot of episodes to go through so I plan on updating this one as well as putting out a few others (Bender, Zapp, and Zoidberg). In the meantime ... if you have a Droid phone ... get on over to the market and buy my app!

Sunday, July 18, 2010

Cracking the "DROID CODE"

Recently, the folks at Verizon/Droid started airing a new Droid X commercial featuring a couple of astronaut types exploring some sort of moon-like base. It's pretty creepy and cryptic - and it ends with an obvious clue around frame 0:59.
The code is "JXYDAQWQYD". Some clever folks over at Droid Life figured out that there is a place to put these codes on the droiddoes.com website. When you enter this code into the box, you get the "transmission log" from the astonauts. Pretty neat.

Is there more to the code itself? It seems like a really easy crypt of some sort so I got out some scrap paper and tried to reverse it. The code actually says "THINK AGAIN". And with that - I made a simple letter chart. What you will find is that the words that they chose to reveal the code actually leave letter gaps and made it VERY easy to crack. Here is a letter chart which you can use to perhaps crack "future codes".



I have to assume that there is more to the "secret page" so I started looking for additional clues. The page iteself drops some interesting word clues such as "Shaefer" (who must be the unfortunate astronaut whose cracked and damaged helmet they pass). And also some numbers in the form of an energy blast that passes the new crew (+240, +46, +0). It seems like GPS coordinates so I tried my luck at that and didn't get very far.

Google maps took me to a place in in the UK called "MotorSolve". I didn't think it was at all related. But the address of the place is 64 Cecil St. One of the astronauts in the commercial is wearing a helmet with his ID of "C-64" stamped on the side. This could be a far stretch. Perhaps I am conspiring too much. ;-) Also, I have been at this all morning and I need to shower now.

If anyone can find other codes that work - share your findings with me!

Tuesday, June 29, 2010

USB Serial Adapter Drivers for Chromium

A few weeks ago I downloaded Chromium OS Flow and tried it out on my netbook using a jump drive. I really liked it a lot, although the USB device was slow and had a tendency to stall out. So I pulled out an 8GB SDHC SD card that I had been hoarding and installed Chromium Flow to that. And all I can say is *WOW*. This OS is awesome. It boots (and shuts down) on a dime. The interface is quite slick. And it has a full screen terminal with apt-get and a lot of installable software.

But then I ran into a problem. Lately I have been resetting a lot of router passwords using a console cable (don't ask). To perform this technique, you need a serial port. No laptop or netbook made in the past ten years has a serial port on it so I usually get by with a USB to serial adapter (aka "a serial dongle"). We happen to have one at work, which was lucky. Except it didn't work at all in Chromium.

Long story short ...
1) I had to use gparted on a jump drive to resize some partitions. Chromium Flow is a 2GB "image". So I needed to move some boundaries to take advantage of all that empty space on my SD card.
2) I had to relocate /var/cache/apt. The tiny slice that the directory sits on didn't leave much room for installing software. I moved the directory to /, and then created a symbolic link to it.
3) I installed the build-essential and kernel source (2.6.31) packages.
4) I unzipped the kernel source, turned on all of the USB serial drivers as modules, and then built a kernel.
5) Now I have a little stack of kernel modules for a slew of USB to serial adapters.

I can load it with insmod ./pl2303.ko. If I do a dmesg | tail I can see that it loaded properly. Now when I plug in my dongle, it gets a serial device assignment whereas before all I got was a notice telling me that it was plugged in.

If you are in need of a USB serial adapter driver for Chromium flow, just use mine. This should save you a couple of hours. ;-) You can download the bundle of kernel modules here: http://www.oddree.com/rayhaque/usbserial.tgz

Tomorrow I can fire up minicom and start rocking out Cisco console ports with my little netbook and not have to drag around a 25 pound P.O.S. with Windows XP and Hyperterminal! Hooray!

** EDIT ***
I guess I should tell anyone who might download this how you should use it.
1) Get the file downloaded. From terminal ...
wget http://www.oddree.com/rayhaque/usbserial.tgz
2) Untar/zgip it...
tar -xzvf usbserial.tgz
3) Move the directory into the right place alongside your other kernel modules ...
mv usbserial /lib/modules/2.6.31-4-intel-menlow/kernel/drivers/usb
4) Change to that directory and optionally rename it to what it would normally be...
cd /lib/modules/2.6.31-4-intel-menlow/kernel/drivers/usb/usbserial && move usbserial serial
5) Make the kernel aware that there are new modules out there ...
depmod -a
6) Now, load your module. If you were using the same one as me ...
modprobe pl2303
7) Check the dmesg output for clues as to whether or not the driver is working ...
dmesg

ENJOY! :-)