Hey folks, I always learn so much here. I am back with another question:
About a year ago in one of my retro computing buying binges, I purchased a Science Fair (Radio Shack) Microcomputer Trainer..these are circa 1985.
http://oldcomputermuseum.com/microcomputer_trainer.html
The SFMT has a keypad of simple switches.
Program instructions in assembly language are entered via the switches. The heart of the unit is a Texas Instruments CMP1312. It is a flashed version of their TMS-1100 microcrontroller which is a subset of the TMS-1000:
https://www.seanriddle.com/datasheets/ti/TMS1000pgmRef_1975.pdf
The CMP1312 is a flashed version of the TMS1100 for use exclusively in the SFMT. It has several programs and games built into it, but you can write your own programs with it as well.
There are 5 columns of switches which are attached to pins O7, Rc-Rf on the CMP1312 microcontroller on the SFMT.
These channels are strobed. The 4 rows of keys are attached to channels/lines K1, K2, K4, K8 are at system ground until a key is pressed.
As I think I understand it when a key column is strobed the CMP1312 is looking to see if there is a keypress on that column. A circuit between the K-lines and R-lines is closed when a key is pressed and the CMP1312 registers as an instruction. Here is a scope shot of the pulsing of one of the R lines. The yellow line is one of the K lines and at 0V:
It is not really fun to enter programs of any length via the keypad interface. For one thing they aren't laid out in a traditional telephone/calculator keypad arrangement. This makes it difficult to fight the impulse to look for a "7" in the upper left corner - it is on the lower right...etc. Also there is no way to store programs if you wanted to. Power off = program gone. So it would be great to enter the programs via a keyboard on a computer and send it to the CMP1312 that way.
My ultimate goal is to use an Arduino to send the signals to the CMP1312 via a program on the computer. But first I started with a more primitive approach: more press button switches. (Actually I don't have that much interest in programming the Trainer, I just wanted to figure how to send input to it in a way other than the keypad, so this is really just a learning exercise.)
I came up with a simple test using 2 CD4051 multiplexers ( https://www.ti.com/lit/ds/symlink/cd74hct4051.pdf?ts=1658717035300 )with 3 button switches. 1 button connected per CD4051 and the third button connected to the enable pin on each MUX. One output from each MUX would go to an R input and other, one of the K inputs.
Schematic (my 2nd time using Kicad...I have no idea about layout of things so please forgive that). Obviously I am not showing the output connections from the CMP1312 that go to the on board LED's, LED matrix, speaker etc....
Eventually if it works, I would change the inputs from button switches to output from Arduino, turning the MUX pins on & off with delays in between to enter a program.
Well, the thing as shown in the schematic works: https://photos.app.goo.gl/8ZJtr1DJyEaJYaKHA
The thing is I don't understand why it works. I realized after setting it up and showing to someone else who mentioned that I didn't have the ground on the Trainer (9V battery power supply) connected to the ground for the MUXes (5V bench power supply). So the strange thing is that when I connect those 2 grounds together, I can no longer send signals to the Trainer from the MUX. For the "onboard" keypad on the Trainer, I can only send input from keypad from any rows & column of keys except for the row & column MUX wires are attached to.
Can someone explain what is going on? Do I need a shared ground or is it not needed? Would it need to be shared if there was an Arduino connected instead of the buttons? I thought all I was needing to do was allow a single connection between one of the Rc-Rf input pins and one of the K1-K8 pins at a time that completes a circuit inside the CMP1312 which then registers it as a keypress.
In fact if I jumper across any pair of Rc-Rf input pins and K1-K8 pins (no MUX) with a single wire, a keypress is registered. Should there be any signal sent from the MUX? Help! Lost!!...
Thanks for any help!
Robert Opalko