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

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

Solder smoke

by Chuck September 29, 2010

Occasionally, when I’m buying electronics gizmos, I’ll pad the purchase with interesting little bits of hardware that the supplier has on sale. This summer, when I was buying switches for Katie’s educational display, All Electronics  had some 8x2 LCD displays on sale for $5.50 each. Of course I bought two.

With the two displays in hand I went through my back issues of Nuts and Volts magazine looking for a “Picaxe Primer” column that I remembered, where Ron Hackett built up an LCD driver based on the Picaxe 14M chip. Look in the June 2009 issue for the column, or you can visit his Web site and buy all the parts that you need to build a serial LCD backpack. That’s what I did.

OK, so I didn’t order all the parts. I forgot to buy the 3-pin right angle male header that you need for the speed jumper. That just gives me an excuse to create an order for some other place – and pick up a few new gizmos to play with.

Building the LCD board was a simple and enjoyable job. The only problem I had was with R8. The assembly instructions say “See text” but the don’t say that the text in question is at the bottom of the page describing the LCD board. I eventually dug up the old Nuts and Volts back issue that had the discussion of the LCD backpack to figure out what was going on. Turns out R8 is the current limiting resistor for the LED backlight. If you just leave it off, you don’t need to worry about sizing it…

Anyway. I built up the board, programmed a 14M with the demonstration program, and turned it on. Nothing. Damn. Then I remembered to adjust the contrast pot – a few turns and there was the display flashing merrily away. I downloaded the serial LCD controller, plugged the LCD module into the backpack and the backpack into my breadboard, wired an 08M to send data, and that worked on the first try.

Cool.

Finally, I ran down to Radio Shack (twice – always make sure that the package you grab out of the parts bin is actually the one that’s supposed to be in the parts bin) for some #2 nuts and bolts to attach the backpack to the LCD module.

The total cost for the two serial 8x2 LCD displays was about $40. At Digi-Key a single Matrix Orbital 8x2 serial LCD is $39.95. I’m sure that the Matrix Orbital display is faster and less “pic-y,” but I’m satisfied with the new ones that I built.

Tags:

Electronics

RAM test rig

by Chuck September 14, 2009

Picaxe-based RAM test rig For my birthday this year my wife got me a Spare Time Gizmos ELF 2000 kit, a re-interpretation of the original 1802-based computer that I (and many others) built from plans in Popular Electronics.

Just like the first one that I built, this one had a few problems when I first turned it on. Finding and fixing a bad connection in an IDC socket was fairly easy, and I found the cold solder joint on the switch panel after just a little more work. What was harder was the fact that some memory locations just didn't seem to be changing, and I couldn't figure out why.

So I built a test rig for the 32K static RAM on the ELF2K. I used a Picaxe 40X1 as the brains, two 74HC595 chips to latch the 16-bit address required, and a handful of LEDs to show me what's going on.

I used PortC to read and write data to the RAM chip. I had some difficulty getting the bi-directional data bus to work until I put dirs= statements in the code to explicitly change from output to input when writing then reading the test data.

Since PortC was in use, I couldn't use the hardware SPI port, so I used the simple bit-banged serial protocol from the manual.

Once I had the test rig up and running it started indicating memory errors throughout the RAM chip, but especially on the last page of memory, the page that the ELF2K uses for it's system data page, and where the OS on the ELF2K was indicating there was a problem.

I've ordered a couple more RAM chips that should be here tomorrow. Once I've got a known good RAM chip to install in the ELF2K I'll be one step closer to getting it to work.

Tags: ,

Electronics

Log in