One of my goals, like so many i4004 hobbyists, is to recreate the Busicom 141-PF calculator. This was a printing calculator, using one of the earliest small digital printers from the company that became Epson. Some have done it with a compatible printer while others have used microprocessors to scan the hammer driver outputs and convert the results to ASCII.
I'm a professional software engineer, and have been writing software since learning Fortran in 1977. While I've written a fair amount of code for hobby projects it's not something that excites me anymore. Verilog and VHDL, on the other hand, are interesting to me because they require a different mindset and I love learning new things.
So I set out to develop an EP-102 emulator that would print on the Epson M-32TL printer in the Canon P170-DH calculator that I planned to cannibalize. Since I've been unable to find a datasheet for the M-32TL, I decided to put that off a bit and generate ASCII output on a serial interface. I can also emulate the keyboard with a serial interface, allowing me to run the real 141-PF firmware in an FPGA emulating the entire system while using a PC for input and output.
There are a lot of UART implementations available in VHDL and Verilog, but I wanted to write my own. Since I'm not looking for a full 16550 emulation it only took a few evenings to code and debug, including testing it on a Spartan-6 reference board. I'd hoped to test it on the Lattice iCE40-HX8 breakout board, but I'm having a minor but blocking issue with USB configurations (udev rules to disconnect one of the FT2232H interfaces from the serial driver, if you're curious).
Then I turned to emulating the EP-102. This is a tiny drum printer with 18 columns and 13 sectors per column. From the left, the first 15 columns can print the digits 0 to 9, a decimal separator (period or "full-stop"), or a "minus" sign. The 16th column is non-printing, and the 17th and 18th columns have various special characters. (This raises a problem with my plan to use the P170-DH, as it has a 12-digit printer. Maybe I'll replace the 12-digit VFD with a 20-character LCD or LED instead.)
When Tim McNerney analyzed the 141-PF for the i4004's 35th Anniversary he included notes on the operation of the EP-102. From these I constructed a Verilog module that looks like an EP-102 on one side and outputs a stream of ASCII characters when the "paper" is advanced on the other. This took another few evenings. I still have a bug in the synchronization of the sector timing (e.g. when I try to print 1s ASCII 2s are generated) but it's getting close.
I'm thinking it might be fun to create a "141-PF on a board" using the iCE40-HX8K breakout board, so I decided to build it for the iCE40 to see how big it is. Including the EP-102 emulation, UART transmitter, and a simple test "top" module I'm using 458 of the 7680 logic cells, or about 6%. To create a full system I'll need to add a 4004 CPU, 5 4001 ROMs, 2 i4002 RAMs, 3 4003 shift registers, the UART receiver, and the as-yet unwritten ASCII-to-keyboard converter. Will it fit? Stay tuned!
No comments:
Post a Comment