Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hello,
I have to make a communication through SPI, and I have made a function to send some commands to the SPI. After make some test's and putting some breakpoints in some points of the code I verified the code stop's after sent the data to TXBUF. After that I have put a "while" condition to prevent the program take some other tasks while the TX buffer is not empty. Below i share the function code, in hope to get some help.
Thanks in advance
/*ADS1292R SPI COMMAND DATA*/ void ads1292R_SPI_CMD_DATA(uint8_t data){ unsigned char delayVar; TxData = data; ads1292R_CS_LOW(); /*ADS1292R CS LOW PIN*/ delayADS1292R(2); /*SMALL DELAY TO SETTLE*/ ads1292R_CS_HIGH(); /*ADS1292R CS HIGH PIN*/ ads1292R_CS_LOW(); /*ADS1292R CS LOW PIN*/ EUSCI_B0->TXBUF = data; /*SEND THE DATA SITTING AT THE POINTER DATA TO TX BUFFER*/ while (EUSCI_B0->STATW & EUSCI_B_STATW_BBUSY); delayVar = EUSCI_B0->RXBUF; delayADS1292R(2); /*SMALL DELAY TO SETTLE*/ }