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.

CCS/CC1310: scif / PIN interaction

Part Number: CC1310

Tool/software: Code Composer Studio

Sharing peripheral between sensor controller and main CPU normally works (and is at least partially documented).

But when using PIN.h, pin mutex is not modified on initialization (PIN_open / PIN_add), leading to non-working pin. This may be technically correct, but it would be good idea to document it somewhere.

Regards,

Petr Ledvina

  • Hi Petr,

    Are you asking about more documentation about sharing pins between sensor controller applications and the system CPU application?

  • There already exists such documentation in the getting started guide generated as part of the code generation, however, i agree it should be present in the help viewer as well. I have created a ticket to include this documentation.

    Anyway, here it is:

    Share I/O Pins Between the Sensor Controller and the Application

    In some applications you may want to transfer ownership of I/O pins between the Sensor Controller and MCU domain peripherals, for example when:

    • The Sensor Controller and the application need to access different I2C devices over the same SCL and SDA lines
    • The Sensor Controller and the application need to access different SPI devices over the same SCLK, MOSI and MISO lines, but with different chip select pins

    To transfer I/O pins from Sensor Controller task(s) to the application:

    • Stop the Sensor Controller task(s) that are currently using the I/O pins
    • You can now open the TI driver(s) that require the I/O pins

    To transfer I/O pins from the application back to Sensor Controller tasks:

    • Close the TI driver(s) that are currently using the I/O pins
    • Move I/O pin ownership back to the Sensor Controller task(s):
      • For the Capacitive Touch task, call:
        • scifReinitTaskIo(1 << SCIF_CAPACITIVE_TOUCH_TASK_ID);
      • For the UART Emulator task, call:
        • scifReinitTaskIo(1 << SCIF_UART_EMULATOR_TASK_ID);
    • You can now restart the Sensor Controller task(s)

  • Hi Severin,

    I did see this documentation, but couldn't find it quickly again to link it.

    The approach works for device drivers except for PIN (<ti/drivers/PIN.h>). When task stops, pin multiplexer is still set to AUX IO (8h). Normal drivers will claim pin and set mux correctly. But PIN driver assumes that mux of uninitialized pin is set to GPIO (0h). So you can open pin that was initialized for  Sensor Controller without any error, pin input function will work, but output will silently fail.

    The fix is trivial:

    #include <ti/drivers/pin/PINcc26XX.h>

    PINCC26XX_setMux(pinHandle, pin, PINCC26XX_MUX_GPIO);

    Documentation you linked shall mention this edge case - it's quite time consuming to find cause of this problem.

    Regards,

    Petr

     

  • You are correct, thanks for the feedback. I have reported that as well to the Sensor Controller team, and will update the documentation accordingly.