Shop OBEX P1 Docs P2 Docs Learn Events
using TTL chips to substitute for the missing i/o pins — Parallax Forums

using TTL chips to substitute for the missing i/o pins

dr_eggman198dr_eggman198 Posts: 15
edited 2005-07-01 21:18 in BASIC Stamp
I am developing a circuit that plays tic tac toe with a human. In my circuit, there are 18 variables, and the basic stamp 2 only has 16 i/o pins. WOuld I be able to use TTL chips to substitute for the missing i/o pins? Also, would I be able to send 1.5 volts from a battery to one of the i/o pins if it were set to input, or would that cause a short circuit in the basic stamp?

Post Edited By Moderator (Chris Savage (Parallax)) : 7/1/2005 7:19:41 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-01 19:20
    Hello,

    ·· Do you require 18 variables, or 18 I/O lines?· If you need more I/O lines, there are several ways to accomplish this.· It would help to have more information on exactly how many I/O lines you need, and whether they need to be input or output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-01 19:28
    Doc,

    How would you do this if you had a 4x4 grid? -- I'm curious about your intended approach.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • dr_eggman198dr_eggman198 Posts: 15
    edited 2005-07-01 19:38
    the grid is 3X3, and the computer (basic stamp) would be x, and the human would be O. There are 9 red LEDs, and 9 blue LEDs. Each square has a red LED, a blue LED, and a switch. THe switch is for human input. the computer always starts first, by lighting up the blue LED on the bottem left hand corner. THen it waits until the human pushes a switch to light up a red LED, which represents O. I intended to assign each blue LED to the output pins (9 pins) and assign the red LEDs to input pins ( 9 pins). so 9 pins will be set to input, and 9 would be set to output. whenever a red LED is engaged by the human, the current from the battery which is powering the led would also go to the basic stamp pin, so that the basic stamp will know where the human chose to move. and based on where the human chose to move, it will decide whihc blue LED to turn on. THe basic stamp will either win or cat in every game.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-01 19:49
    Hello,

    ·· Are these switches toggle switches, or pushbuttons (Momentary).· I am trying to understand how connecting the Red LEDs to inputs will work, unless they're hard-coded somehow.· Personally I would use a couple of 74HC595's for the LEDs.· You could control all 18 from 3 Stamp pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • dr_eggman198dr_eggman198 Posts: 15
    edited 2005-07-01 20:34
    the switches are pushbutton, and when you turn on a switch, the signal goes to the led and to the basic stamp. so whenever you push a switch, the basic stamp would know where on the grid the red led was turned on, and it would remember this so that it could calculate where to turn on a blue led as to win the game or cat.. If I used 74gc595's for the LEDs, would I have to learn assembly language, because all that i'm familiar with is basic for the ti-89 calculator and pbasic for the basic stamp 2.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-01 20:45
    Okay,

    ·· So you're hard wiring your switch and LED so that it stays on when you press the switch?· This would mean turning off each switch after the game is done.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • dr_eggman198dr_eggman198 Posts: 15
    edited 2005-07-01 21:00
    yes, after each game the switches would need to be turned off, but how would I be able to use a 74hc595 to increase the number of i/o pins avalible?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-07-01 21:16
    Hello,

    ·· With 2 74HC595s and 1 74165, you could have all your switches and LEDs connected using only 7 I/O lines (4 for the 74xxx chips and 3 for the remaining switch and LEDs).· For examples of connecting these chips please see the StampWorks manual.· A link is provided below.· You can download it in PDF form free.

    http://www.parallax.com/detail.asp?product_id=27220

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • dr_eggman198dr_eggman198 Posts: 15
    edited 2005-07-01 21:18
    thanks.
Sign In or Register to comment.