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.

SPI Modes ?

Other Parts Discussed in Thread: MSP430FR2355

Hello everyone,

I am having trouble with using SPI (currently just learning how to use it on MSP430FR2355).

My scenario is SPI master connected to oscilloscope and just looking at what comes out.

So if I put spi mode to EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH all works fine, but if I put it to EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW my program stops in while loop:

while (!EUSCI_B_SPI_getInterruptStatus(EUSCI_B1_BASE,
EUSCI_B_SPI_TRANSMIT_INTERRUPT)) ;

While I am trying to send data.

What is purpose of this mode? Could someone please explain. Also what could be the reason that program gets locked in that while loop forever?

I have checked numerous time that only this change makes it loop forever, nothing else.

My SPI configuration looks like:


//Initialize Master
EUSCI_B_SPI_initMasterParam spi_param = {0};
spi_param.selectClockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK;
spi_param.clockSourceFrequency = CS_getSMCLK();
spi_param.desiredSpiClock = 1000000;
spi_param.msbFirst = EUSCI_B_SPI_MSB_FIRST;
spi_param.clockPhase = EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT;
spi_param.clockPolarity = EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH;
spi_param.spiMode = EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH;
EUSCI_B_SPI_initMaster(EUSCI_B1_BASE, &spi_param);

//Enable SPI module
EUSCI_B_SPI_enable(EUSCI_B1_BASE);

EUSCI_B_SPI_clearInterrupt(EUSCI_B1_BASE,EUSCI_B_SPI_RECEIVE_INTERRUPT);

// Enable USCI_B1 RX interrupt
EUSCI_B_SPI_enableInterrupt(EUSCI_B1_BASE,EUSCI_B_SPI_RECEIVE_INTERRUPT);

//Wait for slave to initialize
__delay_cycles(100);

**Attention** This is a public forum