Propeller Schmitt Trigger Inputs
Phil Pilgrim (PhiPi)
Posts: 23,514
In another thread the Propeller's lack of a Schmitt trigger input option was mentioned. With one spare pin and a few resistors, however, it's possible to convert as many inputs (to be read individually) to Schmitt trigger inputs as you want. In the following schematic, A0 to A2 are Schmitt triggered inputs, and A3 is the feedback pin. Before reading any pin, set A3's output state to the state last observed on the pin being read. This provides the positive-feedback biasing required to create a hysteresis band.
Using 4.7K input resistors and 470K feedback resistors, you will get about a 1% hysteresis band. Lower-valued feedback resistors will increase the hysteresis.
-Phil
Using 4.7K input resistors and 470K feedback resistors, you will get about a 1% hysteresis band. Lower-valued feedback resistors will increase the hysteresis.
-Phil
Comments
It works to nearly upto Rin = Rfeedback...
But note that bandwidth - as always - is constrained by your sampling intervalls; it will not work if the signal changes faster.
Right. It's only effective if you sample at the Nyquist rate or faster.
This is a technique I came up with years ago to sample phototransistor outputs from a wind instrument. There were four fan blades arrayed in the cardinal directions, each with a 50/50 black/white disk on the hub and an IR emitter/receiver pair. The "virtual Schmitt triggering" used five pins on a PIC: four for input and one for feedback.
-Phil
Maybe a one-source compilation of ingenious virtual circuitry would be useful for the prop community?
http://en.wikipedia.org/wiki/Schmitt_trigger
Single gate schmitt trigger input for Propeller or other.
The TLC555 low volts 555 timer makes an excellent real schmitt trigger also.
Big note * the input to output is INVERTED ..
Added the image as well in jpeg· ..
Thnx for the pointer John T
Will be in touch with you later.. just got back from Sydney.
Cheers
Ron·· Melbourne Oz
Home of the PropBus ...
<!--EndFragment -->
Post Edited (OzStamp) : 11/11/2007 4:59:02 AM GMT
Seems to be an issue with 'Snippy0001.jpg'
John T
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Nothing wrong with a 4093..
Also chips like 40106· + 4584··are fine also.
Maxim even has some dedicated pushbutton schmitt/debounce chips..
Philips and I believe TI also have some single gate Schmitt chips..
From memory they are called PICO gates ...or similar.
PHiPi circuit idea is really cool and does work.
We did something similar with the SX chip and the comparator in/output
we sampled an analog signal via a resistor divider and had a trip point.
Some feedback and it created a handy signal for a "battery charge or no charge.."
cheers
Ron Melbourne Oz
ANY chip able of bi-stable states (which generally means containing a kind of flip-flop) can be utilized as a Schmitt trigger. What Phil showed you was, how a Schmitt trigger worked! The standard circuit is this one below.
He especially pointed out that using the speed of the Propeller (to fulfill Nyquist criteria) and its internal memory, just ONE feed back line suffices to emulate MANY Schmitt Trigger inputs.
If someone is interested I can post a list of 300 chips with Schmitt-Trigger input and two or three circuits of how to build a Schmitt trigger from transistors...
Post Edited (deSilva) : 11/11/2007 9:36:13 AM GMT
I cannot see the connection at the moment... What is "similar"? The use of a resistor? Handlng of an analogue signal?
http://focus.ti.com/docs/prod/folders/print/sn74lvc3g17.html
To poke around in their little logic chips, try this finder tool
http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?familyId=339&family=logic&uiTemplateId=SZVI_T
Post Edited (deSilva) : 11/11/2007 9:34:52 AM GMT
My last comment was in reference to my posting months ago.
Suggestion similar to Phils suggestion.
I added this principle to a SX 28 circuit see post
http://forums.parallax.com/forums/default.aspx?f=7&m=204932
cheers Ron
The basic idea Phil used for his Schmitt-trigger was using the - single - trigger point of a Prop input by biasing the signal (which in fact is not reactionless, but high value resistors will do their part....)
So your batterie charge monitor could look something like this on the Prop:
Post Edited (deSilva) : 11/11/2007 1:04:08 PM GMT
I have been thinking of Schnitt-Triggers this week. I was toying with the idea power supplies. Using a zener to bias an op amp running the gate of a Mosfett in a buck topography. The constant swithing is getting the fett to hot because it doesn't really let it shut off. I was hopeing to get a comparator and keep it anolog, but it's nice to know the Prop could fill in the gap.
I am not fimiliar with Nyquist criteria however, Is that speed compatable with Buck switching?
Do a web search on "wiki nyquist" and "wiki nyquist frequency" and you'll get a much better explanation than I can provide.
I was thinking about how that could be applied to the COG counters, but came up short. The EDGE detect feedback modes of the counters have negative feedback, B := !A1. Even if there were a positive feedback mode, B := A1, or if one were to put a fast inverter on the B pin, there would still be a runt pulse, due to the one cycle delay, and that would cause the counter to increment when that runt pulse is tested as A1 & !A2. No go. It would take a counter mode that does not exist. (or just an external Schmitt trigger.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I don't know if it could work well or not. I am thinking you would need 50khz to 500khz for the PWM out. Is the prop nyquist capable of 25khz. At any rate I would still like to make it analog.
A cool circuit none the less!!
(a) You set the feedback to the old value.
(b) You read the input
(c) You update the memory
That's all.
The issue is, when you do not come back often enough to this piece of code.
Consider a drop of the line from 1 to 0 , and than going up to 1/2. You SHOULD read 0, but you do 1, if you do not get this drop. You will get it when you sample faster than twice the freqiency you are interested in (and to avoid aliasing, just use a hardware low-pass, best of second order. You see: Doing Schmitt triggering right in software is not exactly simple
But I think you can survive by spending a COG for updating the inputs. This could work @ 2 MHz/number_of lines.
Post Edited (deSilva) : 11/11/2007 11:18:34 PM GMT
I don't know, It's just food for thought.