Need ckt to monitor for specified pulse width then set flipflop
EducateUSA
Posts: 13
I am looking for a circuit design to read a BS2·data line, and look for a specified pulse width, then set a flipflop which will then enable another chip until the same pulse width is seen again.· All other signals on the data line should be ignored.· Ideally, I would like to be able to put several of these "tuned" circuits on a single data line.· I have been trying to create the circuit with a 555 with no success.· Can anyone help me?
Sincerely,
Mark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sincerely,
Mark Hass, Director
EducateUSA
markhass@EducateUSA.com
Sincerely,
Mark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sincerely,
Mark Hass, Director
EducateUSA
markhass@EducateUSA.com
Comments
Look into the PBASIC PULSIN command.·· Here is a sample program that should get you started.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/14/2007 7:40:38 AM GMT
Thanks again.
Mark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sincerely,
Mark Hass, Director
EducateUSA
markhass@EducateUSA.com
The second version uses the exact same circuit, except all four gates are Schmitt-trigger NAND gates, such as a 74HC132. For the buffer and inverter stages, tie the unused side of the NAND gate high. This means you can do everything with one 14-pin DIP. The only requirements are that the input pulse either be negative going (high-low-high) or you omit the input buffer, in which case you would use a positive going (low-high-low) input pulse, and that the output pulse generated would have to be inverted logic (in the example above, using a NAND gate, creating a high-low-high output). You can still use this for driving all edge-clocked logic. Leaving the clock in one state or the other would not affect operation of the flip-flop. If you omitted the input buffer, you could use the remaining gate as an inverter to get your low-high-low output, if that's what you need.
You will have to play with the resistor and capacitor values to get them in the time constant range that you need them, but it should be pretty straightforward. A good choice for the edge-detecting circuit would be 100K and 4700pF, 2200pF would be better if you are dealing with shorter input pulse durations. This makes a fairly narrow pulse, but is plenty to drive clocked logic.
If this sounds confusing, I can provide a schematic in the morning!
Sincerely,
Mark
After looking at the circuit it seems to me to need yet a third timing mechanism to reset the timer if the period in which the data line is high is greater than the desired pulse width necessary to set the flip flop (which is used to enable a chip select). Currently the gate appears to reset correctly if the pulse is too short, and always fire if the line is held high long enough for both RC timers to charge to threshold voltage after the minimum pulse width has been reached. If the width of the pulse is longer than a predetermined pulse, I think I need to reset the second RC (no diode) and start monitoring again for a pulse that is not too short, and not too long, -- just right [noparse]:)[/noparse] . Am I understanding your circuit correctly?
Respectfully,
Mark
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sincerely,
Mark Hass, Director
EducateUSA
markhass@EducateUSA.com
·
Here is something along the lines that might be useful.· In principle it is similar to what you want to do with the Pulse Width, only it uses frequency... basically you setup two RC's·for·a specific frequency to create a "window".· If the input frequency is within the window that you set by the RC time constant, then the·output of a Flip-Flop(1/2 MC4013B) indicates·if the signal is inside our outside of the window.· This output then can easily be detected by a Stamp.· Also, you can use a digital Pot controlled by the Stamp to change the "R" value in the RC time constant to adjust the frequency range.· I would think that the concept of this article could be modified to detect a "one-shot" pulse width rather than a frequency.· In fact you may not need to change anything at all,· it might also work well with simply receiving a pulse width.
·
The attached article was part of a special edition publication in 1992 from "ELECTRONICS NOW" magazine titled "NEW IDEAS 44 great circuits for electronics experimenters and hobbyists."
·
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/15/2007 3:31:31 PM GMT
You said "look for a specified pulse width". What widths, quantitatively, and how would they need to be "specified"?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Or a second Stamp... as I indicated in my first post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/15/2007 3:51:21 PM GMT
The way I read the request, the BASIC Stamp main loop would be (assuming a selected pulsewidth of 1 millisecond +/- 0.1)
I was wondering about the selection of pulsewidth. That might imply some kind of user interface, a knob or a keypad, to select the width at run time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 10/16/2007 12:00:08 AM GMT
Not to mention any applications involving a BASIC stamp as a solution would require 100% dedication of the Stamp, and then you've got the timeouts to deal with....and even if you loop the instruction as a workaround, you can still miss a pulse while it's loading and executing the loop instruction...etc. etc.
Like I said, I haven't breadboarded the circuit yet, but I did draw it up and in theory it should work. The first part of the circuit you said is working correctly; I assume that you installed the recovery diode as mentioned. This is there so that the capacitor is discharged quickly on the trailing edge of the input pulse. The second (upper limit) RC circuit has no such recovery diode, and so the charge-discharge times are equal. This means that once the hysteretic action of the upper limit gate is triggered, it will not reset quickly when the trailing edge of the input pulse is received. This ensures that its output will stay low long enough to inhibit the pulse generated by the network on the lower limit gate's output. Don't forget this last RC circuit - there should be a total of three. The entire circuit should be allowed to rest for at least the duration of the input pulse, before another pulse is fed to it.
If you use this to drive a "T" flip flop (T for Toggle - as in a binary divider) which is always reset when the circuit powers up, you should be able to index, in your software, when a device's chip select is selected, and when it is not - since the flip-flop always initializes in a known state. Another option is perhaps you could use individual pulse-decoder circuits to set a set-reset flip flop, and then use a common reset line, which would take an additional pin, or you could use another pulse decoder circuit to drive a common reset line. Could you provide a schematic or drawing of the circuit you have built?
I need to spend some time understanding the different methods presented to get the job done. Playing with 555s and Schmitt triggers has been fun, but figuring out how to make the circuits work has taken up my evenings for the past week. In the mean time, I need to get my job done, or I won't have $$ to keep buying these toys, let alone pay my mortgage.
I am still trying to understand how to stop the trigger and reset the both RC timers when I have a pulse that is too long, but I think I’ll be able to work it out. It is interesting that something so easy to do with multiple pins, seems soooo difficult to achieve using discrete logic. Probably I just need to study and practice more. Funny, - that is what I so casually tell my students. If nothing else, this exercise has reminded me how difficult it is to be a student and really think. Managing teachers is easier. Thanks again to everyone.
Respectfully,
Mark, Director
EducateUSA.com
.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sincerely,
Mark Hass, Director
EducateUSA
markhass@EducateUSA.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
-Phil
I don't really know what pulse width I will need to look for if I go ahead and toggle my flip flop using PWM.· After learning of the ideas of frequency modulation and 1-wire, I think there may be easier ways to get the job done. Since I don't have lots of evening to play with this stuff, I prefer to keep my circuit simple, or as I was onec told to "KISS" it. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sincerely,
Mark Hass, Director
EducateUSA
markhass@EducateUSA.com
The DS2405 is a 1-wire device and as such would require a BS2p series to talk to it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support