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.

TMS320F28374S: The communication between the master and slave of the SPI

Part Number: TMS320F28374S

Hi team,

Here's an issue from the customer may need your help:

Master uses the LunchPad of the F28379D and Slave uses the product board of the F28374S chip.

Both Master and Slaver use the SPI_ex3_external_loopback_FIFO_interrupts Sample for the corresponding chip.

The Sample for Master and Slave was modified as follows:

1) Master: instead of using the transmit interrupt, use the timer to send the message in: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//
// FIFO and interrupt configuration
//
#if 0
SPI_enableFIFO(SPIB_BASE);
SPI_clearInterruptStatus(SPIB_BASE, SPI_INT_TXFF);
SPI_setFIFOInterruptLevel(SPIB_BASE, SPI_FIFO_TX2, SPI_FIFO_RX2);
SPI_enableInterrupt(SPIB_BASE, SPI_INT_TXFF);
#else
SPI_disableFIFO(SPIB_BASE);
#endif
//
// Configuration complete. Enable the module.
//
SPI_enableModule(SPIB_BASE);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2) Slave: SPIB as Slave (in Sample it was SPIA as the Slaver side). The configuration is as follows: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void initSPIBSlave(void)
{
//
// Must put SPI into reset before configuring it
//
SPI_disableModule(SPIB_BASE);
//
// SPI configuration. Use a 500kHz SPICLK and 16-bit word size.
//
SPI_setConfig(SPIB_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0,
SPI_MODE_SLAVE, 500000, 16);
SPI_disableLoopback(SPIB_BASE);
SPI_setEmulationMode(SPIB_BASE, SPI_EMULATION_FREE_RUN);
//
// FIFO and interrupt configuration
//
SPI_enableFIFO(SPIB_BASE);
SPI_clearInterruptStatus(SPIB_BASE, SPI_INT_RXFF);
SPI_setFIFOInterruptLevel(SPIB_BASE, SPI_FIFO_TX2, SPI_FIFO_RX2);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After modifying, master's SPIB sends data to Slaver's SPIB, and Slave receives the data and sends the information in an interrupt to the master. But Slave does not currently receive data in the interrupt function.

In the logic analyzer, it has been verified that the Master side sends the relevant data successfully.

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    The subject matter expert is out of office due to holiday break. Please expect response by 1st week of January. Sincere apology for inconvenience.

    Regards, Santosh

  • Hi Cherry,

    After modifying, master's SPIB sends data to Slaver's SPIB, and Slave receives the data and sends the information in an interrupt to the master. But Slave does not currently receive data in the interrupt function.

    I'd like to clarify something for my own understanding, the slave device receives data when not using an interrupt but if the interrupt is configured then no data is received?  

    Have the receive buffers on the slave device been checked to see if the data arrives?

    Best Regards,

    Marlyn