I have implemented a circuit where I write to a PCA9959 with one controller (MCU1), then switch the SPI bus with a SN74CBTLV3257 multiplexer and read the values with a second controller (MCU2). The MCUs don't communicate with each other but an arbitration for taking turns in writting and reading is implemented.
When only writing with MCU1 without toggling the switch, everything works fine. The problems appear when I start switch back and forth between MCU1 and MCU2.
It randomly happens, that the LED driver switches on/off random LEDs in this constellation. Strangely enough, when I write and then read back the values with MCU1, the register content seems to be OK.
Any hints? No errata found.
Signals on the switch:
- SDI
- CLK
- SDO
- nCS
other signals from MCU1:
- nEN
- nRESET
Any help greatly appreciated!PCA9959
Hello goepe
Good day!
I'm not an expert on the SN74CBTLV3257, but based on the information I can find, the SN74CBTLV3257 is a passive FET switch, not a buffer.
When you switch channels the disconnected side becomes Hi‑Z (floating), he PCA9959 still “sees” these pins
Try adding pull-up/down to SCLK, MOSI and nCS
I hope this information has helped you, please let me know if you need help with anything else.
Have a great day and best of luck.
Thank you for the suggestion. I have connected the PCA9959 to the A side connection of the multiplexer, not the B side which would indeed go to high-z. I am also measuring the SPI signals at the PCA9959 with a high speed oscilloscope and can't see anything unusual. Never the less I will give it a try and give you an update on the result.