Author Topic: Tied outputs on 74HC4067's  (Read 1538 times)

0 Members and 1 Guest are viewing this topic.

Offline TimB100Topic starter

  • Contributor
  • Posts: 45
  • Country: gb
Tied outputs on 74HC4067's
« on: March 01, 2019, 08:08:58 am »

Hello people,

Thanks in advance for any help you can give.

I have a design where I have 6 x 74HC4067 devices (16-channel analog multiplexer/demultiplexer).
https://assets.nexperia.com/documents/data-sheet/74HC_HCT4067.pdf

They will feed 96 sensors to a Pic micro.

My question is:- Can the outputs all be tied together, or should I feed each to an AN input on the pic?

The reason I ask is that I'm using a 28 pin pic and by the time I assign the 6 AN lines the 74HC4067 channel select lines and the individual chip select lines, my own SPI com lines and the RX +TX and programming lines I have run out of pins. If I can tie the outputs of the 74HC4067 together it would all fit.

Thanks

Tim
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Tied outputs on 74HC4067's
« Reply #1 on: March 01, 2019, 08:49:38 am »
They are analog switches, so in principle you can tie their switch commons together (they don't have 'outputs' as such).  However, if you tie them you'll need individual /E lines for each '4067 so only one is active at a time , though you can save threeMCU pins by using a 74HC138 3 to 8 line decoder to generate the six /E lines from three select lines.   S0 to S3 on all the '4067s can be paralleled like for like, so a total of eight MCU I/Os will be required, seven outputs to address a specific input channel and one ADC pin. 

That's only a saving of two MCU pins compared to the four outputs required to drive the Sn lines in parallel and  six ADC inputs , keeping the '4067 switch commons  separate and assuming its acceptable to keep the /E lines grounded .

Both solutions assume its acceptable for switching glitches to briefly short two sensors for as long as it takes the new input selection to propagate through the '4067 internal logic.  If you must guarentee break before make, you'll need a master /E signal so you can disable all the '4067s before changing the input selection control lines.  Wire it to the '138 if you tie  the commons together to one ADC pin or to all the '4067 /E pins if using separate AC pins.

N.B. the single ADC pin arrangement will have slightly worse crosstalk and noise than separate ADC pins.   It shouldn't matter if all the sensors are similar, low impedance  and don't have HF noise on their outputs.
 

Offline TimB100Topic starter

  • Contributor
  • Posts: 45
  • Country: gb
Re: Tied outputs on 74HC4067's
« Reply #2 on: March 01, 2019, 09:01:33 am »

Hello Ian

Many thanks.  :-+

I have enough outputs on the pic to have the 4 channel select lines and 6 outputs for the enable lines so if I can tie the outputs together with out "OFF" devices dragging the signal down I'm happy.

The sensors are ir phototransistors and will all be calibrated for a threshold change as part of the overall calibration of the system.

I can happily code in a delay between switching devices to let things settle before scanning the next devices channels.

Tim



 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: Tied outputs on 74HC4067's
« Reply #3 on: March 01, 2019, 10:22:44 am »
Are the phototransistors illuminated by LEDs which your MCU has control of? If so, there could be a way to multiplex them by wiring them in parallel and switching the LEDs on and off.
 

Offline TimB100Topic starter

  • Contributor
  • Posts: 45
  • Country: gb
Re: Tied outputs on 74HC4067's
« Reply #4 on: March 01, 2019, 02:30:14 pm »

Hi,

Yes I have control over the Leds. Or I will do when the design is finished.

The issue on that side is there will be 25 odd of them. I was thinking of running them in series from 12v in blocks. But flooding could be an issue.

I will not multiplex them or PWM as its pointless. I have plenty of power and I would need to time it with the scan so they might as well stay on full time. I will thought need to turn the output down somehow.

So there is no guessing I'm measuring the height of water in a tube. I need sub 1.5mm height accuracy. The ir sensors will be 1.3mm apart. The leds will illuminate the back of the tube and the sensors pressed up against the tube.

The water will attenuate the signal so will be able to work out the level by scanning all the sensors and looking for the change.

The 25 leds at the back are so you illuminate the tube evenly.

Thanks

Tim
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Tied outputs on 74HC4067's
« Reply #5 on: March 01, 2019, 06:06:24 pm »
It may well be possible to directly multiplex the phototransistors and get rid of all of or all but one of the analog switches.

For the LEDs, the number per block in series depends on their Vf.   To adjust their intensity without aliasing with the ADC samplerate, you'll need linear current control, although it doesn't need to be very precise.  You could probably get away with a sngle OPAMP + MOSFET current sink for all the strings in parallel, + a balancing resisor in each string to revent on hogging the current.  Another option would be individual BJT + emitter resistor current sinks for each string with their common control voltage from a well filtered buffered PWM.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: Tied outputs on 74HC4067's
« Reply #6 on: March 03, 2019, 10:11:29 am »
How about driving the LEDs in five strings of five, using the CD4017 or CD4022 clocked by the MCU?

It can be run straight off 12V and the output resistance of the old CD4xxxx series is so high, you could probably avoid the need for a series resistor or the LEDs. A couple of transistors would be required to shift the 5V logic levels.

https://www.renesas.com/eu/en/www/doc/datasheet/cd4017bms-22bms.pdf
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf