Connect with us

Q: simple way to switch between 6 eproms?

Discussion in 'Electronic Basics' started by Eddy, Dec 7, 2003.

Scroll to continue with content
  1. Eddy

    Eddy Guest

    I salvaged a nice little pc board that houses 6 eproms, all the
    data,address lines,vcc,gnd lines are connected already, with the
    addition of a LS138 selector thats tied to each /ce of every eproms.
    MY application can only read one eprom at once, so, is there a way I
    can devise a physical switch to connect to the LS138 or otherwise to
    select each eprom individually & sequentially? in other words, when I
    would press the one switch, I would select the 1st, 2nd, 3rd .... 6th
    eprom, and maybe just put a LED for each eprom to display which one is
    being accessed. IS this possible?
    any ideas, suggestions ..links, schems much appreciated..
    THanks
     
  2. Tweetldee

    Tweetldee Guest

    Your eproms have a pin labeled /CE (Chip Enable). This pin is active low,
    so you would switch it to ground to enable a specific eprom, and bring the
    same pin to logic high on all the others to disable them.
    Easier to use a 2P6Pos rotart switch rather than trying to implement a
    series of momentary push switches. Use one section of the switch to select
    the /CE pin, and the other to turn on the LED for that eprom.

    Tweetldee
    Tweetldee at att dot net (Just subsitute the appropriate characters in the
    address)

    Never take a laxative and a sleeping pill at the same time!!
     
  3. Gerhard

    Gerhard Guest

    Or wire a BCD (binary code decimal) switch to the ABC inputs of the LS138
    chip and the switch common to 0V. Don't forget to wire a pull-up resistor
    to each ABC inputs. If the switch contacts are all open for position '0'
    and clossed for '7' the output sequence might be 7,6,5,4,3,2,1 & 0 instead
    of 0,1,2,3,4,5,6 & 7. To fix, just reverse the EPROM socket positions.

    Gerhad van den Berg
     
  4. John Fields

    John Fields Guest

    ---
    Yes.

    The easiest way would be to use a BCD coded rotary or thumbwheel switch
    with true outputs with the three LSBs connected to the '138's address
    inputs. You'd need to pull down the '138's inputs and connect the
    switch's common to Vcc. You won't find any switches with only six
    positions, but there are some with stops. A minor complication, if the
    all-zeroes input to the '138 is used to select one of the EPROMs, will
    be that with your switch indicating "0" one of the EPROMs will be
    selected, so you'll need to think of your EPROMS as going from zero to
    five instead of from one to six. If you use LEDs to indicate which
    EPROM is hot, though, that won't be a problem. To do that I'd use
    high-efficiency 2mA LED's wired to the '138 outputs, like this: (View in
    a non-proportional font like Courier)

    Vcc
    |
    [1k5]
    |
    |A
    [LED]
    _ | __ __
    Yn>-----+-----CEn> TO EPROM CE

    But...

    You've indicated that you want to push a button to switch EPROMs, so in
    order to do that you could use a debounced pushbutton switch to drive
    the clock input of a four bit binary counter and use the counter's three
    LSBs to drive the '138 on the board. If you wanted to keep all the LED
    wiring off the board you could wire an additional '138 to the counter's
    Q outputs to drive the LED's.
     
  5. John Fields

    John Fields Guest

    ---
    Error:

    If you use a 4 bit counter clocked sequentially here's what you'll get:

    CLK COUNT OUT '138 IN LED ON

    N QD QC QB QA A3 A2 A0 N 6 5 4 3 2 1
    -------------------------------------------------------
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
    1 0 0 0 1 0 0 1 1 0 0 0 0 1 0
    2 0 0 1 0 0 1 0 2 0 0 0 1 0 0
    3 0 0 1 1 0 1 1 3 0 0 1 0 0 0
    4 0 1 0 0 1 0 0 4 0 1 0 0 0 0
    5 0 1 0 1 1 0 1 5 1 0 0 0 0 0
    6 0 1 1 0 1 1 0 6 0 0 0 0 0 0
    7 0 1 1 1 1 1 1 7 0 0 0 0 0 0
    8 1 0 0 0 0 0 0 0 0 0 0 0 0 1
    9 1 0 0 1 0 0 1 1 0 0 0 0 1 0
    10 1 0 1 0 0 1 0 2 0 0 0 1 0 0
    11 1 0 1 1 0 1 1 3 0 0 1 0 0 0
    12 1 1 0 0 1 0 0 4 0 1 0 0 0 0
    13 1 1 0 1 1 0 1 5 1 0 0 0 0 0
    14 1 1 1 0 1 1 0 6 0 0 0 0 0 0
    15 1 1 1 1 1 1 1 7 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

    So, when the counter counts to 6, 7, 14, and 15, no EPROM will be
    selected and no LED will be lit. The easy way around that problem is to
    clear the counter when it gets to six, but you have to be careful with
    decoding glitches if you clear the counter asynchronously and it takes a
    little extra circuitry if you want to clear it synchronously. If you
    want to do it that way, (as opposed to using an encoding switch) post a
    request and I'll post a schematic for you on
    alt.binaries.schematics.electronic.
     
  6. Eddy

    Eddy Guest


    Hi John, the second option with pushbutton is exactly what I had in mind.
    can you give me more details on the debounced switch?
    Will a 74ls90 or a 161(asynchronous) do? or any others you could recommend?
    really appreciate it.
    thanks alot
     
  7. Eddy

    Eddy Guest



    John, I have no access to al.binaries.schematics.electronic, just
    explain the wiring, I should be able to pick it up.
    But what about a 74LS90 it counts up to 9 and has a master set/reset
    and by tying Qa,Qc to the master reset Mr1,Mr2
    should clear and start over at 0 ?
    what do you think? give me more info
    thanks again..
     
  8. John Fields

    John Fields Guest

    ---
    If you decode 0101 and use it to clear an asynchronous counter like an
    LS90, then as soon as it counts to 5 it will reset to 0, which means
    that you'll only enable the sixth EPROM for an instant before it jumps
    to the first, so that's not a viable solution. If you decode 0110
    there's no guarantee that the transition from 0011 to 0100 will be
    glitch-free, so you could wind up resetting early there as well.

    I think the easiest solution would be to decode 0101 and send that
    decode to either the synchronous preset or synchronous reset input of a
    counter. You could use the '138 to do the decoding and send /Y5 to the
    /RESET input of a '162 or '163 or to the /PRESET input of a '160, '161,
    '162, or 163. If you go the /PRESET route you'll need to connect the
    broadside load inputs to ground.

    Here's the truth table for either way:

    COUNT OUT '138 IN LED ON
    QD QC QB QA A3 A2 A0 N 6 5 4 3 2 1
    ---------------------------------------------------
    0 0 0 0 0 0 0 0 0 0 0 0 0 1
    0 0 0 1 0 0 1 1 0 0 0 0 1 0
    0 0 1 0 0 1 0 2 0 0 0 1 0 0
    0 0 1 1 0 1 1 3 0 0 1 0 0 0
    0 1 0 0 1 0 0 4 0 1 0 0 0 0
    0 1 0 1 1 0 1 5 1 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 1
    0 0 0 1 0 0 1 1 0 0 0 0 1 0
    0 0 1 0 0 1 0 2 0 0 0 1 0 0
    0 0 1 1 0 1 1 3 0 0 1 0 0 0
    0 1 0 0 1 0 0 4 0 1 0 0 0 0
    0 1 0 1 1 0 1 5 1 0 0 0 0 0

    The classical way to get a clean clock from a switch is to use a SPDT
    switch with an RS latch, like this, where A and B are the inputs and Y
    are the outputs of 2-input NANDs.


    Vcc Vcc
    | |
    [R] [R]
    | |
    +-->\ <--+--A
    | NC \ NO Y--+--->CLK
    | O +--B |
    | | | |
    | GND | A--+
    | +--Y
    +----------------B

    If you only have a SPST switch, you could use a 7555 to debounce it.
     
  9. Yes, one should avoid any async paths. Though...
    Depending on the PROM, a shift register loaded with 100000 (or
    similar), with feedback tapped from the appropriate bit, with the
    Q0-5 tied to a CS pin on the PROMs may be simpler.
    ....or do the whole thing in a PIC. ;-)
     
  10. John Fields

    John Fields Guest

    ---
    The OP said that the board he has already has a '138 installed and wired
    to do the /CS decodes, so removing it just to be able to outboard a
    shift register to do the /CS thing seems seems to be an ugly way to go
    about it, no?
    Aaaarrghhhh!!!!^)
     
  11. Rich Grise

    Rich Grise Guest

    I doubt if a glitch at 110 would be a problem, since you're clocking
    it with a pushbutton.

    Cheers!
    Rich

    If you
     
  12. Ok, since it's already ugly...
    The right answer is never ugly! ;-)
     
  13. John Fields

    John Fields Guest

     
  14. John Fields

    John Fields Guest

     
  15. Evidently it was designed for another purpose? It's ugly for his use,
    but re-use isn't so.

    Whay about a Gray counter? That would solve the asynchronous thing.

    John, John, John. You know better than this! Whatever the question,
    the answer is "Use a PIC". Somehow I don't think you agree with this
    fundamental truth of the universe (and SED). ;-)
     
  16. Eddy

    Eddy Guest


    Guys, definitely no pic or micros,
    I just want to use a few chips with some gates to do this. The board
    is actually part of a data archiving module, and there is a ls138 tied
    to each eproms /cs already for their selection.
    John, I wired the board using a switch to a quad 2-input 4093 NAND
    schmitt trigger feeding a 74HCT161(the only one I could get) Qa,Qb,Qc
    feed the LS138 and for some reason all the LED's come ON at the same
    time, any suggestions for caps and resistor values?
    I've wired the CAThode to the resistor to +Vcc and the anode to the
    output of the LS138 going to the wouldbe /CS.
    Just a question about the LS138, according to the truth table, I need
    to wire E1(Lo),E2(Lo)E3(hi) for the outputs 0-5 to go LO..I guess
    thats right? also, the HCT161, I've only wired the clk(input from the
    4093) and the outputs to the LEDs..am I missing anything?
    thanks for the help
     
  17. John Fields

    John Fields Guest

    ---
    Yes, the 161's ENABLE, /CLEAR, and /LOAD input all have to be wired.
    I've posted a schematic to alt.binaries.schematics.electronic, but since
    you can't get that group I'll post it to you via email also.

    I've shown the resistors for the LEDs as 1.5K (for 2mA LEDs) but if
    you're using higher current LEDs you could make the resistors smaller,
    but you'll need to be careful not to allow the voltage out of the '138
    to rise to too high a value to turn on the EPROM you select as well as
    not force the 138's outputs to sink more current than they're supposed
    to. (8mA total, for the LED _and_ the Eprom)

    Also, I'm assuming that the '138 I've shown is the one on the board and
    that the only other thing it's driving besides the EPROMS is the LEDs.

    Good luck, and post back if you have any more problems.
     
  18. Eddy

    Eddy Guest

    Hi John,
    I haven't received the schem yet, please try both my emails
    thanks again
     
  19. John Fields

    John Fields Guest

     
  20. Eddy

    Eddy Guest

    John, please try as I still haven't received it
    at hotmail. discard nospam..

    thanks again
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-