MC Panel -- Requirements

by Chuck November 23, 2011

Just to make sure that I know what I’m doing, here are the requirements that I’d like to meet with the control panel.

  • Must have the same form factor as the original front panel. By my measurements, that means 3.5 inches by 2.20 inches.
  • 16-key keypad.
  • 2 LED digits. 
  • Serial port to connect to PC using a BUB USB board.
  • Power for the Membership Card should come from the USB port, but there should also be a simple way to hook up an external power supply.
  • When the serial port is connected the front panel should be able to understand the simple command language that I developed for the serial port adapter.
  • If the serial port is not connected the front panel should act like a hex keypad connected to port 4, and do the standard DMA load.
  • Should have expansion connectors so that additional boards can be stacked.

So keep those in mind as I’m working on the front panel. Hopefully I’ll be able to make all of these work.

Tags:

Electronics

Membership Card Serial Port Adapter

by Chuck February 8, 2011

Last week I let the COSMAC ELF mailing list know that I had made a serial port adapter for the Membership Card. I’d been planning on creating an installation package for it, but the announcement was what Scott Guthrie used to call a “forcing function” – once I announced that I had the software, I pretty much had to create a package and send it out.

So, here it is: Membership Card Serial Adapter

I want to thank Herb Johnson for his reviews of the first packages that I created, and to Lee Hart (of course) both for creating the Membership Card and for saying in a post “The genius of Chuck's work is his software.” I know it’s just a figure of speech, but it’s a real ego boost to have someone whose work that you admire to call your work "genius."

Tags: ,

Electronics

One step forward...

by Chuck November 5, 2010

After getting the Membership Card to work with the serial interface circuit on my big breadboard, I decided it would be good to move the circuit to a smaller breadboard – one that only had the one project on it and that could stand in for an actual completed project.

I should never change something once it works. It took me most of the night to get the circuit to run on a different breadboard. When I moved it I decided to move some of the pins around on the PICAXE-20X2; then I had to troubleshoot those connections, change the control pin IDs in the software, rebuild, reload, do it again and again.

On the bright side, I’ve been watching some interesting shows on Hulu.com while I work on this stuff…

In any case, I’ve discovered that I can’t actually read the data bus with the 20X2 to send data back to the PC. The pull-up resistors on the data switches, um, pull up the bus to +5V when I read the bus, and all I get back at the PC are ones. I need to rethink how I’m going to get the data from the Membership Card back to the PC – I’m not sure I have enough data bits on the 20X2 – though I may be able to do something with diodes so that I can use port B to both write to the Membership Card and then read back from it. Worth a try…

Maybe this weekend I’ll make a couple more steps forward – and avoid the steps back.

Tags:

Electronics

Killer Serial

by Chuck November 2, 2010

adapter-smallThe Membership Card has a 25-pin connector on the standard front panel. The designer, Lee Hart, intended for this connector to be used to control the Membership Card using a standard PC parallel port.

The only problem is that most PCs, and all laptops, don’t have parallel ports any more. And even when they do, there aren’t any commonly available parallel port drivers for computers that run Windows Vista and Windows 7. It’s a dilemma, especially since even the one computer that I have at home with a parallel port runs Windows 7.

But we are not without our resources here at Brambly Hill, and one of the resources that we have is the Revolution Education PICAXE® microcontroller. Specifically, the PICAXE-20X2. The 20X2 has enough I/O to provide an 8-bit bi-directional data port and all the other control and data lines that I need to connect Membership Card to a PC via a USB serial port.

Terminal program communicating with Membership Card serial port adapterWindows Membership Card Control Panel programAll that it takes is a little software, and I know how to do software. I am, after all, a professional. A little software here, a little hardware here, and I had a serial port interface for my Membership Card. In the picture you can see it running on my large breadboard (along with a another bit of hardware that I’m experimenting with). I actually built this circuit up before I got the Membership Card from Lee – I wanted to bench test the software to make sure that it was working the way I expected. Having the Membership Card simulated by a set of LEDs let me work the kinks out of my PICAXE software, and do a lot of improvement to the code before I ever saw the actual hardware. Not only does the serial port adapter work with a standard terminal program, but I was also able to write a simple Windows application to act as a control panel for the Membership Card. Two for the price of one, and they both worked. At least with the simulated hardware. The next step was to test it with the actual Membership Card.

And that’s where the fun starts.

I started with the easiest control line, INP. Just toggle the control bit, and the Membership Card should write the data on the switches to the RAM. It’ll show up on the output LEDs, and I’ll be able to reset and run the program using the toggle switches. Piece of cake. And it was. I spent a happy few minutes toggling in programs and then pushing the INP button on the Windows control program to load them into memory. Even that was an improvement – that tiny little input switch on the front panel was starting to hurt my finger when I pressed it.

So far, so good.

I hooked up the Memory Protect line – and discovered that it worked opposite of how I originally thought. When I put the Membership Card in Read/Only mode, you could write to the RAM, and in Read/Write mode, you couldn’t. That was a simple change in the PICAXE code for the adapter. Now I can control whether you can read and write RAM from the Windows program. Cool.

I hooked up the LOAD and CLEAR lines. Nothing worked. I couldn’t get the Membership Card to load data, I couldn’t get it to run, nothing. I pulled all the control lines out. I put them all back. I checked the schematic, I swapped pins. I changed the high/low states of both lines. Nothing.

