Shop OBEX P1 Docs P2 Docs Learn Events
homemade controller for a top secret project under development. — Parallax Forums

homemade controller for a top secret project under development.

SONIC the HedgehogSONIC the Hedgehog Posts: 321
edited 2012-02-21 09:47 in Propeller 1
its been awhile since ive posted, but ive got a top seret hardware masterpiece in the making! So here are a few photos and a video showing functionality will be coming soon!

!
P01-17-10_03-20[1].jpg
P01-17-10_03-20.jpg
P01-17-10_03-20[2].jpg
320 x 240 - 19K
320 x 240 - 20K
320 x 240 - 24K
«1

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 19:32
    Hmm - 4 buttons and a propeller chip.

    Clearly you are trying to emulate the game Sonic on a propeller!

    And don't laugh. Some of this has already been done.
    CPU: Motorola 68000 at 7.61 MHz
     - 1 MByte (8 Mbit) ROM Area
     - 64 KByte RAM Area
     Co-Processor: Z80 @ 4 MHz (Not Present in MK-1631)
     - Controls PSG (Programmable Sound Generator) & FM Chips
     - 8 KBytes of dedicated Sound Ram
     Graphics:
     - 64 simultaneous colors of 512 color pallete.
     - Pixel resolution: 320 x 224
     - VDP (Video Display Processor)
     - 3 Planes: 2 scrolling playfields, 1 sprite plane 
     Sound:
     - PSG (TI 76489 chip)
     - FM chip (Yamaha YM 2612)
     - 6-channel stereo
     - 8 KBytes RAM
     - Signal/Noise Ratio: 14dB
    
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-19 19:36
    Actually it's eight buttons! And yes, I plan on a sonic game, but right now no promises on when that will get done, because I just finished the controller driver and the controller it's self, plus I still have a few kinks to work out, plus all the other drivers. But I'm currently reading about game development for the hydra, and will get some good techniques from it! I've got a video showing it's functionality turning LEDs on and off, but I plan on uploading that tomorrow.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-19 19:41
    Oh and not just emulate, but recreate! Same sprites, new game levels and the possibility of new music. But right now that's a dream until I get my "console" working in a prototype state.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 19:43
    Cool! See the list in my last post - I think those are the specs. Z80 and 76489 are already done. Not sure about the 68000 but the ram and speeds would be well within the propellers capability.

    The display is tricky - 320x224 with a 512 color palette. Up until recently I would have said no, as that is too many colors in the palette for the TV and VGA drivers. But with the ILI9325 touchscreen 320x240 and a palette of 64k colors, this is quite possible.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-19 19:47
    Ah I didn't see the specs above, but thanks! In terms of genesis specs you are spot on! But before trying that, I might reconstruct a master system, since the Z80 and the PSG emulators for the hardware required already exist, but a genesis propeller does not seem far fetched. I will have to look into that!
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-19 19:51
    It's very interesting and marvelous in fact! But I'm a little confused about RAM and ROM management. I know several cogs are involved, but the global ram is 32k which isn't enough for 64k or 1Mb(clearly) so is some expansion necessary? And also where cld I find some EEPROM or RAM chips, and how would I wire them with the one I already have?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-19 20:13
    You won't need eeprom - use an SD card instead. For emulations this 512k memory chip has proved very useful http://www.futureelectronics.com/en/technologies/semiconductors/memory/static-ram/asynchronous/Pages/5985502-AS6C4008-55PCN.aspx?IM=0

    Searching 68000 and propeller on google throws up some intriguing links.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-19 20:15
    Your genius is showing! Good idea! I'll check it out!
  • codevipercodeviper Posts: 208
    edited 2012-02-19 21:21
    looks cool but one thing fun a parallel to serial shift register will let you use the NES wire up style and lots of buttons with few pins
    my prop chip is in a box with a controller made of push buttons with a 74hc166 is 8 bit parallel in serial out so it works just like the NES controller
    but you can lay out your buttons as you please
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 06:24
    Yes, but if I wanted to use n nescontroller, I would get one that works and solder the connectors on my el' jugador. Thanks though, all help is appreciated!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-20 13:02
    Sonic,

    I couldn't tell from your pictures if you've got pull-up or pull-down resistors on your buttons.

    Here's a little circuit that is commonally used.
    *************************************************
        Push Button Schematic
    *************************************************  
                     3.3V
                              button
                       10KΩ   ─┻─
      Prop Pin  ─────┻────────┘ └─┐
                                   
    *************************************************
    

    There are lots of different ways of reading push button inputs but the schematic above is about as simple as it gets.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 13:07
    Pull-ups.......Pull-ups....oops, that's the one thing I forgot....
    I was thinking about resistor values to use, but ended up leaving them out because I'm using +3v, so I figured that would be fine, and its working okay, except I've got wires everywhere, so some buttons get randomly sensitive.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-02-20 13:25
    Neat breadboards make happy signals!


    (don't ask me how I know this!)
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 13:37
    That was my main concern from the start....will it fit, and will it interfere. The only interference I usually get is when I nudge the wires, not so much the pressing of the buttons. But I'm still working out kinks and adding some more functionality features.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-20 13:57
    I was thinking about resistor values to use, but ended up leaving them out because I'm using +3v, so I figured that would be fine, and its working okay, except I've got wires everywhere, so some buttons get randomly sensitive.

    They would be randomly sensitive because you have no pullups! Duane's circuit solves the problem.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 13:58
    Toch
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-20 14:18
    Sonic,

    I'm curious how you have these buttons wired if you're not using pull-up or pull-down resistors.

    You really need them.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 14:21
    @Duane
    Me too.....
    Basically there is a push button switch in between a prop pin and a supply of +3v.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-20 14:28
    @Duane
    Me too.....
    Basically there is a push button switch in between a prop pin and a supply of +3v.

    Add a 10K resistor from the Prop pin to ground (always connected no matter the button state) for each button. You wont have to change your code and the button will be much more reliable.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 14:33
    Ahh....now that makes sense! Thanks a bunch for the help Duane! And Dr. Acula.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-02-20 16:15
    @Duane re post #20
    Add a 10K resistor from the Prop pin to ground (always connected no matter the button state) for each button. You wont have to change your code and the button will be much more reliable.

    Pull up vs Pull down. You can choose either. Back in the olden days the way 74xx TTL logic worked, a pullup used less current than a pull down resistor. So pull ups became a convention. With modern chips this does not matter.

    With a pull up, the resting state of the pin is "High" and the pushed state is "Low" so that might need a software inversion. So that might be an argument in favor of a pull down, where resting is "Low".

    It does not really matter in the end. What you don't want is a floating pin, picking up stray RF from your local radio station and randomly flipping high and low.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 16:18
    Thanks for the info, I just added the pull down resistors.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-20 17:26
    Dr_Acula wrote: »
    @Duane re post #20

    Pull up vs Pull down. You can choose either. Back in the olden days the way 74xx TTL logic worked, a pullup used less current than a pull down resistor. So pull ups became a convention. With modern chips this does not matter.

    With a pull up, the resting state of the pin is "High" and the pushed state is "Low" so that might need a software inversion. So that might be an argument in favor of a pull down, where resting is "Low".

    It does not really matter in the end. What you don't want is a floating pin, picking up stray RF from your local radio station and randomly flipping high and low.

    I initial suggested pull-up resistors since they seem to be the norm. Now I know why, thanks. I suggested the pull-downs after Sonic told us how his circuit was wired. I figured with the pull-down resistors Sonic wouldn't have to modify his code.

    In other words, I agree with you. :smile:
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-20 17:28
    To the both of you:
    Added the resistors like you two suggested, I played TRON light cycles with some code I modified by OBC! Thanks OBC, and Dr. Acula, and Duane!
  • codevipercodeviper Posts: 208
    edited 2012-02-20 22:07
    if you intend to make a sonic game on the PROP you my run low on pins real fast
    8 pins per player with direct buttons 16 pins for 2 players 3 for TV DAC one for audio 2 for eeprom and most of the ram boards might take 4 to what 10 pins?
    so we are already up to 24 to 32 pins and well thats all your pins

    i just want to clarify the GENY had a D pad and a mode and A B C buttons.
    the NES had D pad select start and A and B buttons
    point its the same a 4 position D pad and 4 buttons just different names on the buttons
    the case has an fold up lcd on it, and on my SD card i have lots of the games like load runner defender and dodgey kong modded to my layout.

    i recommend you save pins and use some discrete logic chips to shift in data from your buttons you would reduce your foot print down from 8 pins per player to 4 pins for 2 players my home made controller looks noting like a nes controller with just a d pan on one side and 4 buttons on the other side.
    I'm just trying to be helpful, and trust me this is easier then it sound. i can post a circuit schematic if you like.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-21 04:32
    One of my original thoughts was also that, but I lack any logic chips that can shift data, or at least I think, so a schematic would be helpful, along with a logic chip you recommend. Thanks for the help, I'll think about it, but I alread have enough pins for another controller if I decided to use it.
  • SarielSariel Posts: 182
    edited 2012-02-21 06:28
    For shift registers, I have had great sucess with the 74HC165's for inputs. Here is the schematic I use for it.

    165.jpg


    And the object I have used can be found in the obex... here!

    http://obex.parallax.com/objects/616/
    697 x 454 - 47K
    165.jpg 46.7K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-21 06:48
    There are several ways to use more buttons with fewer pins but I'd suggest using a very simple interface until you gain some more experience.

    Once you can use button presses to control the logic in your program you can look for ways of decreasing the pin count of your button pads.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-21 07:02
    Alright! That's boss, Sariel.
  • SONIC the HedgehogSONIC the Hedgehog Posts: 321
    edited 2012-02-21 07:03
    Thanks for the help to all of you I appreciate it! I think I will stick with my current idea because like Duane said, I lack experience.
Sign In or Register to comment.