9 Replies Latest reply on Nov 12, 2014 5:10 PM by MichaelF_56

    BCM20732S SPI problem SDK 1.x BCM20736S SDK 2.x

      Hello All,

       

      Having a problem with the SPI interface on the BCM20732S (and BCM20736S).  We had this working previously with different IO on the BCM20732S (same chip) on a past project.  The only activity we see now is a 25.5us low pulse on the SPI CS.  Any ideas?  TIA

       

      Using these NEW pins (highlighted in yellow):

       

       

      briana_spi_master_pic.png

       

      Logic Analyzer probe of the SPI signals.  SPI Clock is always low.  MISO is always low, MOSI is always high:

       

      logic16_ble_spi.png




      Older code & Schematic snippets (working):

      Spi init-

      // SPI:

      #define CS1_PORT 1 // use P26 for SPI_CS1_LED1

      #define CS1_PIN 10

      #define CS2_PORT 0 // use P2 for SPI_CS2_LED2

      #define CS2_PIN 2

      #define SPEED 8000000 // Use 8M speed

      #define CS_ASSERT 0 // CS is active low

      #define CS_DEASSERT        1

      void DW_Gateway_SpiInit(void)

      {

       

          //  Use SPIFFY2 interface as master

          spi2PortConfig.masterOrSlave = MASTER2_CONFIG;

       

          //  pull for MISO for master, MOSI/CLOCK/CS if slave mode

          spi2PortConfig.pinPullConfig = INPUT_PIN_PULL_UP;

       

          //  Use P3 for CLK, P0 for MOSI and P1 for MISO

          spi2PortConfig.spiGpioConfig = MASTER2_P03_CLK_P00_MOSI_P01_MISO;

       

          //  Initialize SPIFFY2 instance

          spiffyd_init(SPIFFYD_2);

       

          //  Define this to the Port/Pin you want to use for CS. // Port = P#/16 and PIN = P# % 16

          //  Configure the CS pin and deassert it intially. If enabling output, you only need to configure once. Use gpio_setPinOutput to toggle value being o/p

      gpio_configurePin(CS1_PORT, CS1_PIN, GPIO_OUTPUT_ENABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

      gpio_configurePin(CS2_PORT, CS2_PIN, GPIO_OUTPUT_ENABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

       

          //  Configure the SPIFFY2 HW block

          spiffyd_configure(SPIFFYD_2, SPEED, SPI_MSB_FIRST, SPI_SS_ACTIVE_LOW, SPI_MODE_0); // Originally SPI_MODE_3, but problems with Freq Synth Writes

       

          // Deassert chip selects

      gpio_setPinOutput(CS1_PORT, CS1_PIN, CS_DEASSERT);

      gpio_setPinOutput(CS2_PORT, CS2_PIN, CS_DEASSERT);

      }



      new_ble.png




       

      Newer code & Schematic snippets (not working):

      Spi init-

      // SPI:

      #define CS1_PORT 1 // use P26 for SPI_CS to accelerometer

      #define CS1_PIN 10

      #define CS2_PORT 0 // use P8 for SPI_USB_CSn to USB/uController

      #define CS2_PIN 8

      void Macnica_Mpression_SpiInit(void)

      {

      gpio_configurePin(0, 0, GPIO_OUTPUT_DISABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

      gpio_configurePin(0, 1, GPIO_OUTPUT_DISABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

      gpio_configurePin(0, 2, GPIO_OUTPUT_DISABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

      gpio_setPinOutput(0, 0, CS_DEASSERT);

      gpio_setPinOutput(0, 1, CS_DEASSERT);

      gpio_setPinOutput(0, 2, CS_DEASSERT);

       

          //  Use SPIFFY2 interface as master

          spi2PortConfig.masterOrSlave = MASTER2_CONFIG;

          //  pull for MISO for master, MOSI/CLOCK/CS if slave mode

          spi2PortConfig.pinPullConfig = INPUT_PIN_PULL_UP;

       

          //  Use P3 for CLK, P0 for MOSI and P1 for MISO

          spi2PortConfig.spiGpioConfig = MASTER2_P24_CLK_P27_MOSI_P25_MISO;

          //  Initialize SPIFFY2 instance

          spiffyd_init(SPIFFYD_2);

          //  Define this to the Port/Pin you want to use for CS. // Port = P#/16 and PIN = P# % 16

          //  Configure the CS pin and deassert it intially. If enabling output, you only need to configure once. Use gpio_setPinOutput to toggle value being o/p

          gpio_configurePin(CS1_PORT, CS1_PIN, GPIO_OUTPUT_ENABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

      gpio_configurePin(CS2_PORT, CS2_PIN, GPIO_OUTPUT_ENABLE | GPIO_INPUT_DISABLE, CS_DEASSERT);

          //  Configure the SPIFFY2 HW block

      spiffyd_configure(SPIFFYD_2, SPEED, SPI_MSB_FIRST, SPI_SS_ACTIVE_LOW, SPI_MODE_0);

          // Deassert chip selects

          gpio_setPinOutput(CS1_PORT, CS1_PIN, CS_DEASSERT);

      gpio_setPinOutput(CS2_PORT, CS2_PIN, CS_DEASSERT);

      }

       

      old_ble.png