1 Reply Latest reply on Sep 22, 2017 5:29 AM by EmHo_296241

    SCB SPI interface not receiving

      I'm trying to get the SCB SPI interface working with a CY8CKIT-046 because on my actual project I have to use this method rather than the regular non-SCB SPI interface. On this devkit, if I use non-SCB, I can recieve data just fine, but if I use the same pins or even a different set, and use the SCB SPI interface on both configured and unconfigured, I can't get it to receive any data packets from the other SPI device that is spamming out data every half second. What is the difference between the two interfaces? 


      When I follow the debugger, I notice that when it goes into SPI_1_SpiInit(&config) and then into SPI_1_SetPins, there is a section that says it disables the input buffer:


      #if (SPI_1_TX_SDA_MISO_PIN)
                      /* Disable input buffer */
                       pinsInBuf |= SPI_1_TX_SDA_MISO_PIN_MASK;




      and then used in 


      #if (SPI_1_TX_SDA_MISO_PIN)


      I can't see anywhere that it is re-enabled, and I have tried editing this value at runtime to see if it makes a difference by just keeping it enabled, and whether I add the other pin masks to the value or set it all to 0, it doesn't do anything. Here is my setup configuration. 


      SPI_1_SPI_INIT_STRUCT conf;
          conf.mode = SPI_1_SPI_SLAVE;
          conf.submode = SPI_1_SPI_MODE_MOTOROLA;
          conf.sclkMode = SPI_1_SPI_SCLK_CPHA0_CPOL0;
          conf.rxBufferSize = 32u;
          conf.rxBuffer = buffer;
          conf.txBufferSize = 32u;
          conf.txBuffer = txbuffer;
          conf.enableInterrupt = 1u;
          conf.rxInterruptMask = SPI_1_INTR_RX_NOT_EMPTY | SPI_1_INTR_RX_FULL;




      Any Ideas?