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.

smartRF06 + CC2560 use other light sensor ?

Other Parts Discussed in Thread: CC2650, SYSBIOS

Hello:

I try to cover up light sensor on SmartRf06 EVM board and use another sensor like this:

There are three pin , I don't know how use SmartRF06 to connect this sensor? Does anyone knows ?

I am sure this sensor output is analogy .

  • Hi,

    On smartRF06EB there's a breakout header, its pins are connected directly to cc2650EM.

    What you need is to wire your sensor output to one of the pins which is connected to Analog capability pin of cc2650

    For more related info, please refer to smartRF06EB user's guide and schematics. Also, you'll need cc2650EM pinout, which can be found here

  • Dear lgor:

    According to smartRF06EB user's guide and CC2650EM pinout , I know  analogy light sensor use two pin :

    light sensor output :DIO_23 , and light sensor power(+):DIO_26 , so I also use those two pin to connect another

    sensor , DIO_23 connect signal and DIO_26 connect +5v , like this :

    When I cover up light sensor , led do not turn off. Because if I test SmartRF06 EVM board light sensor , led will be turn off when I cover up light sensor. I just do't know what wrong?

  • Could you measure the voltages on DIO23 and DIO26 when you connect your light sensor, and the power supply for the light sensor is on?
    Make two measurements, first one when light sensor is not covered and another one, when you covering it with, say, some dark piece of cloth
  • In fact , DIO_26 no power . I check program :
    -------------analog_light_sensor_tirtos-----------------
    #include "scif.h"
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/sysbios/BIOS.h>
    #include <Board.h>
    #include <ti/sysbios/family/arm/cc26xx/Power.h>
    #include <ti/sysbios/family/arm/cc26xx/PowerCC2650.h>
    #include <ti/drivers/pin/PINCC26XX.h>

    #define BV(n) (1 << (n))

    #define DISABLE_LOW_POWER 0

    // Display error message if the SCIF driver has been generated with incorrect operating system setting
    #ifndef SCIF_OSAL_TIRTOS_H
    #error "Generated SCIF driver supports incorrect operating system. Please change to 'TI-RTOS' in the Sensor Controller Studio project panel and re-generate the driver."
    #endif

    // Task data
    Task_Struct myTask;
    Char myTaskStack[512];

    // Semaphore used to wait for Sensor Controller task ALERT event
    static Semaphore_Struct semScTaskAlert;

    void scCtrlReadyCallback(void) {

    } // scCtrlReadyCallback

    void scTaskAlertCallback(void) {

    // Wake up the OS task
    Semaphore_post(Semaphore_handle(&semScTaskAlert));

    } // scTaskAlertCallback

    PIN_Config pLedPinTable[] = {
    Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    PIN_TERMINATE
    };
    PIN_State ledPinState;

    void taskFxn(UArg a0, UArg a1) {
    PIN_Handle hLedPins;

    // Enable LED pins
    hLedPins = PIN_open(&ledPinState, pLedPinTable);

    // Initialize the Sensor Controller
    scifOsalInit();
    scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
    scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
    scifInit(&scifDriverSetup);
    scifStartRtcTicksNow(0x00010000 / 8);

    // Configure and start the Sensor Controller's Analog Light Sensor task (not to be confused with OS tasks)
    scifTaskData.analogLightSensor.cfg.hysteresis = 16;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[0] = 0;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[1] = 400;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[2] = 600;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[3] = 800;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[4] = 1000;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[5] = 4095;
    scifStartTasksNbl(BV(SCIF_ANALOG_LIGHT_SENSOR_TASK_ID));

    // Main loop
    while (1) {

    // Wait for an ALERT callback
    Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);

    // Clear the ALERT interrupt source
    scifClearAlertIntSource();

    // Find the ADC bin value (can access directly since it is a single, single-buffered value, and
    // we always want the latest value)
    uint16_t bin = scifTaskData.analogLightSensor.output.bin;

    // Disable all LEDs and then enable as many as indicated by the current bin
    PIN_setOutputValue(hLedPins, Board_LED1, (bin >= 1));
    PIN_setOutputValue(hLedPins, Board_LED2, (bin >= 2));
    PIN_setOutputValue(hLedPins, Board_LED3, (bin >= 3));
    PIN_setOutputValue(hLedPins, Board_LED4, (bin >= 4));

    // Acknowledge the alert event
    scifAckAlertEvents();
    }

    } // taskFxn

    int main(void) {
    Task_Params taskParams;

    // Optional: Prevent the system from entering standby to allow debugging
    #if DISABLE_LOW_POWER
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
    #endif

    // Initialize the PIN driver
    PIN_init(BoardGpioInitTable);

    // Configure the OS task
    Task_Params_init(&taskParams);
    taskParams.stack = myTaskStack;
    taskParams.stackSize = sizeof(myTaskStack);
    taskParams.priority = 3;
    Task_construct(&myTask, taskFxn, &taskParams, NULL);

    // Create the semaphore used to wait for Sensor Controller ALERT events
    Semaphore_Params semParams;
    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;
    Semaphore_construct(&semScTaskAlert, 0, &semParams);

    // Start TI-RTOS
    BIOS_start();
    return 0;

    } // main
    --------------------------End-----------------
    it's not define light sensor power is DIO_26 and light sensor output is DIO_23,
    But why SmartRF06 light sensor no need to define pin that still can working?
  • In fact, DIO26 no voltages , I check this code :
    ------------------start-------------------
    #define BV(n) (1 << (n))

    #define DISABLE_LOW_POWER 0

    Task_Struct myTask;
    Char myTaskStack[512];

    static Semaphore_Struct semScTaskAlert;

    void scCtrlReadyCallback(void) {

    } // scCtrlReadyCallback

    void scTaskAlertCallback(void) {

    // Wake up the OS task
    Semaphore_post(Semaphore_handle(&semScTaskAlert));

    } // scTaskAlertCallback

    PIN_Config pLedPinTable[] = {
    Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    PIN_TERMINATE
    };
    PIN_State ledPinState;

    void taskFxn(UArg a0, UArg a1) {
    PIN_Handle hLedPins;

    // Enable LED pins
    hLedPins = PIN_open(&ledPinState, pLedPinTable);

    // Initialize the Sensor Controller
    scifOsalInit();
    scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
    scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
    scifInit(&scifDriverSetup);
    scifStartRtcTicksNow(0x00010000 / 8);

    // Configure and start the Sensor Controller's Analog Light Sensor task (not to be confused with OS tasks)
    scifTaskData.analogLightSensor.cfg.hysteresis = 16;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[0] = 0;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[1] = 400;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[2] = 600;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[3] = 800;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[4] = 1000;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[5] = 4095;
    scifStartTasksNbl(BV(SCIF_ANALOG_LIGHT_SENSOR_TASK_ID));

    // Main loop
    while (1) {

    // Wait for an ALERT callback
    Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);

    // Clear the ALERT interrupt source
    scifClearAlertIntSource();

    // Find the ADC bin value (can access directly since it is a single, single-buffered value, and
    // we always want the latest value)
    uint16_t bin = scifTaskData.analogLightSensor.output.bin;

    // Disable all LEDs and then enable as many as indicated by the current bin
    PIN_setOutputValue(hLedPins, Board_LED1, (bin >= 1));
    PIN_setOutputValue(hLedPins, Board_LED2, (bin >= 2));
    PIN_setOutputValue(hLedPins, Board_LED3, (bin >= 3));
    PIN_setOutputValue(hLedPins, Board_LED4, (bin >= 4));

    // Acknowledge the alert event
    scifAckAlertEvents();
    }

    } // taskFxn

    int main(void) {
    Task_Params taskParams;

    // Optional: Prevent the system from entering standby to allow debugging
    #if DISABLE_LOW_POWER
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
    #endif

    // Initialize the PIN driver
    PIN_init(BoardGpioInitTable);

    // Configure the OS task
    Task_Params_init(&taskParams);
    taskParams.stack = myTaskStack;
    taskParams.stackSize = sizeof(myTaskStack);
    taskParams.priority = 3;
    Task_construct(&myTask, taskFxn, &taskParams, NULL);

    // Create the semaphore used to wait for Sensor Controller ALERT events
    Semaphore_Params semParams;
    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;
    Semaphore_construct(&semScTaskAlert, 0, &semParams);

    // Start TI-RTOS
    BIOS_start();
    return 0;

    } // main
    ----------------End-------------
    According to that code , no define DIO23 is output and DIO26 is power.
    But why SmartRF06 light sensor no need to define pin that still can working?
  • In fact, DIO26 no voltages , I check my code ,no define DIO23 is output and DIO26 is power.
    But why SmartRF06 light sensor no need to define pin that still can working?


    #include "scif.h"
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/sysbios/BIOS.h>
    #include <Board.h>
    #include <ti/sysbios/family/arm/cc26xx/Power.h>
    #include <ti/sysbios/family/arm/cc26xx/PowerCC2650.h>
    #include <ti/drivers/pin/PINCC26XX.h>

    #define BV(n) (1 << (n))

    #define DISABLE_LOW_POWER 0

    // Display error message if the SCIF driver has been generated with incorrect operating system setting
    #ifndef SCIF_OSAL_TIRTOS_H
    #error "Generated SCIF driver supports incorrect operating system. Please change to 'TI-RTOS' in the Sensor Controller Studio project panel and re-generate the driver."
    #endif

    // Task data
    Task_Struct myTask;
    Char myTaskStack[512];

    // Semaphore used to wait for Sensor Controller task ALERT event
    static Semaphore_Struct semScTaskAlert;

    void scCtrlReadyCallback(void) {

    } // scCtrlReadyCallback

    void scTaskAlertCallback(void) {

    // Wake up the OS task
    Semaphore_post(Semaphore_handle(&semScTaskAlert));

    } // scTaskAlertCallback

    PIN_Config pLedPinTable[] = {
    Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    Board_LED4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    PIN_TERMINATE
    };
    PIN_State ledPinState;

    void taskFxn(UArg a0, UArg a1) {
    PIN_Handle hLedPins;

    // Enable LED pins
    hLedPins = PIN_open(&ledPinState, pLedPinTable);

    // Initialize the Sensor Controller
    scifOsalInit();
    scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
    scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
    scifInit(&scifDriverSetup);
    scifStartRtcTicksNow(0x00010000 / 8);

    // Configure and start the Sensor Controller's Analog Light Sensor task (not to be confused with OS tasks)
    scifTaskData.analogLightSensor.cfg.hysteresis = 16;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[0] = 0;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[1] = 400;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[2] = 600;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[3] = 800;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[4] = 1000;
    scifTaskData.analogLightSensor.cfg.pBinThresholds[5] = 4095;
    scifStartTasksNbl(BV(SCIF_ANALOG_LIGHT_SENSOR_TASK_ID));

    // Main loop
    while (1) {

    // Wait for an ALERT callback
    Semaphore_pend(Semaphore_handle(&semScTaskAlert), BIOS_WAIT_FOREVER);

    // Clear the ALERT interrupt source
    scifClearAlertIntSource();

    // Find the ADC bin value (can access directly since it is a single, single-buffered value, and
    // we always want the latest value)
    uint16_t bin = scifTaskData.analogLightSensor.output.bin;

    // Disable all LEDs and then enable as many as indicated by the current bin
    PIN_setOutputValue(hLedPins, Board_LED1, (bin >= 1));
    PIN_setOutputValue(hLedPins, Board_LED2, (bin >= 2));
    PIN_setOutputValue(hLedPins, Board_LED3, (bin >= 3));
    PIN_setOutputValue(hLedPins, Board_LED4, (bin >= 4));

    // Acknowledge the alert event
    scifAckAlertEvents();
    }

    } // taskFxn

    int main(void) {
    Task_Params taskParams;

    // Optional: Prevent the system from entering standby to allow debugging
    #if DISABLE_LOW_POWER
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
    #endif

    // Initialize the PIN driver
    PIN_init(BoardGpioInitTable);

    // Configure the OS task
    Task_Params_init(&taskParams);
    taskParams.stack = myTaskStack;
    taskParams.stackSize = sizeof(myTaskStack);
    taskParams.priority = 3;
    Task_construct(&myTask, taskFxn, &taskParams, NULL);

    // Create the semaphore used to wait for Sensor Controller ALERT events
    Semaphore_Params semParams;
    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;
    Semaphore_construct(&semScTaskAlert, 0, &semParams);

    // Start TI-RTOS
    BIOS_start();
    return 0;

    } // main