Tuesday, May 13, 2014

RPN Scientific Calculator: Case

After a few months of work, the case for my calculator is finally finished. Back in January I made a post with a picture of the clad I soldered together for the case. My plan at the time was to stuff all of the internals of the calculator into the case over the course of a few days but it ended up taking much longer.

The first hurdle was figuring out how to attach the front and back plates to the case. In the end I settled on epoxy. The first one I tried was still oily after 24 hours and did not hold very well but a much cheaper one held extremely well and I used it to glue four bolts to either side of the case body. Oddly enough the epoxy turned the clad green pretty quickly. From there I made holes with a box cutter in the front and back pieces for the bolts. Cutting out the hole for the keypad and LCD in the front piece of clad with a box cutter and wire cutters was a real chore and I don't plan on working with clad ever again without something like a dremel. For spacers between the clad and components I used rubber erasers.

These are cheap and easy to work with. My only fear is that they may dry out and crack someday. At first I tried gluing one of the plastic battery holders to an eraser with epoxy but surprisingly the bond was very weak. Super glue worked very well, though, and I glued in more erasers to hold the LCD, PCB, and keypad in place. All of that added a noticeable amount of weight to everything. The front and back pieces also have erasers glued to them to help hold everything together.

There was not enough room to comfortably route the wires from the LCD and keypad to the PCB so I desoldered them and used Cat5 cable instead. The wires inside are much smaller and easier to work with. It is also possible to leave the individual wires inside the Cat5 cable to make routing neater and I did this for some of the keypad wires. After assembling everything it worked fairly well except the keypad buttons were hooked up upside down. This was easy to fix in software and I loaded the new version using the programming pins soldered to the PCB without having to take the PCB out of the case. There was another bug that caused the calculator to freeze after pressing escape. For some reason the program was going into sleep mode when I pressed escape. I must have added this during debugging but it does not make sense at this point.

The next step will be to add some sort of labels for the keys and then paint it if I decide to.

Saturday, May 10, 2014

New Project: 6502 Virtual Trainer

One project I have been interested in for a while is building a homebrew computer. Some of the projects I have followed like Veronica are really fascinating and I would like to do something similar. For my project I decided to use an M68000 but Mouser did not have any in DIP packages when I ordered from them last year so I settled on a W65C816S instead. This chip is compatible with the 6502 like Veronica uses but also has a 16-bit mode which is more powerful. Other homebrew computers like this one use that chip as well.

KIM-1 6502 trainer
Setting up RAM and ROM to work with the processor for a simple system is well-documented. My first idea was to hook up a microcontroller to the system once I had it running to monitor the bus and some of the control pins not usually used in simple systems. That way I could transfer information about the system to a PC over UART and even control the clock rate. Then I realized that it would be simpler to skip the RAM and ROM altogether and keep all of the memory on the PC. The microcontroller would relay data between the processor and the emulated memory and peripherals. This would not be a useful system by itself but it would let me learn a lot about how the processor works.

Simple systems like the KIM-1 were produced in the past along the same lines. These were called trainers and often had simple hardware that let people learn about how computers work. I decided to call my project a trainer also. My plan is to control the processor through an interface on the PC that will let me examine the memory as the program is running as well as set break points and single-step the processor. It will also show me the status of all the control pins and let me set the values of some of them. Peripherals like buttons, lights, and displays will all be virtual. Here are some of the ones I have working so far: