Electronics > Projects, Designs, and Technical Stuff
Find highest value of 4 inputs without microcontroller?
<< < (7/12) > >>
spec:
It's a tantalizing problem-  you just feel that there ought to be a simpler way, and of course there is: a tiny MCU Sorry I mentioned that word  :palm:
SiliconWizard:

--- Quote from: spec on November 18, 2018, 08:40:13 pm ---It's a tantalizing problem-  you just feel that there ought to be a simpler way, and of course there is: a tiny MCU Sorry I mentioned that word  :palm:

--- End quote ---

In terms of part count, obviously ;D
Although, depending on your input voltage sources, you may need additional buffering anyway - so wouldn't be that clear then!
Also, you'd be limited to the MCU's Vdd, whereas the opamp based design gives you a lot more freedom.
T3sl4co1l:

--- Quote from: spec on November 18, 2018, 07:05:19 pm ---
--- Quote from: T3sl4co1l on November 18, 2018, 12:42:17 am ---Should be able to do it in slightly fewer, due to this being a sorting problem (of sorts) and sorting problems being guaranteed N log N worst case complexity.
--- End quote ---

But you didn't :)

--- End quote ---

Well, yeah, because I was discussing analysis there, not synthesis...

An example circuit cannot prove an O(N log N) complexity, and even a very large number of variously sized examples can only hint at it.  Nay, complexity is proven differently.  (A proof which I don't need to provide, as search algorithms are well known theorems from CS, which the reader should look up if they are curious :) ).


--- Quote ---Your circuit does nothing more than my circuit and uses more components. It is also much more complex.
--- End quote ---

I didn't say it did..?  Indeed you gave an implementation of one of the possibilities I listed. :)


--- Quote ---It also  does not operate down to the 0V rail, to what extent is not clear because you haven't put in values and it does not have an adjustable initial offset (50mV in my circuit).

--- End quote ---

The resistors are left as an exercise to the reader. ;)  Nothing complicated, a fractional mA for the CCS is fine, and that sets the B-E resistor minimum value, and the pull-down value is in turn set by hFE (minimum) and speed or leakage (maximum).

Input range is easily controlled for any type of op-amp you might use, also, so I'm not too worried about diode drops or whatever.  There's also using a current mirror, and probably a variety of other things.

An op-amp with output saturation detection would be cool -- easy to make from first principles, but devilishly hard once it's in IC form.

Tim
technix:
Here is an idea that does not use a crazy number of comparators and might work even if the input voltage has a wide range: 74HCT4052 + LM311 comparator + a small state machine in either a MCU or small CPLD. I am assuming VCC = 5V, VDDIO = 3.3V, GND = 0, VEE = -5V (can be generated using a 7660 from the 5V rail)

Two 74HCT4052 is used to implement a 4x2 analog matrix switch, choosing two arbitrary signals from the four inputs. 74HCT4052 with 5V VCC and -5V VEE allows switching signals anywhere in that symmetric bipolar range, and is compatible with 3.3V LVCMOS logic levels. LM311 comparator can operate bipolar across VEE and VCC and has a output transistor that conveniently allows the implementation of a built-in VEE-VCC to GND-VDDIO level shifter. Now you have an AFE allowing choosing of any of the four inputs within -5V to 5V range to be compared, and operate the whole thing using 3.3V LVCMOS logic.

In the logic side, you can use a low cost CPLD like XC2C32A to implement a state machine it use a low cost MCU like that Panduk job to implement a sort algorithm. If your CPLD needs clock, just implement an RC oscillator with a 74LVC1G14, or if your CPLD has Schmitt trigger inputs, the CPLD itself.
spec:
I would love to see a schematic showing an actual implementation of your scheme with all components identified rather than just talking about it.

By the way, the crazy amount of comparators amounts to 2 jelly bean chips. ???
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod