nikola-wan
Veteran Member
My concept for a Tektronix 4050 gamepad interface is to use an Arduino with two 10-bit ADC to digitize an analog joystick and four I/O pins for four switches. The gamepad I have in mind is the Vectrex game controller which has an analog joystick and four buttons and uses a DB-9 connector.
For the interface to the 4050 computer - I would like to use Jos Dreesen's 4052/4054 Multifunction ROM Pack which has a socket for the Motorola MC6250 ACIA (UART). We can develop a circuit board with an Arduino that plugs into the MFM 6250 socket and supports one DB-9 connector. The Arduino board should support 5V directly so we don't need level shifters to connect to the 8-bit data interface and register control signals of the 6250 socket.
The BASIC game program would use one input command to poll the one X/Y joystick and 4 buttons and return X,Y,A,B,C,D as integers (which would be converted by BASIC into 'normal' floating point variables.
INPUT @41:X,Y,A,B,C,D
The game program would then be able to use the gamepad data without further data conversion.
Here is the schematic of the Vectrex game controller:
The Vectrex hand control uses +5V and -5V on the joystick, and the Vectrex CPU uses an 8-bit DAC to do successive approximation in software to find the 8-bit DAC value of the X and Y pot positions. The X value should be zero for center, negative for left and positive for right. The Y value should be zero for center, negative for down and positive for up. But I haven’t measured these values – they should be checked.
Since the potentiometer for X and Y is 10K and it is in series with two 4.7K resistors, it looks like the min voltage would be 25% of Vin, the center voltage would be 50% of Vin, and the max voltage would be 75% of Vin. I think we would have the Arduino (or op-amp?) double the ADC value by 2x in both directions around 0 to get the full 10-bit resolution (2.5V if we connect the -5V pin to analog ground and connect +5V to the +5V pin).
My concept is to try to use @jdreesen Tektronix 4052 Multifunction ROM Pack - RS232 Printer interface. Remove the Motorola MC6850 ACIA IC and all the support logic and either design a board that plugs into the MC6850 connector or design a new version of the MFM that adds an Arduino that would interface a Vectrex game controller to the Tektronix 4052/4054 computers.
If we could modify the 4052 Printer RS-232 ROM to add INPUT capability - then I envision a single BASIC INPUT @51:X,Y,A,B,C,D statement would return the X and Y integer values and the four switch binary values to the computer.
The Arduino would wait for the READ signal to the data register and then ADC the X and Y potentiometer positions and scan the four buttons and return the integer values to the computer.
Likely I will need help from Jos on this project.
For the interface to the 4050 computer - I would like to use Jos Dreesen's 4052/4054 Multifunction ROM Pack which has a socket for the Motorola MC6250 ACIA (UART). We can develop a circuit board with an Arduino that plugs into the MFM 6250 socket and supports one DB-9 connector. The Arduino board should support 5V directly so we don't need level shifters to connect to the 8-bit data interface and register control signals of the 6250 socket.
The BASIC game program would use one input command to poll the one X/Y joystick and 4 buttons and return X,Y,A,B,C,D as integers (which would be converted by BASIC into 'normal' floating point variables.
INPUT @41:X,Y,A,B,C,D
The game program would then be able to use the gamepad data without further data conversion.
Here is the schematic of the Vectrex game controller:
The Vectrex hand control uses +5V and -5V on the joystick, and the Vectrex CPU uses an 8-bit DAC to do successive approximation in software to find the 8-bit DAC value of the X and Y pot positions. The X value should be zero for center, negative for left and positive for right. The Y value should be zero for center, negative for down and positive for up. But I haven’t measured these values – they should be checked.
Since the potentiometer for X and Y is 10K and it is in series with two 4.7K resistors, it looks like the min voltage would be 25% of Vin, the center voltage would be 50% of Vin, and the max voltage would be 75% of Vin. I think we would have the Arduino (or op-amp?) double the ADC value by 2x in both directions around 0 to get the full 10-bit resolution (2.5V if we connect the -5V pin to analog ground and connect +5V to the +5V pin).
My concept is to try to use @jdreesen Tektronix 4052 Multifunction ROM Pack - RS232 Printer interface. Remove the Motorola MC6850 ACIA IC and all the support logic and either design a board that plugs into the MC6850 connector or design a new version of the MFM that adds an Arduino that would interface a Vectrex game controller to the Tektronix 4052/4054 computers.
If we could modify the 4052 Printer RS-232 ROM to add INPUT capability - then I envision a single BASIC INPUT @51:X,Y,A,B,C,D statement would return the X and Y integer values and the four switch binary values to the computer.
The Arduino would wait for the READ signal to the data register and then ADC the X and Y potentiometer positions and scan the four buttons and return the integer values to the computer.
Likely I will need help from Jos on this project.