Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: SPI_isBusy problem

$
0
0
I wrote a little code for the MSP432 which communicates with the CC1200 over the SPI. The problem that I have is that the pin 4.1 which is the CSn pulls up too quickly. So I tried using SPI_isBusy to wait for the SPI to finish, but the problem remain. It seems that the SPI always returns NOT_BUSY. I watched the USBBUSY register for the ESUCI_B0 and it always stays low. Am I doing something wrong? Here is the part of the code that doesn't work. I tried manually holding CSn low for a linger time and then everything works fine. ///////////////////////////// READ FROM EXTENDED MEMORY MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_PIN1); while (MAP_GPIO_getInputPinValue(GPIO_PORT_P1, GPIO_PIN7)); while (!(MAP_SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT))); MAP_SPI_transmitData(EUSCI_B0_BASE, 0xAF); while (!(MAP_SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT))); MAP_SPI_transmitData(EUSCI_B0_BASE, 0x73); while (!(MAP_SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT))); MAP_SPI_transmitData(EUSCI_B0_BASE, 0x00); while (SPI_isBusy(EUSCI_B0_BASE) == EUSCI_SPI_BUSY); MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P4, GPIO_PIN1);

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>