Shop OBEX P1 Docs P2 Docs Learn Events
I am porting a program I wrote for the Hydra to a Propeller chip protoboard — Parallax Forums

I am porting a program I wrote for the Hydra to a Propeller chip protoboard

TonyATonyA Posts: 226
edited 2007-07-25 21:54 in Propeller 1
I wrote a program for the Hydra, which uses the gamepad_drv_001.spin, and the NS_sound_drv_051_22khz_16bit.spin.

I'm using a 10 MHz crystal (20pF) on the Propeller.

The program worked great on the Hydra.

But now I have a Propeller chip on my breadboard, using only one NES gamepad port connector, and·an original 8bit·NES gamepad. (I did not include the 2nd gamepad port, as on the Hydra).

So the program loads into my eeprom chip, everything seems good here.

I do get a tone (sound) produced from P7, however it is not controllable with the NES gamepad as it was with the Hydra. With the Hydra I was able to press certain buttons on the gamepad that came with the Hydra, and produce tones selected by each button.

The tone I do get now is a looping constant pitch. So I'm thinking it's probably something going on with my gamepad port connection. I am using the same pins described in the gamepad driver doc;

P3 joy_clk
P4 JOY_SH/LDn
P5 JOY_DATAOUT_1
P6 (left unconnected, because I am only using one gamepad port)

Would it make a difference if when using the above gamepad driver that I leave the 2nd gamepad port out, and P6 floating?

On the Hydra both gamepad ports shared the same clock and latch lines going into the Propeller chip.
(So I wonder if by only wiring one gamepad port is causing my glitch).

I am using an original 8bit NES gamepad, instead of the NES-style·gamepad that came with the Hydra.

Thanks for any advice.

Tony

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-07-25 19:56
    You shuold do a litle debugging (i.e. outputting the readings from the game pads to the video, or if you cannot do that to a PC terminal emultaror, or if you cannot connect that use an LED to conform some situations. When you connect the LED to pin 0 you are compatible with the hydra and can counter check.

    My only idea is, that you used the pad #0 on the hydra rather than pad #1
  • TonyATonyA Posts: 226
    edited 2007-07-25 20:26
    Thanks.

    I'm going to try to hook it up to my tv and run the gamepad_read.spin and see what happens.

    It turns out now that it does kind of respond to the button presses, but not like it did on the Hydra. I thought maybe the gamepad that came with the Hydra was somehow different than the original NES gamepad.

    On the Hydra, the gamepad control port pin 7 is connected to +3V, I tried to connect mine to +5V, and it did seem to work better, but still screwed up.

    So if it's not the gamepad, I thought maybe it could be that the clock isn't correctly set.

    (As in my other post about setting the clock. I am using· 10 MHz external crystal, and I need the Propeller to run at 80MHz)



    Thanks again.

    Tony
  • deSilvadeSilva Posts: 2,967
    edited 2007-07-25 20:30
    The hydra uses a 10 Mhz crystal as well... What happens when you plug your game pad into the hydra?
  • deSilvadeSilva Posts: 2,967
    edited 2007-07-25 20:37
    TonyA said...
    On the Hydra, the gamepad control port pin 7 is connected to +3V, I tried to connect mine to +5V

    No, you should not do that!!!
    the 4021 chip inside the NES won't care, but it will then output signals with 5V that should not be connected to the Prop without current protection! However the CMOS chip has only a limited current output and the Prop will not have been harmed, but this could be a cause of your trouble. Anyway, do rewire it to 3.3 V asap!
  • TonyATonyA Posts: 226
    edited 2007-07-25 21:06
    I'll switch it back to 3V, but it worked virtually the same either way.

    I'm going to do some trouble shooting.

    Thanks.
    Tony
  • TonyATonyA Posts: 226
    edited 2007-07-25 21:54
    Well, I finally got it to work. It turns out that the gameport connector I was using had different colored wires than what was described in the book,·and this caused a lot of confusion.

    Thanks for the help.

    Tony

    Post Edited (TonyA) : 7/25/2007 10:18:24 PM GMT
Sign In or Register to comment.