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.

MSP430FR5962: MSP430 cannot receive correct data

Part Number: MSP430FR5962


Tool/software:

Hi teams:

       I am doing SPI communication now. The host is TM4C and the slave is MSP430. The host sends a frame of data. When the slave receives it, it uses an interrupt to receive the data. Then, the data is parsed. If the frame header, frame tail and CRC of this data frame are all OK, the data is parsed correctly. If there is a problem, it will not enter the parsing function.
Operation 1: The current problem is that when the two chips are powered on at the same time, the slave MSP430 occasionally fails to receive the correct data frame. It is found that the data can enter the MSP430 receiving interrupt, but cannot enter the parsing function. After that, even if TM4C periodically sends data to MSP430, MSP430 cannot respond. Why is this?
Operation 2: Add code. After a period of time, if MSP430 cannot receive the correct data, re-initialize SPI on MSP430, and then re-experiment. It is found that when the problem of operation 1 occurs, MSP430 can resume communication normally later.

Looking forward to your reply, thank you

  • Hi Xi Yan Kiana,

    Is there a race condition happening, where the TM4C device is trying to send data before the MSP430 is properly setup?

    You can set a GPIO to go high once you've finished initialization and this should help you know if the TM4C device is sending packets before the MSP430 is setup properly.

    Regards,
    Luke

  • Hi  expert:

         According to the current design, the TM4C device does send data before the MSP430 is correctly set up, so after the MSP430 is set up, since the TM4C has already sent data periodically, the MSP430 can directly trigger an interrupt to receive data.
    I would like to ask, is there any problem with TM4C sending data before the MSP430 is set up? Even if TM4C sends data in advance, it will not be received correctly if the MSP430 is not set up. MSP430 can just not respond to the data sent by TM4C before, but when the MSP430 is set up, the msp430 should be able to respond correctly to the data sent by TM4C, but it actually does not. I don't know if I understand it correctly.

  • Hi Xi,

    That is correct, you should be able to receive the next SPI request. Do you see the MSP getting stuck in any specific code section if the SPI peripheral gets enabled mid-transaction?

    See the errata page also, there may be 2 erratas that you are getting impacted with in your process flow. USCI45 and USCI47. You can scope your SPI lines also to help know if the errata impacts your use case.

    Regards,
    Luke

  • One big question is just how does the MSP430 identify the beginning of a frame? If the code just assumes that the first byte received is the beginning of a frame, it will have trouble if it isn't.

**Attention** This is a public forum