Using Flowcode to pgm an atari style joystick

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Fri Jun 19, 2009 1:51 am

I can't find the chios. Would either of these work.

anufacturer:
AVAGO TECHNOLOGIES
Newark Part Number:
19M9315
Manufacturer Part No:
ACPL-844-300E
RoHS Compliance : Yes
Description
• Optocoupler
• No. of Channels:4
• Isolation Voltage:5000Vrms
• Optocoupler Output Type:Phototransistor
• Input Current Max:50mA
• Package/Case:16-DIP
• No. of Pins:16
• Operating Temperature Range:-30°C to +100°C
• RoHS Compliant: Yes

AVAGO TECHNOLOGIES
Order Code:
1634758
Manufacturer Part No:
ACPL-247-500E
RoHS : Yes
Description
• OPTOCOUPLER, QUAD, SMD, DC I/P
• Channels, No. of:4
• Voltage, Isolation:3000V rms
• Output Type:Transistor
• Current, Input:5mA
• Voltage, Output Max:80V
• Case Style:SOIC-16
• Temperature, Operating Range:-55°C to +110°C
• Time, Fall:3µs
• Time, Rise:2µs
• Ratio, CTR Min:100%



Jeff

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Tue Jun 23, 2009 1:53 am

I fotnd one of the optos. I need somebody to confirm the specs so I knoy it will work.

ISOCOM
Newark Part Number:
40P0290
Manufacturer Part No:
ISP321-4X
RoHS Compliance : Yes
Description
• OPTOCOUPLER, DIP-16, QUAD, TR. O/P
• Channels, No. of:4
• Voltage, Isolation:5300V rms
• Output Type:Phototransistor
• Current, Input:10mA
• Voltage, Output Max:80V
• Case Style:DIP-16
• Temperature, Operating Range:-30°C to +100°C
• RoHS Compliant: Yes

Jeff

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Tue Aug 18, 2009 1:05 pm

Could someone please review this wiring diagram and tell me why it doesn't work.

Problem 1 On the encoder side of the optocupler power goes to terminal but does not pass through to the ground when a signal is present. No signal is picked up and sent to the encoder.

Problem 2 On the signal/ joystick side of the optocoupler any signal from the joystick (up, down left,right) will send a signal to the optocoupler at all the positions. We can't differentiate between signals. Is this a grounding issue? All grounds from the optocoupler are going back to the ground wire from the joystick and the ground from the multiprogrammer board.
Attachments
opt%003F_2.gif
Optocoupler output circuit
opt%003F_2.gif (93.21 KiB) Viewed 4990 times

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Thu Oct 01, 2009 8:11 pm

i'm having trouble getting input from my digital atari 2600 compatible control into my PIC chip. I have tried setting up an e-block proto board two different ways. When set up the first way (as seen at the top of the ipeg) each position on the stick gives the same signal to each slot on the screw terminal.-no signal differentiation. Signal is picked up by PIC and is passed to the output with no signal differentiate. When set-up the second way (as seem on the bottom of the jpeg) each position on the stick gives a different signal to the screw terminal, but no signals go through the PIC.
Does anybody here have any idea of what is going on and how I can fix it?

Thanks ,
Jeff
joystoPIC.jpg
(207.38 KiB) Downloaded 2902 times

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4361 times
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby Benj » Fri Oct 02, 2009 9:07 am

Hello

It is a little hard to work out what could be going wrong here as we only see a small portion of the schematic.

Here is a schematic showing a PIC and a PS2 controller
Image
http://www.curiousinventor.com/guides/ps2

And here is another good looking guide.
http://www.gamesx.com/controldata/psxcont/psxcont.htm

Neither seem to be using opto isolators, diodes or resistors between the controller and the chip in their design.

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Mon Oct 05, 2009 5:13 pm

I'm not planning on connecting the PIC directly to the Playstation 2. I want to connect to a special keyboard encoder that allows me to use it on either a PC or most previous and current game consols including the PS2. So, I need something on PIC out to act as physical switches to be seem by the encoder. The issue I need help with is getting the PIC on the multi programer to recognize five different switches from the atari 2600 digital joystick. I can only get the PIC to read one unique switch. All of the others are seem as the same switch.

