Shop OBEX P1 Docs P2 Docs Learn Events
How to switch 8 lines — Parallax Forums

How to switch 8 lines

bytor95bytor95 Posts: 53
edited 2007-03-20 13:09 in BASIC Stamp
Hi,

I've been building a tide calculator and plan on showing the present tide height and the next high/low height using a 8x8 LED matrix (see attached photo).

I'm using a MAX7219 controller so I'm only able to show either red LED's or green because the 8 lines go to the red (or green) lines and the 8 other lines out of the MAX7219 go to the common cathode lines.

Now to make the display more interesting, all I'm really looking for is:

Tide going high (Show all Green)
Tide going low (Show all Red)

Is there a chip (like a seperate CMOS chip) that would "switch" the 8 anode contacts between 8 green LED's and 8 red LED's? I was hoping the basic stamp can just use one more pin to achieve this:

"0" = Green
"1" = Red

I hope I explained it right.

Thanks in advance!

Engin

Post Edited (bytor95) : 3/19/2007 7:49:30 PM GMT
400 x 300 - 186K

Comments

  • T ChapT Chap Posts: 4,223
    edited 2007-03-19 19:40
    You could use 8 addressable I2C 8 or 16 bit i/o expanders to get 8*16 or 8*8 LED sinking capability. PCF8574 or PCF8575 are some that are easy to use. Does the Stamp already have dedicated I2C pins? Otherwise you would need 2 pins SCL and SDA.
  • bytor95bytor95 Posts: 53
    edited 2007-03-19 19:42
    Originator,

    It seemed like you replied to my question before I hit the submit button, thanks!

    I'm using the BS2SX so I don't think I have the dedicated I2C pins.

    Engin
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-19 19:59
    You could use 4 quad optocouplers, 2 for red and 2 for green, and wire the LEDs in series/parallel (2 in series, 2 series chains in parallel). This way, you could switch them with an I/O current of maybe 20-30ma total for a set of 8. This assumes that you're using 2 I/O pins, one for red and one for green. You could cut this down by using some additional transistors to turn on one or the other set.
  • bytor95bytor95 Posts: 53
    edited 2007-03-19 20:06
    Thanks Mike,

    I'll look into the optocoupler method right now. I can tolerate using two I/O pins so that may be a great solution. Thank you very much.

    Engin
  • bytor95bytor95 Posts: 53
    edited 2007-03-20 12:42
    Mike,

    When you get a chance, can you recommend a particular quad optocoupler? I've never used them before.

    Thanks again,

    Engin
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-20 12:47
    I just Googled "quad optocoupler" and got www.vishay.com/docs/83652/83652.pdf which looks reasonable. You could also check the on-line catalogs of dealers like Jameco, DigiKey, and Mouser and they would have links to datasheets. This is a pretty basic part these days.
  • bytor95bytor95 Posts: 53
    edited 2007-03-20 13:09
    Mike,

    I just read through the one you linked and now I understand. I think that would work very intuitively.

    Thanks,

    Engin
Sign In or Register to comment.