Hi all,
I need to run a bunch of stuff over an RJ45 cable which is only 8 conductors, so I'm scheming ways to save conductors.
On the MCU end I'm running an 18F4620. On the other end of the cable is an MCP23S17 (16-bit port expander from Microchip, runs over SPI.)
I need two for power and ground, two for USB D+ and D-, three for SDO SDI and SCL, two for CS and RESET, and one for a piezo speaker.
That's ten. I have eight conductors.
I can live without the reset function by tying it high permanently. That brings me down to nine.
I'm trying to eliminate the need for the chip select/enable wire going over the cable. What I'm thinking is tying it to GND on the port expander side (always enabled). I have other devices on the SPI bus though (SSR and USB chips), so I still need to regulate what goes over that line. So what I'm thinking of doing is using a NC7ST08M5X (2-input AND gate,
https://www.fairchildsemi.com/ds/NC/NC7ST08.pdf), tying one input to the SDO line and one to a pin on the PIC. When I want to send data to the port expander, just pull that pin high so the SPI goes through the gate and off over the cable to the expander. I'd also have to pull down the SDO line on the port expander side of the cable to ground so it doesn't freak out from EMI. Any suggestions on the resistor value for this?
My SPI bus is running at about 1.25mhz, so I don't think switching speed would be too much of an issue (I hope.)
Did this make any sense at all? If so, does it sound like it would work?