Jump to content
  • 0

Building an Analog Joystick Pmod Peripheral


DoctorWkt

Question

Now that I've got Stephen Edwards' Apple2 FPGA project working, I want to build a joystick for it. The original Apple 2 joystick was two potentiometers connected to a NE556 timer (on the Apple 2 motherboard), plus two pushbuttons. Attached is the original schematic.

What I want to do is to find an old analog joystick, put the 556 timer into the joystick itself (I'll probably need a TS3V556 3.3V version), and interface this to a Pmod port. I'll need these seven lines: gnd, Vcc, two digital pushbutton inputs, two digital joystick inputs, one digital output to trigger the timer.

Does this sound feasible? I assume the Pmod lines are bidirectional, so I'd need to declare them inout in VHDL. Is there anything else I should consider?

P.S If I buy a 6pos 2row 2.54mm header from someone like Element14, this will plug into a Pmod socket OK?

Many thanks for feedback, Warren

desktop_1_003.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hi Warren,

I think this sounds pretty cool; it's always fun to create your own components for the projects. The pin header you described with the 2.54 mm spacing will fit great.

The Pmod lines can be bi-directional, but each data line that you are describing is only going one direction (in terms of data flow) so I would imagine that you can just declare the pins to input or output as appropriate on the Pmod header.

I do have one question though. What is the purpose of the 556 timer? If you are only looking to "catch" the button presses and the joystick movement, it sounds like you would be able to get away with forgoing the timer altogether.

Thanks,
JColvin

Link to comment
Share on other sites

Thanks for the feedback James. Each axis of the Apple 2 joystick is a potentiometer which, together with a capacitor, forms an RC circuit that is the input to a 555 one-shot timer. When a program wants to read the position of the axis, it toggles a memory location that triggers the 555 timer. This causes the 555 output to go high initially; then the output goes low after a time delay based on the value of the potentiometer on that axis. The program then loops reading the 555 output, counting the number of cycles before the output goes low. When the output goes low, the counter holds the positional value of that axis.

Because I don't want to modify the timer sampling code in the Apple 2 ROM, I need to build the same type of one-shot timer circuit into the joystick :-)

Cheers, Warren

Link to comment
Share on other sites

Oh ok, that makes sense. I was just looking for a way that you could potentially only use 6 pins to make part of the design slightly easier, but it sounds like that may actually end up being more work in your situation.

Otherwise, it sounds like you have everything else all figured out and ready to go. Let us know how it goes!

Thanks,
JColvin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...