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_isBusy problem

Other Parts Discussed in Thread: CC1200

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);

  • Dear Jasaleja,
    Which version of the driverLib are you using? The reason I ask is that the other API calls have the 'MAP_' prefix while the check for SPI_isBusy does not. You could try using a direct register access to the status register or simply reuse the Transmit interrupt to verify that the transmit has completed. I will look into this specific API and try to recreate the issue.

    Best Regards,
    Chris
  • I am using MSP432 DriverLib - v3_10_00_09. I forgot to add the MAP_ prefix to the SPI_isBusy function call. Now i added it, but it still doesn't work. I tried using the transmit interrupt, and the CSn still pulls up to early. Than I tried using direct register access, and now it works. I would say that SPI_isBusy is bugged by these results, but you should check it. I can send my whole code if you need it.

  • Jasaleja,
    Thank you for testing the direct register access. I agree with your assessment and will submit a bug against this API.

    Thank you and Best Regards,
    Chris

**Attention** This is a public forum