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.

MSP430F5528 SPI USCI A1 problem - UCTXIFG don't clear when data put into TX buffer



I trying send the 1 byte by UCSI A1.

The code of init:

	//Init SPI SOMI pin P4.5, SIMO pin P4.4, CLK pin P4.0
	GPIO_setAsPeripheralModuleFunctionInputPin( //May be Input or output - nevermind
	        GPIO_PORT_P4,
	        GPIO_PIN5 | GPIO_PIN4 | GPIO_PIN0
	        );

	//Set params for SPI
	USCI_A_SPI_initMasterParam params = {0};
	params.selectClockSource = USCI_A_SPI_CLOCKSOURCE_SMCLK;		
	params.clockSourceFrequency = UCS_getSMCLK();					
	params.desiredSpiClock = AFE4403_CLK_VALUE;						
	params.msbFirst = USCI_A_SPI_MSB_FIRST;							
	params.clockPhase = USCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT;	
	params.clockPolarity = USCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW; 

	//Init SPI
	returnValue = USCI_A_SPI_initMaster(USCI_A1_BASE, &params);

After that I tried send one byte by following code (I know about non-true "wait-busy" approach, it's only example ):

//Waiting buffer is ready
while (!USCI_A_SPI_getInterruptStatus(USCI_A1_BASE, UCTXIFG)); 
//Transmit data to slave device
USCI_A_SPI_transmitData(USCI_A1_BASE, 0xCA);

in Debug mode I get following picture:

As mention on the piscure UCTXIFG doesn't clear when data inserted in TX buffer and I received some data in RX buffer (which I not wating) and UCRXIFG set.

To this time I checked port mapping of MCU, power, connection to the SPI device.

So I have question - what I'm doing wrong and which reasons may be when UCTXIFG doesn't automatically clear?

**Attention** This is a public forum