Shop OBEX P1 Docs P2 Docs Learn Events
reading lots of switches with 74148 priority encoder — Parallax Forums

reading lots of switches with 74148 priority encoder

ArchiverArchiver Posts: 46,084
edited 2002-06-23 15:10 in General Discussion
Hello All,

I want to be to read 4 banks of 16 switches using the BS2. I know that
the 74148 encoder can read 8 switches, but I was wondering if there was
a 16 switch to 4 bit binary model. That way the 4 of them would fit on
the BS2's 16 pins.
I know there is a 74150 that allows you to select one of 16 pins and
read the state of that, but four of those consumes too 4 pins to many
for the bs2. Also, it would be more convenient to let the hardware do
the priority encoding.

Are there any solutions anyone can suggest?

Thanks in Advance,
-Paul Jordan

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-06-23 02:05
    >From: "Paul Jordan" <automations@c...>
    >Reply-To: basicstamps@yahoogroups.com
    >To: <basicstamps@yahoogroups.com>
    >Subject: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority encoder
    >Date: Sat, 22 Jun 2002 10:23:57 -0700
    >
    >Hello All,
    >
    >I want to be to read 4 banks of 16 switches using the BS2. I know that
    >the 74148 encoder can read 8 switches, but I was wondering if there was
    >a 16 switch to 4 bit binary model. That way the 4 of them would fit on
    >the BS2's 16 pins.
    > I know there is a 74150 that allows you to select one of 16 pins and
    >read the state of that, but four of those consumes too 4 pins to many
    >for the bs2. Also, it would be more convenient to let the hardware do
    >the priority encoding.
    >
    >Are there any solutions anyone can suggest?
    >
    >Thanks in Advance,
    >-Paul Jordan
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.


    What about using a parallel to serial shift register/s?


    Paul


    _________________________________________________________________
    Join the world’s largest e-mail service with MSN Hotmail.
    http://www.hotmail.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-23 02:13
    Sounds promising, can you elaborate?
    -Paul Jordan

    Original Message
    From: P L [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=gG39A6DadPP3qEcHEmgfEFaPFxrU5oQnW1tEQoLJS6kmFsZEVPEJg18-4fNFLe7Ct5_OcQZ0xGgJBP_Rp5cP]plugger02@h...[/url
    Sent: Saturday, June 22, 2002 6:06 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority
    encoder

    What about using a parallel to serial shift register/s?
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-23 03:01
    I haven't had any experience with them myself and so I'm not all that
    knowledgeable about them. Basically a paralell to serial shift register,
    will take many inputs, and convert the states of all inputs to stream of
    information on a single pin(also needs 2 timing pins). The SHIFTIN command
    is designed to read the data stream from the shift registers, and place the
    output into a variable. The most common shift registers are 8-bit, which
    would allow 8 switches per device. You can also chain shift-registers
    together to increase the effective ratio between output and input pins.

    As I said I can't really help you all that much with them. I think there may
    be application documetation on the parallax site. The stamp manual V1.9 has
    some info shift registers, but the newest manual lacks this information. If
    parallax is listening - why did the new PDF manual cut out all the
    application info? I thought the old manuals with the extra application info
    where much better.

    Paul


    You can use the SHIFTIN command to read

    >From: "Paul Jordan" <automations@c...>
    >Reply-To: basicstamps@yahoogroups.com
    >To: <basicstamps@yahoogroups.com>
    >Subject: RE: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority
    >encoder
    >Date: Sat, 22 Jun 2002 18:13:20 -0700
    >
    >
    >Sounds promising, can you elaborate?
    >-Paul Jordan
    >
    >
    Original Message
    >From: P L [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=2Nac_CNcq0n3pNOgqKqD1KdYuO6qfm7sfDKrMbluRAXnAkncO6EVYfYUZaZM8xXQIv0J5qPbyDh4n4o2PVMUJg]plugger02@h...[/url
    >Sent: Saturday, June 22, 2002 6:06 PM
    >To: basicstamps@yahoogroups.com
    >Subject: Re: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority
    >encoder
    >
    >What about using a parallel to serial shift register/s?
    >


    _________________________________________________________________
    Chat with friends online, try MSN Messenger: http://messenger.msn.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-23 04:27
    Try the Parallax site in stamps in class they have a chapter on Input and
    output using the BS2, The 74LS165 are 8 bit devices that can be cascaded
    for any number of inputs. The 74LS595 is your equivalent output. Both work
    serial/paralell and I have had no problems using them.

    Best of luck in your project
    Eric
    Original Message
    From: "P L" <plugger02@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Saturday, June 22, 2002 10:01 PM
    Subject: RE: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority
    encoder


    >
    > I haven't had any experience with them myself and so I'm not all that
    > knowledgeable about them. Basically a paralell to serial shift register,
    > will take many inputs, and convert the states of all inputs to stream of
    > information on a single pin(also needs 2 timing pins). The SHIFTIN command
    > is designed to read the data stream from the shift registers, and place
    the
    > output into a variable. The most common shift registers are 8-bit, which
    > would allow 8 switches per device. You can also chain shift-registers
    > together to increase the effective ratio between output and input pins.
    >
    > As I said I can't really help you all that much with them. I think there
    may
    > be application documetation on the parallax site. The stamp manual V1.9
    has
    > some info shift registers, but the newest manual lacks this information.
    If
    > parallax is listening - why did the new PDF manual cut out all the
    > application info? I thought the old manuals with the extra application
    info
    > where much better.
    >
    > Paul
    >
    >
    > You can use the SHIFTIN command to read
    >
    > >From: "Paul Jordan" <automations@c...>
    > >Reply-To: basicstamps@yahoogroups.com
    > >To: <basicstamps@yahoogroups.com>
    > >Subject: RE: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority
    > >encoder
    > >Date: Sat, 22 Jun 2002 18:13:20 -0700
    > >
    > >
    > >Sounds promising, can you elaborate?
    > >-Paul Jordan
    > >
    > >
    Original Message
    > >From: P L [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=WSDxdU7WkyfgWWJ5RlXrnwdKid6H2s1Qly8Bj6XTXJH7mSgLNKeIyGfIfzw-Lks37ddqzZdSvA09d4EV]plugger02@h...[/url
    > >Sent: Saturday, June 22, 2002 6:06 PM
    > >To: basicstamps@yahoogroups.com
    > >Subject: Re: [noparse][[/noparse]basicstamps] reading lots of switches with 74148 priority
    > >encoder
    > >
    > >What about using a parallel to serial shift register/s?
    > >
    >
    >
    > _________________________________________________________________
    > Chat with friends online, try MSN Messenger: http://messenger.msn.com
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-06-23 15:10
    Just because the 74150 has four inputs doesn't mean that four separate
    inputs for each of the four devices is required for operation. You
    could parallel four inputs from four devices and then use an enable pin
    on each one to select it's value. This would require eight stamp input
    pins. The problem with using shift registers is that variables on the
    stamp are limited to 16 bits. A shift register chaining more bits than
    this may have some software issues that might be difficult to deal
    with. Certainly 4 - 16 bit shift registers would probably require less
    wiring than 4 74150 priority encoders, but the shift registers would
    lose the priority encoding, unless you could figure a way to do it in
    software.

    HTH,

    Leroy
    N8VRC

    Paul Jordan wrote:
    >
    > Hello All,
    >
    > I want to be to read 4 banks of 16 switches using the BS2. I know that
    > the 74148 encoder can read 8 switches, but I was wondering if there was
    > a 16 switch to 4 bit binary model. That way the 4 of them would fit on
    > the BS2's 16 pins.
    > I know there is a 74150 that allows you to select one of 16 pins and
    > read the state of that, but four of those consumes too 4 pins to many
    > for the bs2. Also, it would be more convenient to let the hardware do
    > the priority encoding.
    >
    > Are there any solutions anyone can suggest?
    >
    > Thanks in Advance,
    > -Paul Jordan
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.