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.

TMS320F28335: F28335 MAX31856 SPI

Part Number: TMS320F28335

 

I am trying to do SPI communication with MAX31856 (temperature measurement) using TMS320F28335.

0x0c is transmitted in the first byte
Transmit the remaining 3 bytes 0x00.

The problem is that the values received are not constant and are displayed as 254 or 255.

In my opinion, I think that communication is going on. (It may not be.)

Also, I think there is nothing wrong with the hardware connection.

Below is the code I wrote, I think there is an error in the received value.

What could be causing this?

Thanks for your help.

while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG);
    TxData[0]=0x0c;
    SpiaRegs.SPITXBUF = (TxData[0]<<8);

    while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG);
    TxData[1]=0x00; //dummy byte
    SpiaRegs.SPITXBUF = TxData[1];

    while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG);
    TxData[2]=0x00;
    SpiaRegs.SPITXBUF = TxData[2];

    while(SpiaRegs.SPISTS.bit.BUFFULL_FLAG);
    TxData[3]=0x00;
    SpiaRegs.SPITXBUF = TxData[3];

    for(i=0;i<4;i++)
    {
        RxData[i] = SpiaRegs.SPIRXBUF;
    }