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.

MSP432P401 SPI problems

Hello,

I have a question, which may also be a problem.
I am using EUSCI_B2 SPI, where the code I have write it's the same used to perform the interface of a SDcard in the EUSCI_B0 SPI, but in this last one te code is working the only thing I have made is change the register from EUSCI_B0 to EUSCI_B2. What could I be doing wrong, shouldn't I be working the same way?

    /* Select the MSP432 SPI lines: MOSI/MISO on P3.6,7 CLK on P3.5 */
    P3->SEL0 |= BIT6 | BIT7;
    P3->SEL1 &= ~(BIT6 | BIT7);

    P3->REN &= ~(BIT7);
    P3->OUT |= BIT7;

    P3->SEL0 |= BIT5;
    P3->SEL1 &= ~BIT5;


//    MSP432 code
    EUSCI_B2->CTLW0 |= EUSCI_B_CTLW0_SWRST;                                   // Put state machine in reset

    EUSCI_B2->CTLW0 =  EUSCI_B_CTLW0_SWRST   |
                       EUSCI_B_CTLW0_MODE_0  |
                       EUSCI_B_CTLW0_MST     |
                       EUSCI_B_CTLW0_SYNC    |
                       EUSCI_B_CTLW0_CKPH    |
                       EUSCI_B_CTLW0_MSB     ;

    EUSCI_B2->CTLW0 |= EUSCI_B_CTLW0_SSEL__SMCLK;

    EUSCI_B2->BRW = 0x08;                                                             /*INITIAL SPI CLOCK MUST BE <400 kHz*/

    EUSCI_B2->CTLW0  &= ~EUSCI_B_CTLW0_SWRST;

    /* Configure the SPI CS to be on P5.1 on MSP432*/
    P5->OUT  |= BIT1;
    P5->SEL0 &= ~BIT1;
    P5->SEL1 &= ~BIT1;
    P5->DIR  |= BIT1;

    /* 50 ms delay */
    //Delay(500);


    return 0;

thanks in advanced

  • Hello Armando,

    I have limited experience with this device so I can't really comment if you have all the configuration steps accurately reflected but if you used these same steps for EUSCI_B0 then I don't see anything like you still configured a B0 pin or register incorrectly.

    You may need to check other areas of your code to make sure you changed from EUSCI_B0 to EUSCI_B2 correctly as intended.

    Best Regards,

    Ralph Jacobi

  • Hello ralph,

    Thanks for answer my question, indeed all code implemented for the eUSCI_B0, was the same I implemented in the eUSCI_b2, there is no more areas to check, all things was been reviewed and the code is the same, the only change between the both SPI ports are the sintaxe who change all tag EUSCI_B0, for the EUSCI_B2, and the pin ports.