One pulse to two

Discussion in 'General Electronics Chat' started by Fordy, Jun 18, 2012.

  1. Fordy

    Fordy Thread Starter New Member

    Joined:
    Nov 29, 2011
    Messages:
    15
    I wonder if I could draw on your creativity..

    What is seemingly a simple problem has had me stuck for some time.


    In essence, I'm trying to get two pulses (more later, but once I have a method I can scale it up) from one.

    So a button is pressed causing a 9v high, but I need it to trigger two pulses, so that the flip-flop it feeds in to does a double count.

    Other switches will be for triple, quad counts. I'm essentially trying to give the switches different weightings, or values if you will.


    I realise this should be as simple as a delay circuit, but I've not had much luck making it work for some reason.

    My other criteria is that it should use reasonably low-level components - as although I'm desigining this with abstractions for now (to keep it simpler) when I actually create it I want to do it with only MOSFETs (and ofc resistors, capacitors, diodes as required) no ICs.


    TIA,
  2. KMoffett

    KMoffett Senior Member

    Joined:
    Dec 19, 2007
    Messages:
    2,315
    Location:
    Minneapolis MN USA
    Is this to be a real world device? Using discrete components does not make it "simple". In fact it will make it very complicated.
    You might be able to build edge detectors:http://sound.westhost.com/appnotes/an005.htm
    with this discrete XOR:http://edn.com/design/other/4373765/Perform-the-XOR-XNOR-function-with-a-diode-bridge-and-a-transistor
    "Press and release" to get a X2 count. Maybe cascade two to get a X4 count. But a X3...??????

    One 8-pin DIP microcontroller will do it very easily, cheaply, and compactly.

    Ken
    absf likes this.
  3. t_n_k

    t_n_k AAC Fanatic!

    Joined:
    Mar 6, 2009
    Messages:
    5,010
    I've used this XOR option in the past.

    Attached Files:

  4. Fordy

    Fordy Thread Starter New Member

    Joined:
    Nov 29, 2011
    Messages:
    15
    I never said it would!

    I want to build the whole thing from individual transistors rather than using pre-packaged ICs - that's just a fundamental part of specification if you like.


    Thanks for that edge-detector link. Hadn't thought of doing it like that, I've been fiddling with capacitors trying to create the second by means of a delay from the first.
  5. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    Messages:
    3,245
    Location:
    Tucson AZ USA
    I guess you could build a latch, oscillator, ring counter & OR gate with discreet components- but why?
  6. Fordy

    Fordy Thread Starter New Member

    Joined:
    Nov 29, 2011
    Messages:
    15
    Just 'cause.

    I'm kind of fascinated by older tech, and how far we've come - but I think it's a shame in a way that these days no one person can build a complete system, they just don't have the know-how.

    If they did, the product wouldn't be as good as if a person (or team, but person keeps the idea more simple) who specialised in each area had worked on each area.

    I just want to try making something "from scratch" as it were, just to do it. That's how this project came about, I wouldn't be doing it otherwise so there's definitely no room for change on that, because that is the only reason for doing it really.
  7. WBahn

    WBahn AAC Fanatic!

    Joined:
    Mar 31, 2012
    Messages:
    8,077
    Location:
    Larkspur, Colorado
    While I most definitely understand and support your motivation and intention, I would offer for your consideration an approach along the way of the following:

    Once I understand how a basic set of logic gates works, such as the complete set of symmetric two-input logic gates {AND, OR, INV, NAND, NOR, XOR, XNOR}, including implementing them with transistors (I would recommend using MOSFETs and the circuits are much simpler) and proving that they work as intended, then I can move up a step and implement circuits using basic IC logic gates and not implementing every gate using transistors. I then look at slightly more complex building blocks, such as a mux, or full adder, or a 7-seg decoder, and implement those using nothing but two input logic gates. At the next level, there are some basic latches and flip-flops. So I implement those using nothing but the building blocks that I have previously understood, implemented, and tested until I get them working like they are supposed to. I then move up to slightly more complex circuits, such as counters and do the same.

    The idea is to bootstrap the level of abstraction you are working with such that, at any given time, your are using a set of building blocks that is only slightly below the level of what you are focusing on at the moment, which allows you to think in terms of the concepts at that level. But at the same time, you also firmly understand and know that, if needed, you could walk all the way back down and implement everything you are presently using with discrete components.

    This then encourages coming at your problem from a top-down instead of a bottom-up approach. For instance, the first thing that came to my mind as you described what you were trying to do was that I want each button to indicate how much to add to the currently stored in a register. If I'm allowed to use flip-flops and two-input logic gates, then the bulk of the design is trivial. Now I can deal with the more subtle issues such as debouncing and clocking and set-up and hold concerns and learn a lot more about those new issues because I'm not spending time and energy to recreate and debug stuff that I already understand.
    Fordy and absf like this.
  8. Fordy

    Fordy Thread Starter New Member

    Joined:
    Nov 29, 2011
    Messages:
    15

    That's an excellent response - thank you.

    Although actually, it's advice that I've already followed, before you gave it.


    You may be aware of (or even taken) MITx's 6.002x course which just finished a trial run. I took the course, and saw how to create a NOT gate/inverter from a MOSFET there.

    I've also made flip-flops, latches, and the like from two-input gates in A level Electronics.


    I fully understand what you're saying about building up layers of abstraction - which is why I said in my original post that at this design phase I'm working with ICs that are simple enough that I will be able to build them myself from MOSFETs without any trouble.

    Which is why I said that the two pulses would be feeding into flip-flops.


    My approach is that the switch valued '1' goes straight in. Switch valued '2' also feeds into 1, as well as into the flip-flop via a delay. '3' goes into 2, as well as the flip-flop via a delay of double length.

    This is easily scalable as you can see, and avoids any issue of trying to get three pulses as mentioned by other techniques mentioned above.


    So as I was saying, I have no problem with, and have been already, abstracting at this stage - I'm just saying that when I come to build-time, I'll be using MOSFETs, not ICs. Which is why I asked for 'simple' solutions if they involve ICs - as I didn't want something crazy which would fill half a room if I tried to implement with MOSFETs.
  9. WBahn

    WBahn AAC Fanatic!

    Joined:
    Mar 31, 2012
    Messages:
    8,077
    Location:
    Larkspur, Colorado
    I sure hope you have lots and lots of MOSFETs. A 2-input NAND gate is 4 transistors, an XOR gate is 12, a single D-type flip-flop is between 18 and 28 transistors. So your counts are going to skyrocket very quickly.

    Trying to get multiple pulses from each switch is going to cause you some problems that will take a bunch more transistors, and I don't see it as being very scalable. If you had 255 buttons are you going to produce 255 pulses from the last one?

    If, instead, you had eight lines that are passively pulled up with, say, a 100kΩ. At each switch you then have a pulldown transistor one a subset of the lines such that when that button is pressed a binary weighted subset of the lines are pulled low. These eight lines are then fed to an 8-bit adder with the other input coming out of the 8-bit register. Each switch also triggers a free-running FSM that locks down the pulldown transistors, produces a write strobe for the register, and releases the pulldown lock.

    By adding one more bit to the register and adder, one more data line to the bus, and one more pulldown transistor at each switch, you can double the number of switched. Now that's scalable.

    Doing it with three to seven switches would be very tame and I think you would learn a lot more by implementing that free-running FSM (since the same ideas used to do it could be put to work producing a sequence of pulses).
    absf likes this.
  10. Fordy

    Fordy Thread Starter New Member

    Joined:
    Nov 29, 2011
    Messages:
    15

    That would be the case yes, but I don't need to go that high.

    That technique is perhaps more scalable, yes. However I think I'll go back to my original method of a delay. Edge detection has it's own problems in being variable with length of time switch is pressed.

    Yes, that could be solved by making the switch indirectly trigger a pulse of fixed width, but this just adds complexity.


    If switch 1 goes straight into flip flop, switch 2 can go straight in, as well as go via a delay of suitable time to separate the pulses as far as flip-flop is concerned. Switch 3 then goes in to 2, as well as into flip-flop via a longer delay. 4 into 3 as well as longer delay, and so on.

    There'll only be 9 such switches, anyway.
  11. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    Messages:
    3,245
    Location:
    Tucson AZ USA
    Is this something like you had in mind using various width pulses? The first one shot, OS, should be long enough to blank out SW bounce, 50ms, & each cuceeding OS maybe one sec longer than one above, with final OS set for 1/2 sec. The leading edge of OS out. pulse triggers the one above; neg. trailing edge ORd, inverted & fed to final OS, giving a pulse train = to activated SW.

    Attached Files:

    absf likes this.
  12. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    Messages:
    3,245
    Location:
    Tucson AZ USA
    The OS needs more work- will not work as is.
  13. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    Messages:
    3,245
    Location:
    Tucson AZ USA
    OS modified to work; trailing edge slower than would like

    Attached Files:

    absf likes this.
Similar Threads
Forum Title Date
General Electronics Chat Pulsed Led Ccs Aug 29, 2014
General Electronics Chat Pulsed LED driver vs. large resistor value, efficiency Aug 16, 2014
General Electronics Chat Pulsed Output From 8 Data Lines To Drive A Solenoid Jul 17, 2014
General Electronics Chat Changing Pulse Rate Jul 12, 2014
General Electronics Chat Splitting two AC signals for the human pulse May 26, 2014

Share This Page