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.

TMS320F28377D-EP: TMS320F28377D- EP SPIB issue with 8bit transmit and receive

Part Number: TMS320F28377D-EP

Tool/software:

We are using TMS320F28377D-EP processor for communicating with ARINC chip through SPI. The Chip is connected to SPIB with 4 wire and SPI is configured for 8bits.

We are able to establish the communication and slave device ARINC chip is able to send the response to the opcodes. We are able to see the response from the device in SPIRXBUF as 0x0030. But when we read the value to variable it is reading as '0'. Also when we single step through the SPI receive code the data is getting assigned to the variable. Without breakpoint the data is not getting assigned to variable. need your help in resolving the issue.

Issue is with only Receive Buffer and please see the code below on how are storing the data from receive buffer

SPI 8bit transmit code:

void
SPI_transmit8Bits(uint32_t base, uint8_t data)
{
uint8_t txBuffer;

txBuffer = data;

while((HWREGH(base + SPI_O_STS) & SPI_STS_BUFFULL_FLAG) != 0U)
{
}

HWREGH(base + SPI_O_TXBUF) = txBuffer;
}

SPI 8bit receive code:


uint16_t SPI_receive8Bits(uint32_t base)
{
uint16_t rxData = 0U;

ASSERT(SPI_isBaseValid(base));

while((HWREGH(base + SPI_O_STS) & SPI_STS_INT_FLAG) == 0U)
{
}

rxData = (HWREGH(base + SPI_O_RXBUF));

return(rxData);
}

  • Hello,

    Are you using interrupts to send/recieve? Since a read from RXBUF clears the interrupt flags, it is recommended to you view SPIRXEMU in the normal emulator run mode. Can you please try observing the RXEMU register instead of RXBUF? 

    To clarify, when stepping through, you are seeing the correct data being received into RXBUF and into the variable, but when just running without breakpoints/stepping, you do not see correct data?

    Can you verify that you are using the correct clock mode that the ARINC device is expecting?

    Best Regards,

    Allison