Shop OBEX P1 Docs P2 Docs Learn Events
Multiplexing code — Parallax Forums

Multiplexing code

ArchiverArchiver Posts: 46,084
edited 2000-12-14 18:30 in General Discussion
Hello, i want to multiplex 8 bit to 4 bit using the IC74157.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-12-14 02:16
    Hello, how can i multiplex 8 bit to 4 bit using the IC74157? please i
    need the code.
  • ArchiverArchiver Posts: 46,084
    edited 2000-12-14 02:22
    are you wanting a serial interface for 8 bits because you don't want
    to use the 8 pins of the stamp what are you wanting changing 8 bits to
    4 bits help me here

    Kalun Lau wrote:
    >
    > Hello, how can i multiplex 8 bit to 4 bit using the IC74157? please i
    > need the code.
  • ArchiverArchiver Posts: 46,084
    edited 2000-12-14 17:18
    The 74165 should give you 8 bit input using only three lines to the
    stamp and there should be code for this

    Can anyone send the 74165 code Ill keep looking

    Kalun Lau wrote:
    >
    > Hello LarryGaminde,
    >
    > i hace a Voicedirect 364 speech recognition module and i want to use
    > the stamp as a "time control" because the speech rec. has 1 sec high
    > in its 8 bits output. i want to extend and control that time using the
    > stamp 2
    >
    > Wednesday, December 13, 2000, 9:22:14 PM, you wrote:
    >
    > L> are you wanting a serial interface for 8 bits because you don't want
    > L> to use the 8 pins of the stamp what are you wanting changing 8 bits to
    > L> 4 bits help me here
    >
    > Best regards,
    > Kalun mailto:klnlau@v...
  • ArchiverArchiver Posts: 46,084
    edited 2000-12-14 18:30
    This program was done by jon williams for nuts and volts in Sept. of
    1998

    I hope this helps



    ' Listing 1

    ' Stamp Applications: Nuts & Volts, September 1998



    '
    [noparse][[/noparse] Title
    ]

    '

    ' File...... DIGIO.BAS

    ' Purpose... 74HC165/74HC595 Demo

    ' Author.... Jon Williams

    ' E-mail.... jonwms@a...

    ' WWW....... http://members.aol.com/jonwms

    ' Started... 02 AUG 98

    ' Updated... 02 AUG 98





    '
    [noparse][[/noparse] Program Description
    ]

    '

    ' Demonstrates digital I/O expansion using readily available shift

    ' registers.





    '
    [noparse][[/noparse] Revision History
    ]

    '

    ' 02 AUG 98 : Rev 1 complete





    '
    [noparse][[/noparse] Constants
    ]

    '

    SYMBOL Clk = 0 ' clock

    SYMBOL DPin = 1 ' data pin

    SYMBOL Data = Pin1 ' data bit

    SYMBOL _165 = 6 ' HC165 strobe

    SYMBOL _595 = 7 ' HC595 strobe





    '
    [noparse][[/noparse] Variables
    ]

    '

    SYMBOL temp = B0 ' using for shift in/out

    SYMBOL shift = B2 ' shift counter





    '
    [noparse][[/noparse] EEPROM Data
    ]

    '





    '
    [noparse][[/noparse] Initialization
    ]

    '

    Init: Pins = %11000000 ' _595 & _165 = H, Clk = L

    Dirs = %11000001





    '
    [noparse][[/noparse] Main Code
    ]

    '

    Main: GOSUB DigIn ' get HC165 inputs

    DEBUG #%temp,cr ' display

    PAUSE 100

    GOTO Main

    END





    '
    [noparse][[/noparse] Subroutines
    ]

    '



    DigIn: PULSOUT _165, 5 ' load the inputs

    INPUT DPin ' prepare for data in

    FOR shift = 1 TO 8 ' shift 8 bits

    temp = temp * 2 ' rotate left (MSB first)

    Bit0 = Data ' get a bit

    PULSOUT Clk, 5 ' clock out the next bit

    NEXT

    RETURN





    DigOut: OUTPUT DPin ' prepare for data out

    FOR shift = 1 TO 8 ' shift 8 bits

    Data = Bit7 ' MSB first

    PULSOUT Clk, 5 ' clock the bit

    temp = temp * 2 ' get next bit

    NEXT

    PULSOUT _595, 5 ' bits -> outputs

    RETURN





    Kalun Lau wrote:
    >
    > Hello LarryGaminde,
    >
    > i hace a Voicedirect 364 speech recognition module and i want to use
    > the stamp as a "time control" because the speech rec. has 1 sec high
    > in its 8 bits output. i want to extend and control that time using the
    > stamp 2
    >
    > Wednesday, December 13, 2000, 9:22:14 PM, you wrote:
    >
    > L> are you wanting a serial interface for 8 bits because you don't want
    > L> to use the 8 pins of the stamp what are you wanting changing 8 bits to
    > L> 4 bits help me here
    >
    > Best regards,
    > Kalun mailto:klnlau@v...
Sign In or Register to comment.