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.

disabling sensor controller

Hi,

I have a sensor controller task that uses SPI to sample sensor data periodically.  However, my application is also sharing the SPI bus for another IC.  To avoid clashing the SPI bus, I will need to disable/stop/pause the sensor controller task from using the SPI while my application uses the SPI bus occasionally.  What is the proper way to pause and resume a sensor controller task from utilizing the SPI bus?  I have tried the following without much luck; scifAdxlOnScStopRtcTicks(),  sciUninit() and scifStopTasksNbl().

Thank You

  • Hi Harvey,

    Have you remembered to also reconfigure the IOs?

    Cheers,
    Fredrik
  • Harvey,

    What you are trying to do is not straightforward as the Sensor Controller drivers has no support for switching the pins back and forth between AUX and the MCU domain + pin handling is not integrated with the TI RTOS PIN driver.

    I think the simplest thing would be not let the Sensor Controller know that you route the pins back to the MCU domain and then route them back again before using the Sensor Controller task again.

    scifStopTasksNbl //Stop the SPI task
    scifWaitOnNbl // Wait for the task to stop.
    scifResetTaskStructs // Reset all the task structures
    scifStopRtcTicks // Stop RTC channel 2 used by the sensor controller
    scifTaskResourceUninit // Modify driver (remove static) to restore the pins back to default values defined in Sensor Controller Studio
    ...
    SPI_open  // Reconfigures pin to SPI module, opens SPI driver
    SPI_transfer // Use SPI module..
    SPI_close // Close SPI module, restores pins back to what was set by PIN_init
    ...
    scifTaskResourceInit //Route pins back to AUX domain to let them be controlled by the Sensor Controller
    scifStartTasksNbl // Start task again
    scifStartRtcTicksNow // Re-start RTC channel 2
    

    Regards,
    Svend

  • That solved it. Thank You.