PCA9959 strange behavior

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PCA9959 strange behavior

439 Views
goepe
Contributor I

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

Tags (1)
0 Kudos
Reply
2 Replies

328 Views
RafaR
NXP Employee
NXP Employee

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.

0 Kudos
Reply

304 Views
goepe
Contributor I

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.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2385863%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPCA9959%20strange%20behavior%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2385863%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20implemented%20a%20circuit%20where%20I%20write%20to%20a%26nbsp%3BPCA9959%20with%20one%20controller%20(MCU1)%2C%20then%20switch%20the%20SPI%20bus%20with%20a%20SN74CBTLV3257%20multiplexer%20and%20read%20the%20values%20with%20a%20second%20controller%20(MCU2).%20The%20MCUs%20don't%20communicate%20with%20each%20other%20but%20an%20arbitration%20for%20taking%20turns%20in%20writting%20and%20reading%20is%20implemented.%3C%2FP%3E%3CP%3EWhen%20only%20writing%20with%20MCU1%20without%20toggling%20the%20switch%2C%20everything%20works%20fine.%20The%20problems%20appear%20when%20I%20start%20switch%20back%20and%20forth%20between%20MCU1%20and%20MCU2.%3C%2FP%3E%3CP%3EIt%20randomly%20happens%2C%20that%20the%20LED%20driver%20switches%20on%2Foff%20random%20LEDs%20in%20this%20constellation.%20Strangely%20enough%2C%20when%20I%20write%20and%20then%20read%20back%20the%20values%20with%20MCU1%2C%20the%20register%20content%20seems%20to%20be%20OK.%3C%2FP%3E%3CP%3EAny%20hints%3F%20No%20errata%20found.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESignals%20on%20the%20switch%3A%3C%2FP%3E%3CP%3E-%20SDI%3C%2FP%3E%3CP%3E-%20CLK%3C%2FP%3E%3CP%3E-%20SDO%3C%2FP%3E%3CP%3E-%20nCS%3C%2FP%3E%3CP%3Eother%20signals%20from%20MCU1%3A%3C%2FP%3E%3CP%3E-%20nEN%3C%2FP%3E%3CP%3E-%20nRESET%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAny%20help%20greatly%20appreciated!PCA9959%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2386601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PCA9959%20strange%20behavior%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2386601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20goepe%3C%2FP%3E%0A%3CP%3EGood%20day!%3C%2FP%3E%0A%3CP%3EI'm%20not%20an%20expert%20on%20the%20SN74CBTLV3257%2C%20but%20based%20on%20the%20information%20I%20can%20find%2C%20the%20SN74CBTLV3257%20is%20a%20passive%20FET%20switch%2C%20not%20a%20buffer.%3C%2FP%3E%0A%3CP%3EWhen%20you%20switch%20channels%20the%20disconnected%20side%20becomes%20Hi%E2%80%91Z%20(floating)%2C%20he%20PCA9959%20still%20%E2%80%9Csees%E2%80%9D%20these%20pins%3C%2FP%3E%0A%3CP%3ETry%20adding%20pull-up%2Fdown%20to%26nbsp%3B%20SCLK%2C%20MOSI%20and%20nCS%3C%2FP%3E%0A%3CP%3EI%20hope%20this%20information%20has%20helped%20you%2C%20please%20let%20me%20know%20if%20you%20need%20help%20with%20anything%20else.%3C%2FP%3E%0A%3CP%3EHave%20a%20great%20day%20and%20best%20of%20luck.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2387056%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20PCA9959%20strange%20behavior%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2387056%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20the%20suggestion.%20I%20have%20connected%20the%26nbsp%3BPCA9959%20to%20the%20A%20side%20connection%20of%20the%20multiplexer%2C%20not%20the%20B%20side%20which%20would%20indeed%20go%20to%20high-z.%20I%20am%20also%20measuring%20the%20SPI%20signals%20at%20the%20PCA9959%20with%20a%20high%20speed%20oscilloscope%20and%20can't%20see%20anything%20unusual.%20Never%20the%20less%20I%20will%20give%20it%20a%20try%20and%20give%20you%20an%20update%20on%20the%20result.%3C%2FP%3E%3C%2FLINGO-BODY%3E