Jeff

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Fri Dec 18, 2009 1:57 am

I'm trying to connect an Atari 2600 compatible digital joystick to a MatrixMultimedia PICmicro MCU Multiprogrammer and Development board EB006-00-5 through a EB002 Screw terminal Board. I'm using a PIC 16F877A-I/P on the board. I found a project that uses a PIC to make a video game that uses two Atari joysticks for player inputs called PIC Pong I made this circuit on a standard breadboard omitting player two and video output. Then I connect it to the screw terminal. When I test the set up with a multimeter I do get a drop when I push the stick in every direction or press the fire button. When set up like PONGSCH.GIF (as seen on the joytoPIC.ipeg) each position on the stick gives the same signal to each slot on the screw terminal.-no signal differentiation. Signal is picked up by PIC and is passed to the output with no signal differentiate. When set-up the second way (as seem on the bottom of the joytoPIC.jpeg) each position on the stick gives a different signal to the screw terminal, but no signals go through the PIC.
Does anybody here have any idea of what is going on and how I can fix it?

Thanks Jeff
PONGSCH.GIF
(38.8 KiB) Downloaded 2796 times
joytoPIC.jpg
(220 KiB) Downloaded 2797 times

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4361 times
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby Benj » Fri Dec 18, 2009 10:05 am

Hello

The PIC can detect two kinds of signals. Digital and Analogue.

Digital signals can be represented as a voltage. On a standard 5V PIC a voltage over around 2.5V represents a logic 1. Anything below this should be represented by a logic 0 but there is a bit of a no mans area in the middle that should be avoided.

Analogue signals require the PIC to have an onboard A to D converted and then have special analogue capable pins. The analogue pins are read by performing a routine to sample the data (eg in Flowcode you would use the ADC component to do this). The voltage is converted into a 8-bit or 10-bit signal depending on your device and the routines you call in Flowcode. An 8-bit number would have 0 representing 0V and 255 representing 5V.

This should help you to get to the bottom of why the voltages are changing but not the signals going into the PIC device.

Also note that the screw terminal board has 220R resistors on each input therefore your 1K resistors may not be needed.

As a final suggestion if you are using breadboard to prototype your circuit then please be aware that often the power lines have a break in them half way which will need to be linked across. This may be stating the obvious but it has cought me out before.

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Thu Jan 21, 2010 6:21 pm

I'm not able to differentiate between each digital inputs. I even tried using individual inputs thinking the digital joystick might be the issue. No luck. Is there a schematic of a matrix multimedia project using a screw terminal I can look at to see where my mistake was made?

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4361 times
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby Benj » Fri Jan 22, 2010 1:01 pm

Hello

The schematic for the EB002 terminals board is available in the datasheet in the datasheet section of our website.

You could try moving those 100K pull up resistors to be pull downs instead?

Are the keys multiplexed? this could exaplain why you are having problems differentiating the signals.

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby icabjeff » Tue Feb 02, 2010 12:55 pm

I tried setting up the switches going into the screw terminal with 10k pull-down resistors.(monotoscrew.jpg) I get separate signals, but they don't appear to be going into the PIC. Is 10k too much resistance for the screw terminal?
Attachments
monotoscrew.jpg
monotoscrew.jpg (65.33 KiB) Viewed 4726 times

User avatar
Benj
Matrix Staff
Posts: 14797
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4759 times
Been thanked: 4361 times
Contact:

Re: Using Flowcode to pgm an atari style joystick

Postby Benj » Tue Feb 02, 2010 3:54 pm

Hello

I see you have 220K resistors are these the resistors on the screw terminal board? If so then they are 220R resistors. Otherwise of 220K is correct to your design then I suggest you remove them.

The 10K pull down resistors should be fine to give you a logic 0 or 1 when the switch is pressed.

How are you reading the switches? It might be easy if you simply read the entire port connected to the screw terminal E-Block and then output the entire byte to a port connected to a LED E-Block.