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.

SPI RX buffer not updating in slave mode (F28069)

I am currently running into an issue running my C2000 in slave mode to receive data using the SPI B module. I am transmitting 16-bit characters from the SPI master every 5 seconds. When I am debugging my chip, the SPIDAT register changes value every 5 seconds, indicating that the C2000 slave is properly receiving these characters.

However, my SPI RX buffer is always 0 and does not change. I am including the code I used to configure my SPIB peripheral as a slave. The master is actually another C2000 chip with identical clk + baud rate settings (but configured as a master instead of a slave) if that is of any use.

Any help figuring out where to start debugging is greatly appreciated!

void InitSPIB(void)
{
SpibRegs.SPICCR.bit.SPISWRESET = 0; // Hold SPI in reset
SpibRegs.SPICCR.bit.SPICHAR = 15; // 16 bit char
SpibRegs.SPICCR.bit.CLKPOLARITY = 1; // Output on falling edge
SpibRegs.SPICCR.bit.SPILBK = 0; // No Loopback
SpibRegs.SPICCR.bit.SPISWRESET = 1; // Release SPI from reset

SpibRegs.SPIBRR = 37;
// SPI Bit Rate = LSPCLK / ( SPIBRR + 1)
// = 20 MHz / ( 37 + 1 )
// = 0.52 MHz

SpibRegs.SPICTL.bit.MASTER_SLAVE = 0; // Slave mode
SpibRegs.SPICTL.bit.CLK_PHASE = 0; // No Delay
SpibRegs.SPICTL.bit.OVERRUNINTENA = 0; // Disable
SpibRegs.SPICTL.bit.TALK = 0; // Disable TX, slave only receives chars
SpibRegs.SPICTL.bit.SPIINTENA = 1; // Enable Interrupt Request

PieCtrlRegs.PIEIER6.bit.INTx3 = 1; //enable SPIRXINTB 

}

 

interrupt void SPIRXINTB_ISR(void) // PIE6.3 @ 0x000D94 SPIRXINTB (SPI-B)

{

found = 1;
pitch = SpibRegs.SPIRXBUF; //reading SPIRXBUFB clears the SPI INT Flag

PieCtrlRegs.PIEACK.all = PIEACK_GROUP6; // Must acknowledge the PIE group

// Next two lines for debug only - remove after inserting your ISR
// asm (" ESTOP0"); // Emulator Halt instruction
// while(1);
}