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.

MSP430FR5869: MSP430FR5869 read data wrong

Part Number: MSP430FR5869

Dear Sir,

In my project, MSP430FR5869 is connecting to CPU through SPI interface. MSP430FR5869 is the slave, CPU is the master.

Below is setting for SPI on MSP430FR5869:

void config_spi(void)
{
//select spi gpio
P2SEL1 |= BIT4 | BIT5 | BIT6;

UCA1CTLW0 |= UCSWRST;
UCA1CTLW0 |= UCMSB + UCSYNC;
// UCA1BRW = 4; // prescale

UCA1CTLW0 &= ~UCSWRST;
UCA1IE |= UCRXIE;
UCA1IE |= UCTXIE;
}

Sometime, MSP430 is incorrect working. After investigate, I find that although CPU send 0x03 code but MSP430 only receive 0x01 code. Or CPU send 0x03 but MSP430 only receive 0x30.

Please help me fix it if possible. 

  • Hi,

    I do not see anything in your initialization code that is necessarily wrong. To help further, I would need to know more about our setup. Are you using a TI EVM or target board, or are you using your own board? Also, how are you translating from SPI to the CPU? And how are you viewing the bytes that are sent? Are you using a logic analyzer?

    Regards,
    Nathan
  • Hi Nathan,

    Thank for your reply.

    MSP430FR5869 and CPU have been build on our board.  We check data that MSP430 or CPU has been received through UART debugger on MSP430 and CPU. And we also monitored data transmit on the transmission line through an oscilloscope. Sometimes, Although CPU sends 0x03 but MSP430 only receive 0x01  Or CPU send 0x03 but MSP430 only receive 0x30.

    On the forum, I saw a member who also reports the issue of MSP430 as me but I didn't find any answer from TI employee to help solve it:

    e2e.ti.com/.../431926

    Could I fix it by software ? or I must to change hardware and use a new MCU?

    Regards,

    Son

  • Hi Nathan,

    How are you? Do you have any solution to solve my issue? 

    Regards,
    Son

  • Hi Son,

    Please check to make sure all of the SPI configurations on the CPU (your SPI master) match those of the MSP430. Specifically, please look at the clock phase, clock polarity, bit order (you are using MSB first on the MSP430 which is not standard), length of data (make sure the CPU is assuming 8-bit), and SPI mode (the MSP430 is using 3 wire by default).

    The main difference between the issue that you are seeing and the E2E post that you linked to is that you said that you are only seeing the issue some of the time. Because of this, this may be a hardware issue. Do you have access to a logic analyzer or oscilloscope to probe the MOSI and MISO lines? This can help us determine if the issue is occurring upon transmit from the MSP430, or if there is an issue with how the CPU is interpreting the data.

    Regards,
    Nathan
  • Hi Son,

    Has this issue been resolved? If so, please mark it as answered. If no response soon, this thread will be closed due to inactivity.

    Regards,
    Nathan
  • Hi Nathan,

    My issue has fixed by software with notes in the article: https://stackoverflow.com/questions/24931268/can-i-configure-gpio-pins-after-disabling-high-impedance-mode

    I will only run "PM5CTL0 &= ~LOCKLPM5" after completed configure function of pin.

    Thanks for your support.

**Attention** This is a public forum