This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: SPI trouble with an MCP23S17 Bus Expander

Part Number: TM4C123GH6PM

I am trying to interface my TM4C123G launchpad with an MCP23S17 Bus Expander.  Presently, I am trying to read a configuration register at address 0x00.  The datasheet on the bus expander states:

The SPI write operation is started by lowering CS. The
Write command (slave address with R/W bit cleared) is
then clocked into the device. The opcode is followed by
an address and at least one data byte.

The SPI Addressing is indicated as 0 1 0 0 ADR2 ADR1 ADR0 R/W A7 A6 A5 A4 A3 A2 A1 A0.  Using HW adsressing 000, so we have a uint32_t that is coded to 0x4100 (Address 0, Read=1) and register address 0x00.  

SSIDataPut(SSI0_BASE, 0x4100);

while (SSIBusy(SSI0_BASE));

SSIDataGet(SSI0_BASE, rxData);

There is 16 clock pulses and the output data is good, but then the clock stops.  Every so often, the input data comes in during the next transmit.  We have been experimenting with trying to send extra bytes to keep the clock active, but we can not get it to work reliably.  I am able to change the address and see the same results with other registers returning the POR default values.  Help please!  Thanks

Looking at the scope, the *CS is good and I see the output SSI0 TX with the 0x4100.  This is immediately followed by a SSIDataGet().  

  • Please know that I am not ignoring any of your ideas or suggestions; just extremely busy with other programs as well.  Not the most efficient way to work, but that's a discussion for another day and another forum.  Thanks and I'll let you know how the testing/troubleshooting goes.

  • @Brian - thanks for that.

    Do note that "many/most" here are (always) equally busy.

    Your acknowledgement, "cb1 message received - (maybe/potentially) "in process"" surely trumps (millennial's favored) "silence!"    (as the absence of response may indicate: Don't care, Didn't receive, Have NO idea, or "Trying for Perfection.")    And we do NOT KNOW client/receiver's reality!    That's never good - makes us KRAZY!    (other cement walls await our heads...)

    Simple answering response - just as you've supplied - is ALL that's sought.   (and keeps us "on board.")     Do realize - we are ALL Busy!     (I just flew 1500 miles to engage client's issue...)