Shop OBEX P1 Docs P2 Docs Learn Events
Using a sn74lvc244 8 bit quad output line driver? — Parallax Forums

Using a sn74lvc244 8 bit quad output line driver?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-05-12 20:31 in Propeller 1
Ok so I posted about this idea a little ways back and now im ready to build the thing...

I basically want to build a board that has 8 LED's and 9 push buttons. When the a push button is pressed i want the led to light up (that can be controlled via the prop no biggie). When the ninth push button is pressed i want it to read the binary mask of the LED pattern and send it off to the prop.

This is all pretty basic and the code should be fairly easy.. The problem is I dont want to use 17 pins to accomplish this thing. Ive glossed over the data sheet for my lvc244 and searched google a bit, and Im not understanding exactly how this thing gets wired and how it saves pins? I mean i basically have 8 outputs and 9 inputs and two lvc244 chips. Im thinking 1 chip will use 8 prop pins and supply me with 24 pins, thats what tri state output means??

Comments

  • tonyp12tonyp12 Posts: 1,951
    edited 2012-05-12 14:11
    Do you want the Prop to control the LED or just being lit while you are holding down a button (from 1 to 8)
    And with a separate press on button 9, tell the prop to read what button(s) 1-8 is down?

    How to use 9 prop pins.
    Wire 8 buttons like this, the 9th button (without a led) put the another 10k res where the 220 ohm is.
    400 x 156 - 5K
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-05-12 14:32
    I want buttons 1-8 to turn on leds 1-8 respectively. when the button is pressed the led will stay on. Since its a momentary button controlling the LEDs will probably be alot simpler using the prop than some hardware solution is what i meant. When the ninth button is pressed the prop needs to read the on off state off leds 1-8 and save it, then turn all the leds off. All this is easy enough if I were going to use 17 pins and give each component its own pin. Where i need help is understanding how to use the line driver/buffer chip to cut down on pins. And how to work with the chip with spin.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-05-12 15:04
    Above I show how to do it with 9pins, but a master-enable for LEDs (to turn them off) would need a 10th pin that goes to a single trans/mosfet between all led's and gnd

    You could go from 9 pins to 5 by using a 8-to-1 mux: (parallel to serial is also an option).
    http://www.mouser.com/Semiconductors/Logic-ICs/Encoders-Decoders-Multiplexers-Demultiplexers/_/N-4s67oZscv7?P=1z0w8z9Z1z0yyznZ1z0z44dZ1z0z5fd&Ns=Pricing%7c0
    1 pin to read the switches and 3 pins to tell what address.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-05-12 15:24
    Im sorry your schematic didnt show up before thank you very much.. What exactly is a mux?
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-05-12 15:42
    This is a 8-to-1 multiplexer, you tell the IC what logic state of a pin (1 to 8, by 3pin binary) to pass through. bonus: a inverted pin out also
    74HC151 (for up to 5v TTL the 74HCT151)
    74HC151A-circuits.jpg
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-12 16:06
    You could read 9 buttons with 6 pins directly with the Prop by treating the buttons as a 3 x 3 keypad.

    The Propeller Tool library has a 4 x 4 keypad object. You could modify it to use a 3 x 3 keypad.

    The eight LEDs could be controlled with three pins using a 595 shift register.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-05-12 16:26
    im sorry I just realized the chip in the title is for 3.3 and 5 volt signal bus conversion has nothing to do with this...

    @tonyp ok if i use your schematic I dont quite understand. I would need the pin to be an input and output at the same time.. is there a way to do that. I mean when the button is pressed i need the prop to read that then set the LED output state to 1. So then and if its 1 I need it to change to 0. I dont see a way to handel something like that with both the button and LED on the same pin
  • kwinnkwinn Posts: 8,697
    edited 2012-05-12 16:30
    Using two 74LVC244's to do this will require 9 pins. 4 pins to input/output the data from the '244's and one pin to read the condition of the 9th button.

    If you really want to use the minimum number of pins then you can use 1 '595 to drive the leds and one '165 to read the switches.

    For the '165 8 buttons would go on the 8 parallel inputs and the ninth button would go on the serial input pin.

    For the '595 the 8 leds/resistors would connect to the parallel data outputs.

    You would need 3 prop pins to drive the 2 chips. One pin would be data out to the '595 and data in from the '165, one pin would load data from the switches to the '165 and transfer data from the '595 serial register to it's output register, and one pin to clock (shift) the data.

    If you are interested I can post a block diagram.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-05-12 16:45
    Just using 4pins, I would use:
    a 74HC164 and a 74HC165
    1 prop pin for clk that is shared by both 74HC
    1 prop pin for ser-out (though no latch, it goes so fast that the LED will look off while shifting up, and then wait 1/10sec)
    1 prop pin for ser-in
    1 prop pin for button9, using hardware debounce> http://www.ganssle.com/images/debouncerrc.jpg (both 10k ohm, 0.1uF cap)

    Maybe could get button9 to be shared with ser-out that temp have dir set as input, with rather high resistor values to switch so it will have no effect on ser-out to hc165.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-05-12 17:48
    I would be intrested in the 244 diagram since i have two of them right now. Id really like to figure these chips out
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-05-12 18:11
    Not much of any prop pin savings using a 244, you could tie the 4bit output pair together and control the nibble to read with 1OE and 2OE.
    But that requires two control pins so 4input+2outputpins =6 instead of 8.
    And you would have to make sure the two OE are never both at a low state .
    So they should have a pull-up resistors while booting up.

    Using the second 244 in reverse for the LEDs would give you a 50% duty, and sharing EO with above 244 would bring count down to 11 prop pins used.
    As button 9 still can not be included in a 8bit bus.

    Or you could just use one 244 (as in the picture below)
    To read the switches you turn the prop pins around as inputs and pull the LVC244 OE pins low.
    Read the state, Set OE back high, Set prop pins as outputs for the LEDs (done quickly you should not seen them blink).
    =10 prop pins used (including button 9)
    781 x 416 - 8K
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-05-12 20:31
    As discussed unless I am missing something, you could do this with 3 or 4 lines a couple of shift registers and 8 T-flops. I think using the '244 chip gains you nothing, it is strictly a line driver whose dual purpose was increased fan-out such as would be needed for a bus structure and a tristate capability on the output, again for use in a shared bus structure. There is no latching capability in this chip. It almost sounds like you want to develop the equivalent of the old switch/led user interface of the old Altair/IMSAI days.

    You would need the toggle flops on the switches to hold the button press (press once high, again toggle low again....) until the 9th button is pressed at which time, the prop could then clock the switch states in serial fashion. If you design/selected your parts right, you might be able to combine the T-flop and shift register functions in to a single function. I do not say single chip, most octal D flops and latches have a common clock pin so setting them individually and latching the switch press may not be practical. You still even with the T-flop may need to debounce the switches in hardware. You could then serially send to another shiftregister the leds that you want lit up. If you don't want or your design can not tolerate the shift of high and low, you can use a chip with output latch or add an external level of latches to effectively double buffer the output shift register. How you do it will of course determine the actual minimum number of pins. Or if the output register has tristate outputs and your circuit can tolerate an open circuit output, simply use the tristate output (usually /OE) to isolate the output pins until the value is shifted in. For what it is worth, you can probably shelve the '244s for another project.

    Frank
Sign In or Register to comment.