I am having problem with a PIC16F887 and a multiplexer. I can`t make the MUX to work. I set up the PORTB pins to be output pins and connect them to the 8 input pins of the MUX. I set up the pins on port D to be also output and connect them to the digital control lines of the MUX, i.e. connect three pins of the PORTD to the S0, S1, S2 pins of the mux and I change the values of the PORTD pins in software. So, I want to control which channel of the MUX is active via PORTD pins. When all s0,s1 and s2 are high, I want the PORTB,7 to be routed to the output pins of the MUX. But it doesn`t work. It draws too much current, my power source is getting very warm in a short time. I`ve checked the functionality of the 16F887 and it works fine.
My question is: Am I forgetting something to do? Maybe some pull-ups, some resistors somewhere to be put in the circuit, maybe in series, I don`t know what could be done, I thought that using MUX is pretty straight forward... Although it is very very simple circuit: PORTB pin voltage waits in front of the MUX, the MUX is controlled via the three pins of the PORTD, and I am waiting for the voltage at the common output pin.
Question No:2. Should the two ICs have one common power source? I`ve tried with two different, nothing happened. I put the GND pins of both ICs in one same spot, I put Vcc pins in one same spot. But it doesn`t want to work. I need the MUX to make an ADC conversion of the voltage coming out of 7 sensors, photodiodes. I don`t want to use the built-in 7 different ADC channels, since I get too much cross-talk, i.e. when one sensor is being sampled, the other one shows the behavior of the previous sensor. I`ve tried to solve this issue with different amounts of time delay but it doesn`t work, everytime I change a channel, regardless of the time delay for the A/D, it won`t work. That is why I am hoping that the problem could be solved by using MUX and only one AD channel. But, as you can see, the MUX doesn`t want to work, either. I connect it pretty straight forward - I get one pin, connect it to the pin of the MUX and like that all the way, but something prevents it from functioning.