Using Flowcode to pgm an atari style joystick
Using Flowcode to pgm an atari style joystick
I want to use Flowcode to pgm a atari 2600 joystick adapter box. Does anybody know what e-blocks would allow me to input the signal from an atrari joystick and output it to three atari 2600 nine pin cables . i want to pgm a multi-click feature which allows the use of one switch to operate three separate swiches according to how mant times you press the switch. Is Flow code powerful enough? Thanks a lot! Jeff
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
I have integrated a PIC with a PC style D type 15pin Joystick. If this is similar to what you require then let me know and I will send you my files.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
I've adapted an X-Arcade game console arcade control with three dsub9 pin plugs to accept handicapped switches (which use the same technology as Atari 2600 joysticks). I'm vague on how exactly communication takes place with the PIC micro. On input, when I complete a given circuit by pushing the stick how does the Pic chip know this and on output how does it complete the circuit for the chosen X-Arcade switch.
jeff
jeff
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
The X and Y axis will probably be represented by a analogue signal. Eg when the joystick is centered both x and y signals will be around 2.5V. It is therefore simply a case of measuring the analogue voltage and working out the position.
As for the buttons these should be standard digital inputs. Depending on how many buttons there are on the joystick there could be some multiplexing that acts as an array to control the switches. In this case it would also need some digital output signals to search through the switch array to find the pressed switch.
As for the buttons these should be standard digital inputs. Depending on how many buttons there are on the joystick there could be some multiplexing that acts as an array to control the switches. In this case it would also need some digital output signals to search through the switch array to find the pressed switch.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re:
I have finished a preliminary flowcode flowchart and successfully burned it to chip. I used a EB002-00-1 screw terminal block to create an adapter from a digital atari style joystick to the multiprogrammer. I redirected pin #8 which is used for ground on the stick to ground pin #9 of the screw terminal block. I get no input. What might I be doing wrong? Am I missing an important concept here?Benj wrote:The X and Y axis will probably be represented by a analogue signal. Eg when the joystick is centered both x and y signals will be around 2.5V. It is therefore simply a case of measuring the analogue voltage and working out the position.
As for the buttons these should be standard digital inputs. Depending on how many buttons there are on the joystick there could be some multiplexing that acts as an array to control the switches. In this case it would also need some digital output signals to search through the switch array to find the pressed switch.
Thanks,
Jeff
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using Flowcode to pgm an atari style joystick
Hello Jeff
What are your other connections. You mentioned the Ground line but what are the Joystick X and Y pins connected to etc. Pins and Ports of the chip may be helpful.
What are your other connections. You mentioned the Ground line but what are the Joystick X and Y pins connected to etc. Pins and Ports of the chip may be helpful.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using Flowcode to pgm an atari style joystick
Here is a diagram of my atari style joystick to multiprogrammer adapter. I added two mono plugs and a togle switch to get eight inputs
Jeff
When i tested this with a multimeter checked out. Since the atari joystick uses a minute amount of flow could the safety resistors be preventing the other swithes from working? Jeff
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using Flowcode to pgm an atari style joystick
Hi Jeff
This page might be useful to you. Note the pull up resistor used for the analogue signal and the pull down resistors used for the digital I/O.
http://www.helmpcb.com/Electronics/USBJ ... stick.aspx
If you create your circuitry like this then the 220R series resistors shouldn't cause you any problems.
This page might be useful to you. Note the pull up resistor used for the analogue signal and the pull down resistors used for the digital I/O.
http://www.helmpcb.com/Electronics/USBJ ... stick.aspx
If you create your circuitry like this then the 220R series resistors shouldn't cause you any problems.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using Flowcode to pgm an atari style joystick
I added the resistors to input and it checks out good. I checked for input using the LCD display e -block. I'm having trouble getting my flowcode program to display on my LCD display e-block. I ran the test HEX file successfully on a 16F88 PIC. So I know the LCD works. But when downloaded the RealTimerClock TMR0 example program and burn to a 16F877A PIC chip nothing displays on the LCD.
Configure
Oscillator: RC
Watchdog timer: Off
LCD on PORTB
Jeff
Configure
Oscillator: RC
Watchdog timer: Off
LCD on PORTB
Jeff
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using Flowcode to pgm an atari style joystick
Hello Jeff
To drive the LCD you will either have to place the oscillator into XTAL mode rather then RC or you will have to lower the clock frequency setting in Flowcode to a rate to match your RC clock speed. If you dont know your RC clock speed then do the 1 second LED flash test. This is where you create an infinite loop that outputs a 1 to a pin waits a second outputs a 0 to the pin and waits a second again. Doing this you can change your clock speed setting in Flowcode to get the correct delays of 1 second.
To drive the LCD you will either have to place the oscillator into XTAL mode rather then RC or you will have to lower the clock frequency setting in Flowcode to a rate to match your RC clock speed. If you dont know your RC clock speed then do the 1 second LED flash test. This is where you create an infinite loop that outputs a 1 to a pin waits a second outputs a 0 to the pin and waits a second again. Doing this you can change your clock speed setting in Flowcode to get the correct delays of 1 second.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using Flowcode to pgm an atari style joystick
I wired up one pull-up resistor on a proto board connected to a multiprogramer through a screw terminal. I'm using an atari joystick connected to one the proto boards db9 plugs as an input switch.
switch was held closed for 1 sec.
outcome: LCD flashing cursor then SUCCESS!!!x2 approx. 10 sec after the switch was open again.
Any idea of what is causing the delay?
Thanks
switch was held closed for 1 sec.
outcome: LCD flashing cursor then SUCCESS!!!x2 approx. 10 sec after the switch was open again.
Any idea of what is causing the delay?
Thanks
- Attachments
-
- flowcode.jpg (130.95 KiB) Viewed 18812 times
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Using Flowcode to pgm an atari style joystick
It could be that the 16F88 chip is defaulting to the 31.25kHz internal oscillator. It will do this if the clock source of the chip is not working.
You should create a simple LED flasher circuit as suggested bu Ben to ensure that the clock frequency you have set in Flowcode is the actual frequency that the chip is running in.
You should create a simple LED flasher circuit as suggested bu Ben to ensure that the clock frequency you have set in Flowcode is the actual frequency that the chip is running in.
Re: Using Flowcode to pgm an atari style joystick
I forgot to mention that I'm using a PIC 16F877A1P. If that makes a difference.
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Using Flowcode to pgm an atari style joystick
It does as this chips doesn't have an internal oscillator or a fail-safe clock mode.
But it does look like your program is running much slower than expected. Have you written a simple led-flasher app to check that the clock speed setting is correct for your hardware?
But it does look like your program is running much slower than expected. Have you written a simple led-flasher app to check that the clock speed setting is correct for your hardware?
Re: Using Flowcode to pgm an atari style joystick
I reburned to chip and now my program doesn't run slow.
I tested a 3.5 volt LED with a 9 volt battery and a 10 k resistor successfully. So, I know that the LED lights up. I then used the LED to test output of a single bit. As you can see on LEDschem.jpg this didn't work because it was wired wrong. I found
a web page about LED interfacing that has a circuit you can see in led interfacing.jpg.I haven't tested the circuit yet. Is it the correct set up for me? Also, once I've tested all of my outputs with LEDs how do I bring my outputs back to the no real power of their own state they started at before input. I'm trying to connect my outputs to a screw terminal to Playstation 2 adaptor.
I tested a 3.5 volt LED with a 9 volt battery and a 10 k resistor successfully. So, I know that the LED lights up. I then used the LED to test output of a single bit. As you can see on LEDschem.jpg this didn't work because it was wired wrong. I found
a web page about LED interfacing that has a circuit you can see in led interfacing.jpg.I haven't tested the circuit yet. Is it the correct set up for me? Also, once I've tested all of my outputs with LEDs how do I bring my outputs back to the no real power of their own state they started at before input. I'm trying to connect my outputs to a screw terminal to Playstation 2 adaptor.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using Flowcode to pgm an atari style joystick
Hello
The picture "led_interfacing.JPG" shows an example for driving an LED. This circuit will light the LED when the I/O pin is outputting 0 and will go out when the I/O pin is outputting a 1.
You can also wire up LEDs so that they are driven via the I/O pin. E g keep R1 and D1 together but connect the free end of R1 to the I/O pin and connect the free end of D1 to Ground or 0V. This will then give you the functionality of switching on the LED when the I/O pin is outputting a 1.
You could also change the resistor for a 330Ohm resistor if you want the LED to be brighter.
My advice is get a breadboard. They allow you to insert and remove components without soldering and you can therefore experiment with different configurations.
This product may be of interest to you.
http://www.matrixmultimedia.com/product ... PHPSESSID=
The picture "led_interfacing.JPG" shows an example for driving an LED. This circuit will light the LED when the I/O pin is outputting 0 and will go out when the I/O pin is outputting a 1.
You can also wire up LEDs so that they are driven via the I/O pin. E g keep R1 and D1 together but connect the free end of R1 to the I/O pin and connect the free end of D1 to Ground or 0V. This will then give you the functionality of switching on the LED when the I/O pin is outputting a 1.
You could also change the resistor for a 330Ohm resistor if you want the LED to be brighter.
My advice is get a breadboard. They allow you to insert and remove components without soldering and you can therefore experiment with different configurations.
This product may be of interest to you.
http://www.matrixmultimedia.com/product ... PHPSESSID=
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using Flowcode to pgm an atari style joystick
I'm only using LED's to test if my outputs work. I plan to output from two dsub9 ports to four dsub9 plugs set up with atari joystick wired pin arrangements with a proto board . So, how do I output a signal that will be seen as atari digital joystick signals. Signals that don't have any real possible power their own.
Re: Using Flowcode to pgm an atari style joystick
I'm using my X-arcade modified with dsub 9pin connectors to test output signals from the PIC.
When I tested the output with a multimeter I got a reading of 25ma for one second every time I pushed the joystick forward. Just as the program tells it to do.
When I onnected the X-arcade to the breadboard I had constant output, no distinct signal from joystick.
How do make the output work like a physical joystick switch so the X=arcade can read it.
When I tested the output with a multimeter I got a reading of 25ma for one second every time I pushed the joystick forward. Just as the program tells it to do.
When I onnected the X-arcade to the breadboard I had constant output, no distinct signal from joystick.
How do make the output work like a physical joystick switch so the X=arcade can read it.
Re: Using Flowcode to pgm an atari style joystick
Became the X-Arcade uses one ground for every four switches as opposed to a comman ground throughout all switches I found it necessary to use a different way to interface with the Playstation. Ultramart makes a keyboard encoder that can be used to connect to that Playstion with an adaptor. Here is the question I asked Ultramarc about connecting to their keyboard encoder to a PIC.
β€I'm making a handicapped accessible programable arcade control adaptor with a PIC chip.
When I tested the output with a multimeter I got a reading of 25ma every time I pushed the joystick forward. But I need a signal that is the same as what an arcade control puts out. How do I turn this output into an input that mimics a physical joystick so I can connect it to an I-PAC
Jeff
On May 19, 2009, at 3:22 AM, andy@ultimarc.com wrote:
Jeff,
The input to the I-PAC has a 7 K resistor to 5 volts, which pulls it high. Closing a connected switch pulls it low to ground, as the other side of the switch is grounded. So the PIC needs to replicate this by pulling to ground when activated.
Andyβ€
Does anybody have any thoughts or suggestions on how to do this?
Thanks,
Jeff
β€I'm making a handicapped accessible programable arcade control adaptor with a PIC chip.
When I tested the output with a multimeter I got a reading of 25ma every time I pushed the joystick forward. But I need a signal that is the same as what an arcade control puts out. How do I turn this output into an input that mimics a physical joystick so I can connect it to an I-PAC
Jeff
On May 19, 2009, at 3:22 AM, andy@ultimarc.com wrote:
Jeff,
The input to the I-PAC has a 7 K resistor to 5 volts, which pulls it high. Closing a connected switch pulls it low to ground, as the other side of the switch is grounded. So the PIC needs to replicate this by pulling to ground when activated.
Andyβ€
Does anybody have any thoughts or suggestions on how to do this?
Thanks,
Jeff
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: Using Flowcode to pgm an atari style joystick
The safest option would be to use opto-couplers or relays (i.e. E-blocks relay board). This makes sure the PIC signals are decoupled from the adapters signals. (The opto-couplers should be connected as outputs, not inputs like the Eblocks Opto-isolator board)
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
Re: Using Flowcode to pgm an atari style joystick
Good idea, but I need a solution that will allow output from each of the eight individual bits. Do you know of anyway this can be done? Can you suggest any alternatives?
Jeff
Jeff
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: Using Flowcode to pgm an atari style joystick
Eight opto-couplers/relays... (opto couplers will probably be cheaper, relays when using two e-blocks will be easier) Just use a opto-coupler/relay for each output bit.
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
Re: Using Flowcode to pgm an atari style joystick
If I want to be able to use all the buttons on the Playstation 2 I will need to use two ports aand fourteen opto couplers. I think this will use too much space on the final PCB and he too expensive. Are there any alternatives? Is there a resistor that can draw power down to zero and pull-down to ground.
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: Using Flowcode to pgm an atari style joystick
If you decide not to use opto-couplers or relays you'll need to connect the signals of both circuits. This might work fine, however you'll have to be careful witch way the PIC circuit is powered as doing things wrong might damage the Playstation. (This would be a perfectly valid solution when done the right way)
The size and price issues are relative. There are chips with 4 opto-couplers in one 16 pin DIL for about $ 1,70 (ISP321-4X) and that's not even the cheapest. Four of those combined with a hand full of resistors should solve your problem. If you need a smaller component, look for SMD (ACPL-247-500E) with several choises priced around $2. Using about $8 of components to make sure the playstation is not put at any risk sounds not too expensive to me...
The size and price issues are relative. There are chips with 4 opto-couplers in one 16 pin DIL for about $ 1,70 (ISP321-4X) and that's not even the cheapest. Four of those combined with a hand full of resistors should solve your problem. If you need a smaller component, look for SMD (ACPL-247-500E) with several choises priced around $2. Using about $8 of components to make sure the playstation is not put at any risk sounds not too expensive to me...
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis