I'm working on a device based on an ESP8266 (Wemos D1 Mini) that shall be connected to a C64 or Atari 8-Bit computer's joystick port. At the same time, a normal joystick could be connected (signals are passed through). The device should then both be able to listen to the joystick movements as well as also be able to simulate a joystick.
In my current setup, I have taken the risk of hooking up the ESP directly to the joystick cable, despite the fact that the ESP should not have 5V as input on the pins. So far it has been running for a few days now without a problem, but I want to make it right and apply the correct voltage. If possible, this should be a voltage divider done with resistors because I want people to be able to build this device on a bread board.
My problem now lies in the fact that the joystick port constantly delivers 5V on the direction pins. For a voltage divider to work, I would have to have, say, a 1k and a 2k resistor leading from 5V to GND, and then tap the signal between the resistors and connect the resulting 3.3V to the ESP. However, the joystick only connects the corresponding wires to ground if it is moved to that direction. If I understand things correctly, that would mean if the joystick is in idle position, none of the 5V pins are connected to ground and thus there is no voltage division. As a result, the 5V from the joystick port would then again be applied directly to the ESP's pins.
On the other hand, if I make a bypass after the two resistors to GND for the voltage divider to work, the C64/Atari would detect that the direction pin has been connected to ground and thus interpret this as the joystick's move in that direction.
If my thoughts are correct, what other way could there be to bring down the joystick port's current to 3.3V?
Thanks in advance for any ideas!