Shop OBEX P1 Docs P2 Docs Learn Events
expanded outputs, shift registers IR pairs question. — Parallax Forums

expanded outputs, shift registers IR pairs question.

neotericneoteric Posts: 144
edited 2006-03-27 15:37 in BASIC Stamp
Sometimes its hard to make an explanatory subject line.

In the·Stampworks book, chapter http://www.parallax.com/dl/docs/books/sw/exp/sw23a.pdf·discusses expanded output using shift registers.· I am working on a project that uses·many (8 to start)·IR transmitters and·many IR recievers for proximity detection.· Can I use a 74HC165 with the detectors and a 74x595 for the transmiters, thus cutting my I/O lines usage to do this to 6 i/o pins.·

I have built the example that lets me display multiple leds using 3 i/o pins, so I understand the concept.· I guess my question is would the transmit/detect events be fast enough to do this, through the IC's?· Also, would I·transmit all of them, and then detect all of them, or would I·turn one IR on, then·check detection, then the next, then the next?
··

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-13 17:18
    I don't see how this could work since you wouldn't be able to send the FREQOUT through the shift register.· Normally you would use FREQOUT on a pin.· Using the shift register you won't be able to pulse the pin at that frequency.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 3/13/2006 5:21:16 PM GMT
  • neotericneoteric Posts: 144
    edited 2006-03-13 21:27
    Ahh.· I didn't think about the freqout command.· Duh!
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-25 01:08
    Hi neoteric, as per your request I have looked at what you want to do, and depending on what specific behavior you want/get with that many IR pairs, I see two possible solutions.

    The first is if you want to operate one pair at a time, this would be used if you find one reciever picking up the IR of another transmitter, or if its just easier for your program to handle one IR pair at a time. This solution would use 1 to 8 decoder and a 8 to 1 mux. A decoder has a single input and multiple outputs (8 for this case), which of the 8 outputs gets the input is determined by select pins (3 for an 8 output decoder). You can think of it as an 8 way digital switch. You would tie the input and select pins to the Stamp and the IR transmitters to the outputs. When you want to drive the first IR transmitter, you set the select bits to 000 and send the freqout command to the input of the decoder (001 for the second IR xmiter, 111 for the 8th etc). For the receivers you would use a multiplexer (mux), this is just like a decoder but in reverse, so you can select which IR reciever to get the signal from, you would use the same 3 select pins on the mux as the decoder. So programmatically it would be the same as just 1 IR pair, but you have to select which pair you are talking to first. This solution will use 5 pins of the Stamp (1 input, 1 output, and 3 select pins).

    The second solution is if you dont have any interference from different pairs. You would feed the output pin through a transistor and drive all 8 IR transmitters at the same time. On the input you would use a latching shift register (this clocks all 8 reciever values into the shift register at the same time to be shifted out). This solution would use 4 pins (1 output, 1 input, clock and latch).

    If you need futher explanation on either of these solutions ask, and I'll fill in with further details.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-25 16:43
    Here's the schematics for the two examples I was talking about, the first is for one channel at a time, the second is for all channels simultaneously.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
    752 x 740 - 24K
    650 x 710 - 20K
  • neotericneoteric Posts: 144
    edited 2006-03-26 15:08
    Paul,
    Wow, thanks.· I really appreciate this.· I can't get to an electronics parts store till Monday.· There is only one in town and its not open on weekends.

    I do have these, would these be refered to as Muxes and Decoders?

    http://www.parallax.com/detail.asp?product_id=602-00009· http://www.parallax.com/detail.asp?product_id=602-00010

    The pins look different.· Since I'm a noobie, I will probably want to use the items you have provided the schematics for.

    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-26 18:49
    No, the parts you have is a serial to parallel shift register (sometimes called a serial in/parallel out register or SIPO), and a parallel to serial shift register (sometimes called a parallel in/serial out register or PISO). The PISO (the 74HC165) is the IC used in the second example. If you have a npn transistor laying around and an extra 1K resistor you can implement the second setup assuming you dont experience alot of interference between IR pairs. But I have thought about it some, and I dont think there is much of an issue with interference. Basically the second setup creates a 8 point star illumination around your bot, and if you have the receivers pointing in unique spots, I dont think it is critically important if a receiver is picking up an object illuminated by another IR transmitter, whats important is that the object in that semicardinal direction (0º, 45º, 90º, 135º, 180º, 225º, 270º, 315º) is detected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • neotericneoteric Posts: 144
    edited 2006-03-27 15:04
    Paul,

    I understand.· What confused me is I misread the part on the first diagram and second diagrams input IC's·as being the same.· D'oh.

    I am going to attempt to build the second prototype till I get the first schematic's items.· I am in this for the learning, so I am going to build both, although the second actually features several advantages.··· I will let you know.

    Thanks again for helping me with this. I really really appreciate it.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-27 15:37
    No problem, glad to help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
Sign In or Register to comment.