I have a current source of square pulses (0-20 uA) generated by a NI 9265 device. I am trying to build a fast switching circuit using TI CD4051 multiplexer to switch the current signal between different channels to apply it to different electrode pairs. The problem I am having is getting current on all channels even when all channels are OFF. Mux however is doing fine with a voltage signal. Any suggestion would be highly appreciated.
You probably need to short the unused current sources to ground with another set of analog switches.
When a current source is not connected its voltage will rise to the maximum level and it sounds like it is then high enough to get through the multiplexer.
4053 2:1 multiplexers could be used with the input current source to the common terminal and all of the NO outputs tied together as the multiplexed output.
Alternatively you could use diodes instead of the multiplexer and short all but one current source to ground with analog switches.
This will take more devices than using just a 4051 multiplexer.
If the current source can force the analog-mux inputs above +VDD, or below -VDD, then various protection circuits (ESD protection) get turned on, forcing un-expected charges into the IC's substrate. Nothing can be trusted at that point.