Hi, I have a PIC microcontroller. I have several chips on the board. I communicate with them all through the same SPI lines (SCK, MO, SO, but each has its own CS line).
I have a MCP23S17 I/O expander chip reading several switches (contact closure) (either open or closed). Basically they are pulled high with a 20K-ohm resistor if open to read a 1 otherwise they are shorted if switch is closed.
There are some inductive loads (pumps, etc.) that are totally separate from the circuit, but the lines run bundled together with the wires going into the I/O expander reading the contact closure (I know that is bad practice, but I can't prevent that right now - I need it to be more robust anyway).
The pump and other motors have separate switches to turn those off and on. When I turn those off and on, I get erratic behavior on my other chips such as a MAX7221 7-segment display driver, etc. If I disconnect the contact closure lines going into the MCP23S17 I/O expander chip, then I do not get the erratic behavior on my other chips.
I know it is due to inductive kickback and coupling between the inductive load (e.g. pump) wiring and the low voltage wiring reading the contact closures. I have ferrite beads on each digital input and a 5.1V Zener diode on each digital input to gnd (for the contact closure reading). I have TVS diodes on my 5V and 3.3V power lines to GND. I also have a NUP4302 schottky diode array on each digital input line.
Is there any other way of filtering this noise or preventing this?
My PIC has the two SPI blocks, so I thought about using 1 SPI block for just the MCP23S17 that is connected to the outside world and then using the other SPI block for all other chips. But they would still share a GND and 5V power.
Thanks.
I have a MCP23S17 I/O expander chip reading several switches (contact closure) (either open or closed). Basically they are pulled high with a 20K-ohm resistor if open to read a 1 otherwise they are shorted if switch is closed.
There are some inductive loads (pumps, etc.) that are totally separate from the circuit, but the lines run bundled together with the wires going into the I/O expander reading the contact closure (I know that is bad practice, but I can't prevent that right now - I need it to be more robust anyway).
The pump and other motors have separate switches to turn those off and on. When I turn those off and on, I get erratic behavior on my other chips such as a MAX7221 7-segment display driver, etc. If I disconnect the contact closure lines going into the MCP23S17 I/O expander chip, then I do not get the erratic behavior on my other chips.
I know it is due to inductive kickback and coupling between the inductive load (e.g. pump) wiring and the low voltage wiring reading the contact closures. I have ferrite beads on each digital input and a 5.1V Zener diode on each digital input to gnd (for the contact closure reading). I have TVS diodes on my 5V and 3.3V power lines to GND. I also have a NUP4302 schottky diode array on each digital input line.
Is there any other way of filtering this noise or preventing this?
My PIC has the two SPI blocks, so I thought about using 1 SPI block for just the MCP23S17 that is connected to the outside world and then using the other SPI block for all other chips. But they would still share a GND and 5V power.
Thanks.
Last edited: