All About Circuits Forum  

Go Back   All About Circuits Forum > Electronics Forums > General Electronics Chat

Notices

General Electronics Chat Discussion forum for general chat about anything electronics related, including asking questions about material in the All About Circuits E-book, Worksheets, and Videos.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 06-18-2012, 10:16 AM
Fordy Fordy is offline
Junior Member
 
Join Date: Nov 2011
Posts: 15
Default One pulse to two

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,
Reply With Quote
  #2  
Old 06-18-2012, 10:40 AM
KMoffett KMoffett is offline
Senior Member
 
Join Date: Dec 2007
Location: Minneapolis MN USA
Posts: 2,262
Default

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/...d-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
__________________
"To invent, you need a good imagination and a pile of junk."
Thomas A. Edison (1847 - 1931)
Reply With Quote
The Following User Says Thank You to KMoffett For This Useful Post:
absf (06-18-2012)
  #3  
Old 06-18-2012, 10:42 AM
t_n_k t_n_k is offline
Senior Member
 
Join Date: Mar 2009
Posts: 4,924
Default

I've used this XOR option in the past.
Attached Images
File Type: jpg One pulse to two pulse.jpg (11.8 KB, 47 views)
Reply With Quote
  #4  
Old 06-18-2012, 04:32 PM
Fordy Fordy is offline
Junior Member
 
Join Date: Nov 2011
Posts: 15
Default

Quote:
Originally Posted by KMoffett View Post
Is this to be a real world device? Using discrete components does not make it "simple".
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.
Reply With Quote
  #5  
Old 06-18-2012, 04:34 PM
Bernard's Avatar
Bernard Bernard is online now
Senior Member
 
Join Date: Aug 2008
Location: Tucson AZ USA
Posts: 3,154
Default

I guess you could build a latch, oscillator, ring counter & OR gate with discreet components- but why?
Reply With Quote
  #6  
Old 06-18-2012, 10:50 PM
Fordy Fordy is offline
Junior Member
 
Join Date: Nov 2011
Posts: 15
Default

Quote:
Originally Posted by Bernard View Post
I guess you could ... with discreet components- but why?
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.
Reply With Quote
  #7  
Old 06-18-2012, 11:28 PM
WBahn WBahn is offline
Senior Member
 
Join Date: Apr 2012
Location: Larkspur, Colorado
Posts: 8,070
Blog Entries: 9
Default

Quote:
Originally Posted by Fordy View Post
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.
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.
Reply With Quote
The Following 2 Users Say Thank You to WBahn For This Useful Post:
absf (06-19-2012), Fordy (06-19-2012)
  #8  
Old 06-19-2012, 05:59 PM
Fordy Fordy is offline
Junior Member
 
Join Date: Nov 2011
Posts: 15
Default

Quote:
Originally Posted by WBahn View Post
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.

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.
Reply With Quote
  #9  
Old 06-19-2012, 09:35 PM
WBahn WBahn is offline
Senior Member
 
Join Date: Apr 2012
Location: Larkspur, Colorado
Posts: 8,070
Blog Entries: 9
Default

Quote:
Originally Posted by Fordy View Post
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.
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).
Reply With Quote
The Following User Says Thank You to WBahn For This Useful Post:
absf (06-22-2012)
  #10  
Old 06-20-2012, 03:14 PM
Fordy Fordy is offline
Junior Member
 
Join Date: Nov 2011
Posts: 15
Default

Quote:
Originally Posted by WBahn View Post
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).

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.
Reply With Quote
Reply   Post New Thread

Tags
, , , ,


Related Site Pages
Section Title
Worksheet Microcontroller principles
Worksheet Counters
Worksheet Flip-flop circuits
Worksheet Latch circuits
Worksheet CMOS logic gates
Worksheet Basic logic gates
Worksheet Digital logic signals
Textbook Finite State Machines : Sequential Circuits Counters
Textbook The J-K flip-flop : Multivibrators
Textbook NAND gate S-R flip-flop : Digital Integrated Circuits


Similar Threads
Thread Thread Starter Forum Replies Last Post
PWM to RC servo pulse width Simon0362 The Projects Forum 3 09-21-2011 11:51 PM
Pulse Charging SLA Batteries survivalsys Off-Topic 11 05-20-2011 02:32 AM
control pulse width of a -15vdc pulse train @ 20khz fringe General Electronics Chat 2 01-23-2011 10:46 PM
Help with Pulse Counter that outputs one pulse per n-pulses tuscarora The Projects Forum 18 03-09-2010 07:20 PM
LM555 Timing and Pulse Width Modulation 1337Hendrix The Projects Forum 6 12-02-2009 07:40 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:36 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.