Now that I know the replacement board's keypad works, I started thinking about how to interface this to the emulated Busicom 141-PF calculator's "circuitry".
The Busicom scanned its keyboard using two MCS-4 family chips: a i4001 ROM and a i4003 shift register. A ROM may seem to be an odd device to use in this situation, but the i4001 also provided a 4-bit I/O port. The shift register provided 10 output pins and a simple way to walk a "0" bit down the outputs in sequence. Thus the keyboard was arranged electrically as 8 x 4 matrix. The shift register selects which of the eight columns is being read, and the I/O port reads which of the four rows contains a pressed key, if any. The last two "columns" selected by the shift register return 4-bit coded values from two slide switches.
This dictates the interface my emulation must present.
The Canon P170-DH has a different arrangement of keys than the Busicom 141-PF. Early on I decided I wanted flexibility in assigning key functions through the FPGA rather than trying to match the Busicom layout in PCB wiring. So my keypad scanner will operate independently of the scanning done by the Busicom software.
I see two ways to implement the keypad interface. One is that my scanner would debounce the keypad and identify which key is pressed. The row and column numbers where that key would appear in the Busicom keyboard is then latched. When the i4003 shift register activates the column where that key would have been found, the proper bit is asserted to the i4001 I/O port.
The other implementation would be to create a virtual keyboard, a storage matrix containing 8 rows of 4 bits. Each of these bits would represent the state of a Busicom key. When the FPGA scans the physical keypad it would set or clear the corresponding bits in the virtual keyboard matrix. The Busicom software would scan this virtual keyboard as if it was the real Busicom keyboard.
Sounds like some prototyping and experimentation is needed.
No comments:
Post a Comment