After the fourth time that I’d pulled all the wires out of the breadboard I noticed on the schematic that when the LOAD and CLEAR switches on the Membership Card are in the LOAD position (both down), they are connected to ground. When they are in the RUN position (both up), they are connected to +5V through a pull-up resistor – and to the 25-pin connector. I put the wires back in place, flipped both switches up, and was immediately able to put the Membership Card into RESET, LOAD, and RUN modes from the Windows control program

The last thing to do was connect the data lines and start sending data from the Windows control program to the serial adapter and then from there to the Membership Card. I busily attach jumpers from the control port to the breadboard to hook up the data bus. All eight. I turn everything on, and then try to send data. Nothing happens. Even the LEDs connected to the 20X2 port aren’t lighting up. I pull all the data bus jumpers. I send data. The LEDs flash in the appropriate pattern for the data that I send. I put the jumpers back in. No illumination on the LEDs. I pull ‘em again. The LEDs light up.

You’re probably ahead of me. I glanced up at the schematic. When the data switches are in the down position, they connect to ground. In the up position they connect to +5V through a pull-up resistor – and to the 25-pin connector. I put all the jumpers back in again. I switch all the data switches up. I load the RAM with the simple “Hello world” program (7B 30 00). I set the Membership Card into RUN mode. Nothing happens.

ARGH!

I reset. I step through memory. The pattern on the data LEDs change. They look – odd. They’re – backward? I look at the breadboard. I’ve connected D0 to D7, and so on. I’ve reversed the connections on the data bus. Pull ‘em out. Put ‘em back in the opposite order. Load the RAM. Reset. Run.

Q LED lights up.

More rainbows. More bluebirds. Or something.

I load a few programs. I’m happy. I try to use the Windows control program to load an Intel HEX file onto the Membership Card. It fails. I’m sad. I try putting a delay in between the PICAXE-20X2 “pressing” and “releasing” the INP switch. I load the HEX file again. It works.

I’m really happy. It’s also midnight, so I’m really tired.

Just for fun I load Herb Johnson’s version of Dennis' Boone’s implementation of Steve Gemeny’s program to blink the Arecibo message on the Q LED. I go to bed with a “70’s vintage interstellar communications system” blinking away on my desk. I go to bed.

Tags: ,

Electronics

Membership Card

by Chuck October 27, 2010

One of the things that I like to play with are retro-computers – old hardware from back in the dark ages of computing, hardware that a 17-year-old could understand, and that a 48-year-old can still wrap his head around.

One of the most famous of the retro computers is the Popular Electronics COSMAC ELF. I, and many others like me, got our start with computers flipping switches and pressing buttons on a home-built ELF. Many, including me, still have their old ELF sitting in a box on the shelf, and have a soft spot in their hearts for the red Q LED and the 8 toggle switches on the input panel.

Back in 2004 SpareTime Gizmos created the ELF 2000, a re-interpretation of the ELF using mostly modern components. The ELF2K is an ELF full-gallon – 32 K RAM, 32 K ROM with monitor and multiple high-level programming languages, support for terminals, Compact Flash – basically everything that you could want in a small computer.

But there is another style of ELF computer out there. These are not ELFs brought into the 21st century, and they are not faithful reproductions of the 1977 COSMAC ELF. Lee Hart’s Membership Card packs the essence of the COSMAC ELF into an Altoid’s tin. Essentially, it’s a microcomputer trainer that you can put in your shirt pocket and take with you everywhere you go.

My Membership Card computer tucked into its candy tin.It’s such a cool idea that I had to have one. So when Lee announced that he was selling kits of the Rev. B version of the Membership Card I jumped on the opportunity and bought one. Lee sent the kit complete with an Altoids tin – with Altoid powder still inside (a nice touch, that).

I hesitated over building it – I’m not 100% confident in my building skills. My ELF2K has an intermittent fault that was probably caused by a soldering error. The last thing that I wanted was another ELF-type computer sitting in my den, not working. But I eventually took the plunge, and over a weekend and a couple of week nights I got the hardware put together and tucked, if not neatly, at least cozily into the candy tin.

Next began an of evenings of frustration for me. Once I had the Membership Card complete I built a power cable for it and plugged it in. I flipped in the simplest “Hello World” program that you can use on an ELF: 7B 30 00. Turn on the Q LED, then loop back and do it again forever. And of course, nothing happened.

Starting to sense a pattern here?

I spent a frustrating evening trying everything that I know to get that tiny little program to run. Nothing. I knew that the program was going in to the RAM, the LEDs were lighting up with every press of the INP switch, and the way the ELF works those LEDs wouldn’t light up if the data wasn’t being written. But I just couldn’t get it to come back out; setting the memory to read-only and pressing INP didn’t cycle through the program that I’d just loaded. Once, and I had no idea why, I put the Membership Card in RUN mode and the Q LED came on. But I couldn’t get it to work again.

I spent a pretty miserable day the next day. At one point I was ready to pack all my 1802-based computers and figuratively put them on the side of the road with a “Free” sign on them. I’ve got four of these things, and not a single one of them works. Not my proudest achievement.

But I went home and tried again. I got out the schematic. I read the documentation. And a light dawned. Switch 9 isn’t the one that you flip to reset the ELF, switch 10 is. So I toggled in the program again. I flipped switch 10 up, then I flipped switch 9 up. And the Q LED came on.

The sun burst through the clouds casting rainbows. Little blue birds flew in carrying banners that said “Joy!” or little hearts in their beaks. There was a fanfare of trumpets and the air was filled with sweet perfume.

Or not. But I was pretty happy.

So I left the Membership Card sitting on my desk, flashing its Q LED like a little happy firework. And I went to bed, happily plotting new and exciting ways to drive myself crazy with this little tin box.

Tags:

Electronics

Log in