Page 1 of 1

Combinational logic problem

Posted: Tue Sep 14, 2010 5:44 pm
by grim_reaper
This is either a complex problem, or a lack of my knowledge of basic digital electronics!

I'm designing a measurement system with 40 digital inputs. The inputs are probes in a water tank, so there will always be a point where the inputs uniformly change from 0 to 1 - i.e. the water level. I'd like to convert this into fewer inputs - preferably in a binary format - for input into a microcontroller (probably a PIC).
Aside from masses of AND/OR gates, there must be some way of converting a 40-way input into a 6-bit binary output! I can't find a UART with 40 inputs and PICs with >32 inputs are hard to get hold of. I'm so rusty with this stuff that it's starting to confuse me! Would an adder help? A counter of some sort?! Needless to say, I want to keep the component count down - the original design was a 54 input PIC.

Sorry if that's not really clear, please ask if anything needs clarifying.

Thanks.

Re: Combinational logic problem

Posted: Tue Sep 21, 2010 4:02 pm
by electrik-gaschief
The most straightforward solution that comes to mind would be to try using some 4067, 16 way de multiplexer/analogue switches. These chips allow the selection of 1 of 16 signals to be passed to a common output, as these are switches rather than logic gates the signals can pass both ways. I would envisage that you would need to use 3 4067's, giving you a total of up to 48 inputs. These 48 inputs need to be 'scanned' by means of a counter, then the common pins of the three 4067's would be connected toghether and routed to 1 input of the PIC. The scanning counter could either be based on external hardware or could be carried out by the PIC itself and sent out on some of its outputs. Either way the PIC needs to keep track of the scan count so that it knows which input has been routed to the input pin.

Link to 4067 datasheet: http://www.datasheetcatalog.org/datashe ... u453yy.pdf

EDIT:I would also suggest interposing a schmitt trigger between the output of the 4067's and the input of the PIC in order that a clean digital signal is provided at the input pin.