RTOS/IWR1443: Using Chip Select for IWR as SPI slave

Part Number: IWR1443

Tool/software: TI-RTOS

Hi, 

I am trying to talk to multiple IWR1443 radars from a single MSP430 on the same SPI bus using chip select lines from the MSP430. The driver documentation says the SPI driver operates transparent from the chip select. How do I enable the SPI module in the IWR1443 to be chip select aware?

Thanks,

Kevin

3 Replies

  • Hi Kevin,

    When using the SPI in slave mode, the driver enables the hardware to chip select 0 automatically by default.  You can change it to use a different chip select on the device by adding the line below in bold to your code and changing the value.

    SPI Slave setup example code snippet from mmwave_sdk_01_02_00_05/packages/ti/drivers/spi/docs/doxygen/html/index.html:

    SPI_Handle      handle;

    SPI_Params      params;

    SPI_Transaction spiTransaction;

    SPI_Params_init(&params);

    params.mode = SPI_SLAVE;

    params.frameFormat = SPI_POL0_PHA0;

    params.pinMode = SPI_PINMODE_4PIN_CS;

    params.shiftFormat = SPI_MSB_FIRST;

    params.dmaEnable = 1;

    params.dmaHandle = gDmaHandle;

    params.u.slaveParams.dmaCfg.txDmaChanNum =1U;

    params.u.slaveParams.dmaCfg.rxDmaChanNum =0U;

    params.u.slaveParams.chipSelect =0U;  // 0 = chip select 0, 1 = chip select 1, etc.

    handle = SPI_open(someSPI_configIndexValue, &params);

    if (!handle) {

       System_printf("SPI did not open");

    }

    If you are interested in more information on the hardware itself, the SPI slave chip select functionality is enabled using the SPIPC0 register in the SPI module.  The "Multi-Buffered Serial Peripheral Interface Module (MibSPI)" section in the Industrial Family TRM doc has more details.

    Regards,

    John

  • In reply to JohnH:

    Thanks John,

    I gave this a try with chipSelect set to 0,  1, and 2. I am using the IWR1443 boost eval kit. When it was set to 0, it did not receive any data regardless of the chip select. When set to 1 or 2, it received data regardless of the chip select.

    What is the correct chipSelect number for the SPI_CS_1 pin on the IWR1443?

    My code is as follows:

    mmw_spi.c

  • In reply to Kevin Lannen:

    Hi Kevin,

    Since there is only one chip select pin on the device per SPI peripheral the SPI_CS_1 pin should correspond to chip select 0 for the first SPI peripheral (MIBSPIA (index = 0 for SPI_open() function)). If you have a IWR1443 Rev B EVM you may want to check that S1 is open so that the SPI/CAN mux is selecting SPI (see the Rev B EVM schematic for more details).

    Regards,
    John