Shop OBEX P1 Docs P2 Docs Learn Events
awesome console plan — Parallax Forums

awesome console plan

dfletchdfletch Posts: 165
edited 2008-03-25 06:32 in Propeller 1
I'm a bit proud of this and just had to share. This is going to be so cool!

Using the joysticks in 8-way configuration with an SD card for the sound and VGA output this will use all 32 pins!

The modeling software I did this with is really neat! sketchup.google.com/ It has this great feature where it uses google.com to find and import models directly. The Happ joystick and pushbuttons I planned on using were in there! There's decent models in a search for "LCD" and "speaker" too.

UPDATE: Took QuattroRS4's advice and made it friendly for lefties too!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Join us in the Un-Official Propeller IRC channel: irc.freenode.net #propeller
Newbies, oldies, programmers, math professors, and everyone in-between welcome!
Propeller IRC howto
spinc - open source Spin compiler

Post Edited (dfletch) : 3/25/2008 7:06:07 AM GMT
1596 x 1070 - 186K
1596 x 1070 - 166K
«1

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-22 09:11
    So you are planning on using
    8 pins for each joystick = 16
    1 pin for each button = 2
    4 pins for SD card = 4
    8 pins for VGA = 8
    2 pins for speakers = 2
    TOTAL 32 pins

    But you still need 2 pins for the eeprom and 2 pins for the programmer.

    You could save a lot of pins by using shift registers for your joysticks and buttons like on the Hybrid.

    Nice layout though.
  • dfletchdfletch Posts: 165
    edited 2008-02-22 09:13
    Ah excellent Steven thank you! I was wondering if there was a way to reduce the joystick footprint (half is rough!). Now maybe I can drive those smaller speakers separately scool.gif
  • dfletchdfletch Posts: 165
    edited 2008-02-22 09:17
    Oh isn't there some circuitry that can allow me to use the programming and eeprom pins? I thought all pins were accessible after boot. Is this a limitation of the protoboard?
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-22 09:19
    If you hook them up to the right pins you would be able to use the drivers that have been developed for the hybrid and hydra which will make life much easier. Just a suggestion, have a look at the connections that the hydra and hybrid have and that will give you a good idea of what you can connect. If you want just for games, note that many of the games are only coded for TV and not VGA at the moment. (mainly because the hydra doesn't have VGA)
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-22 09:21
    dfletch said...
    Oh isn't there some circuitry that can allow me to use the programming and eeprom pins? I thought all pins were accessible after boot. Is this a limitation of the protoboard?
    You can hook them up to anything after the prop is running, however, either the eeprom or serial needs to be collected to load the initial program into the prop. After this is finished you can connect anything you like.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2008-02-22 09:28
    dfletch,
    Looks like we are assuming all players are left handed !
    Perhaps the Joysticks shoule be central ?

    JT

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • dfletchdfletch Posts: 165
    edited 2008-02-22 09:28
    I'm not one to do things the easy way [noparse];)[/noparse]

    I believe I'll use my own VGA driver derived from my learning driver, and my own graphics/sprite lib. I'm not in any hurry, and want to make this excellent.

    The opposing controls mean text / graphics in both directions. This whole thing is a fun challenge for me and a way to learn all about every aspect of the prop.

    Cheers,

    --fletch
  • dfletchdfletch Posts: 165
    edited 2008-02-22 09:29
    QuattroRS4: Don't most games have joystick on the left? Righties hit that button faster with the right hand I do believe tongue.gif
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2008-02-22 09:32
    Not into gaming .. but I will take your word for it ... how about a central joystick with a fire button either side ?
    If not I stand corrected in terms of gaming posture ! ..Looks well though ..nice idea..

    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • dfletchdfletch Posts: 165
    edited 2008-02-22 09:35
    Hmm $5 more in pushbuttons and a slight redesign to appease the lefties. I suppose I could manage that smile.gif

    Good point John, Thanks!
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-22 09:40
    stevenmess2004 said...
    (mainly because the hydra doesn't have VGA)
    WHAT???

    @fletch: It is common to multiplex slow input devices as buttons or (digital) joysticks. And a 4-way jouystick should have 4 relevant lines, not 8.

    If you are not familiar wit multiplexing you should learn it - it is one of the 10 basic techniques needed to use microcontrollers with some proficiency smile.gif

    Though 74HC chips generally come down to 30 cents, I like the $2 PCA8574 best. It connects to Pins 30 and 31 and that's ist. Have a look at my "Small I2C Driver" I posted two or three months ago giving an example for it's usage.

    Post Edited (deSilva) : 2/22/2008 9:45:10 AM GMT
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2008-02-22 09:42
    dfletch,
    Not a 'leftie' myself but was just looking at your image and it occurred to me ... keep us posted on progress..

    Regards,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-22 09:44
    Sorry, is it the hybrid that doesn't have a VGA port then?
  • dfletchdfletch Posts: 165
    edited 2008-02-22 09:56
    deSilva: Yep those joysticks can be configured 4 or 8 way. I'll pick 8 because it will be smoother game play. Thanks for the great tips on multiplexing!
  • dfletchdfletch Posts: 165
    edited 2008-02-22 10:10
    Ok sweet so the pins would now be:

    (4) connected to 2 PCA8574's
    (2) one each for each player's button (or I could go nuts and do up to 8 total buttons and one use one more PCA8574 here)
    (8) VGA
    (4) SD
    (4) audio

    22 pins, serious room to spare now!

    What else could I hook up to it? I could put a ring of LEDs around the whole thing with all the pins I have left [noparse];)[/noparse]
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-22 10:15
    Leave some pins free. At some stage you may want to hook up other things like the Hydra memory card or even hook more pins up to the VGA so that you can get more colors. You may also want to add some PS2 for keyboard mouse. Don't forget that you will have to be careful to what you connect to the pins for serial and eeprom. You will need the eeprom or serial so that you can get a program into the propeller.
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-22 10:46
    dfletch said...
    (4) connected to 2 PCA8574's
    Even better: it's just (2) - pins 28 and 29. You can connect upto 8x 8574 and another 8x 8 8574A... That's why I2C is called a "bus" smile.gif
  • dfletchdfletch Posts: 165
    edited 2008-02-22 10:59
    deSilva: Oh yes, duh! It's 3am here, brain not quite fully active [noparse];)[/noparse]

    That gives me an idea! I can pick up similar chips from my regular supplier but they're SO-16. Looks like I can fit 3 on a piece of schmartboard, which gives me lots of inputs on a nice standoff board.
  • BaggersBaggers Posts: 3,019
    edited 2008-02-22 12:26
    dfletch,
    you only need 1 pin for mono audio or 2 for stereo, no need to waste 4 pins on it [noparse]:)[/noparse]
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-22 13:30
    There is a range of similar port expanders, e.g.
    MCP32017 ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf with already 16 I/Os in PDIP-28 or QFN
  • dfletchdfletch Posts: 165
    edited 2008-02-22 16:03
    Baggers: 4 way sound! Actually what I'm going to do is have music on the 2 big speakers and sound fx on the smaller pair.

    deSilva: yep it's just my supplier doesn't have any of the DIP packages. I could shop around, but I'm a bit lazy [noparse]:)[/noparse] Any idea where to order them in the US? (mouser is the one with only SO-x options).
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-22 16:13
    digikey has both as PDIP I am sure... Or try an eBay-shop
  • DgswanerDgswaner Posts: 795
    edited 2008-02-22 17:24
    Dfletch! love the lay out, and good to see someone else using sketchup! I love that program! even with all of the talk about being short on I/o pins, I go with more than one button, one button will really limits the games you can play,

    would love to see the rest of the table or what ever it's going to be, don't for get cup holders!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • dfletchdfletch Posts: 165
    edited 2008-02-22 20:10
    Hmm the pins on those multiplexers could be used for output too it seems. Maybe I'll use a few of the 16 bit chips as deSilva mentioned, and use some 3-bit decade counters and 8 segment LED displays to show the score. It solves the problem of having to show the scores upside down (the multi-player game is going to be simultaneous if I can manage it).

    Dgswaner: Thanks, I'm glad you like it! This box though is going to be given away to someone, and will only play 1 game - it's a fancy "resume", and the game will be my life - building RC gadgets as a kid, learning programming as a young adult, development work as an adult. It will all be shown top-down style and be very 80's arcade, but the audio will be much better than that smile.gif

    If this all goes well, I'll build one for myself! That next rev will have (hopefully) 2 trackballs in addition to the joysticks, more buttons, and an external slot for the SD card for easy updating.

    Cheers,

    --fletch
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-22 20:36
    dfletch said...
    Hmm the pins on those multiplexers could be used for output too it seems
    Just check my "Small I2C Driver" forum link, it's all in it and you need no speculation smile.gif The outputs are Open Collector however. Though I shouldn't say "however", because this can be and generally is a graet advantage. But they only SINK current - of course.
  • dfletchdfletch Posts: 165
    edited 2008-02-22 21:21
    deSilva: Ah I see. So I can't directly connect the multiplexer to a decade counter. I wonder if it's simpler to put some transistors between the multiplexers and the decade counters, or if it's easier to add more multiplexed outputs and connect directly to the LEDs. I'll have to sketch up both designs and see how complex they look. Maybe the LED idea isn't so nice - I'll see what I can come up with tonight.

    Cheers,

    --fletch
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-22 21:43
    You can use common anode displays and save the counter... The advantage is you then can display ANYTHING on them.

    Using a counter is fine, but you will need the reset in any case, thus 2 lines at least. Of course you can control the counters by the PCF-chip! Just add the (pull-up) resistor (=10 k or such) smile.gif This is a genal misunderstinding .. The PCF chip is extremely versatile!
  • dfletchdfletch Posts: 165
    edited 2008-02-23 18:14
    deSilva: Great, thanks for the digikey tip. I'm thinking of making a small order just to get ahold of their catalog!

    I'm still slightly confused about this output. So the pull up resistor turns it into a normal positive output?

    Cheers,

    --fletch

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Join us in the Un-Official Propeller IRC channel: irc.freenode.net #propeller
    Newbies, oldies, programmers, math professors, and everyone in-between welcome!
    Propeller IRC howto
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-23 18:59
    smile.gif I see - this is a matter of dirty electronics, but you got it more or less...
    For more clarity I enclose the circuitry from the datasheet.

    A pin can be programmed as HIGH, which means
    - EITHER ready for input, however as it is biased to HIGH it behaves a little bit like the OLD TTL inputs, so pull-ups are not needed in most cases....
    - OR you use it for output but may only draw a very low current (100µA) out of it. That is quite different from standard CMOS outputs, but it suffices to drive a LS-TTL load or just keep the voltage up.

    If the pin is programmed to LOW it will be low and can sink upto 25 mA.

    As I see it now it does not even seem necessary to add an extrnal collector resistor even when using it as output, as long as you will not need more than 100µA, corresponding to a 33k resistor.

    To give you an example:
    An LED should be conected to PLUS 3V using a 150 Ohms resistor (PIN -- short end LED long end -- resistor -- PLUS)
    This is sometimes called "negative logic", as setting it LOW it shines, and setting it HIGH it does not smile.gif
    You can never conect it to GND as you generally do!

    However you can connect it as follows:
    (PLUS -- 150 Ohms resistor (+) LED -- GND)
    Then tap the point (+) between LED and resistor by the output pin
    This is POSITIVE logic. The current for the LED comes straight out of the external "collector" resistor and does not load the chip! However when you switch off the LED this happens by short-circuiting the LED.. NOW all the current flows though the chip.

    This is not a very advantagious situation, but many things are possible...

    Sorry to have confused you, but is simpler than you now think. But I start to understand now why these chips tend to be less popular among hobbyists....

    Post Edited (deSilva) : 2/23/2008 7:09:29 PM GMT
    827 x 458 - 28K
  • dfletchdfletch Posts: 165
    edited 2008-03-16 20:05
    Cool smile.gif I've ordered 2 joysticks, 4 buttons, 4 speakers, 25 PCA9555s, and 20 common anode 7-seg LCD displays. Few extras of the PCA9555 and 7-segs because they're very handy.

    I've made the beginnings of the layout for the expander card (screenshot). All the expanded IO lines are there, just need i2c and power lines.

    This is going to be so cool scool.gif

    I'll post pics of the steps as I built it.

    Cheers,

    --fletch

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Join us in the Un-Official Propeller IRC channel: irc.freenode.net #propeller
    Newbies, oldies, programmers, math professors, and everyone in-between welcome!
    Propeller IRC howto
    spinc - open source Spin compiler
    936 x 671 - 11K
Sign In or Register to comment.