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.

RTOS/CC1310: RTOS/CC1310

Part Number: CC1310
Other Parts Discussed in Thread: TMP116, SYSBIOS

Tool/software: TI-RTOS

Hello,

I come back to you, I can't find the source of the leak current which is 129 uA and carrying I check the parameters likely to be the source of this current.

(Custum PCB CC1310 4X4 RSM INTERFACED WITH TMP116)

1- I delete the code concerning the UART;

2- I check the unused pin

3- I redid the code concerning the temperature part with the necessary recommendations;

Hello In addition to that, 

Before the opening of the sensor my system goes into standby mode just after the opening of the sensor the system consumes 129 uA, despite after the sending of RF data I added a Tasksleep, how to return to standby mode and why the sensor remains active?

Thanks for help; 

Are there other parameters to check, please ? 

  • Hello Abdelkader,
    Are you using clocks or timers? Check for any other peripherals that may be open.
    Regards,
    Prashanth
  • Hello, PrashanthS
    i used Clock and I don't have other peripherals that is active.
  • Hello Abdelkader,
    In that case please try disabling the clock to check if that is the culprit. You can use Clock_stop() to turn it off. 
    Regards,
    Prashanth

  • Thank you for your prompt response,

    can you explain to me why and how to add Clock_stop with an example if possible, please?

    Regards,
  • Hello again,
    I am applying Clock_stop as indicated by the following code and then the current to be increased to 3mA.

    /*
    * Copyright (c) 2015-2016, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */

    /*
    * ======== rfEasyLinkTx.c ========
    */
    /* XDCtools Header files */
    #include <pthread.h>
    #include <stdlib.h>
    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Error.h>
    #include <stdint.h>
    #include <stddef.h>
    #include <unistd.h>
    #include <semaphore.h>
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>


    /* BIOS Header files */
    #include <ti/drivers/rf/RF.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Clock.h>
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/I2C.h>


    /* TI-RTOS Header files */
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/Power.h>

    #include <ti/devices/cc13x0/driverlib/aon_batmon.h>
    #include <ti/devices/cc13x0/driverlib/aux_adc.h>
    #include <ti/devices/cc13x0/driverlib/chipinfo.h>
    #include <ti/devices/cc13x0/driverlib/sys_ctrl.h>
    #include <semaphore.h>
    #include <ti/sail/tmp116/tmp116.h>

    /* Board Header files */
    #include "Board.h"

    /* EasyLink API Header files */
    #include "easylink/EasyLink.h"

    #include "sc/scif.h"

    #include "version.h"
    #include "../sonde_gw_fw/sys_intf.h"

    #include <string.h>
    #include <math.h>



    #define RFEASYLINKTX_TASK_STACK_SIZE 1024
    #define RFEASYLINKTX_TASK_PRIORITY 2

    #define RFEASYLINKTX_BURST_SIZE 1

    Clock_Params clkParams;
    Clock_Handle clk2;

    Task_Struct txTask; /* not static so you can see in ROV */
    static Task_Params txTaskParams;
    static uint8_t txTaskStack[RFEASYLINKTX_TASK_STACK_SIZE];

    Task_Struct sensorTask; /* not static so you can see in ROV */
    static Task_Params sensorTaskParams;
    static uint8_t sensorTaskStack[RFEASYLINKTX_TASK_STACK_SIZE];

    typedef struct {
    uint8_t reason;
    int16_t temp_deg_frac_8;
    uint8_t bat_20mV;
    } opto_sonde_data_t;


    static void rfEasyLinkTxFnx(UArg arg0, UArg arg1)
    {

    opto_sonde_data_t* optosonde_data = (opto_sonde_data_t*) arg0;
    // rtc_cmd_t* rtc_cmd = arg1;

    // EasyLink_init(EasyLink_Phy_625bpsLrm);
    // EasyLink_init(EasyLink_Phy_5kbpsSlLr);
    EasyLink_init(EasyLink_Phy_Custom);

    /*
    * If you wish to use a frequency other than the default, use
    * the following API:
    * EasyLink_setFrequency(868000000);
    */

    /* Set output power to 12dBm */
    // EasyLink_setRfPwr(12);
    EasyLink_setRfPwr(10);

    EasyLink_TxPacket txPacket;

    // Fill packet data
    uint8_t payload_ptr = 0;
    // Payload version
    txPacket.payload[payload_ptr++] = (uint8_t) (0x0);
    // Src MAC
    EasyLink_getIeeeAddr(&txPacket.payload[payload_ptr]);
    payload_ptr += 8;

    // Copy data
    txPacket.payload[payload_ptr++] = (uint8_t) (optosonde_data->reason);
    txPacket.payload[payload_ptr++] = (uint8_t) (optosonde_data->temp_deg_frac_8 >> 8);
    txPacket.payload[payload_ptr++] = (uint8_t) (optosonde_data->temp_deg_frac_8);

    txPacket.payload[payload_ptr++] = (uint8_t) (optosonde_data->bat_20mV);

    // Firmware version
    memcpy(&txPacket.payload[payload_ptr], &VERSION_HASH, sizeof(VERSION_HASH));
    payload_ptr += sizeof(VERSION_HASH);

    txPacket.len = payload_ptr;
    txPacket.absTime = 0;
    txPacket.dstAddr[0] = OPTOSONDE_ADDR;

    EasyLink_Status result = EasyLink_transmit(&txPacket);

    if (result == EasyLink_Status_Success)
    {
    /* Toggle LED1 to indicate TX */
    // PIN_setOutputValue(pinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
    }
    else
    {
    /* Toggle LED1 and LED2 to indicate error */
    // PIN_setOutputValue(pinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
    // PIN_setOutputValue(pinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
    }

    // Prevent button reset overload
    //if (optosonde_data->reason == optosonde_reason_button) {
    //Task_sleep(1000000 / Clock_tickPeriod);
    //}


    Clock_Params_init(&clkParams);
    clkParams.period = 8000000;
    clkParams.startFlag = TRUE;
    Clock_stop(clk2);
    //Task_sleep(30000 * 100);

    SysCtrlSystemReset();

    }



    void sendorTask(UArg arg0, UArg arg1)
    {
    static opto_sonde_data_t optosonde_data;

    float temperature;
    I2C_Handle i2c;
    TMP116_Handle tmp116Handle;
    I2C_Params i2cParams;
    TMP116_Params tmp116Params;
    I2C_Params_init(&i2cParams);
    i2cParams.transferMode = I2C_MODE_BLOCKING;
    i2cParams.bitRate = I2C_400kHz;
    i2c = I2C_open(Board_I2C_TMP, &i2cParams);
    if (i2c == NULL) {

    }
    else {
    }

    TMP116_Params_init(&tmp116Params);
    Task_sleep(30000 * 100); // 30 s

    tmp116Handle = TMP116_open(Board_I2C_TMP, i2c, &tmp116Params);


    if (tmp116Handle == NULL){ // verifier l'ouverture correcte
    }else
    {
    }

    Task_sleep(2000 * 100); //Wait 2s

    if (TMP116_getTemp(tmp116Handle, TMP116_CELSIUS, &temperature)) {

    }

    else {
    }

    TMP116_close (tmp116Handle);

    I2C_close(i2c);

    uint16_t MSB = (uint8_t) (temperature);
    uint8_t LSB = (uint8_t) ((temperature - MSB ) * 100);


    optosonde_data.temp_deg_frac_8 = (MSB<<8) +LSB;

    while (!AONBatMonNewBatteryMeasureReady())
    {
    // Wait
    Task_sleep(100 * 100 / Clock_tickPeriod);
    }
    optosonde_data.bat_20mV = (AONBatMonBatteryVoltageGet() * 390625) / 2000000;
    AONBatMonDisable();

    // Init Tx task
    Task_Params_init(&txTaskParams);
    txTaskParams.stackSize = RFEASYLINKTX_TASK_STACK_SIZE;
    txTaskParams.priority = RFEASYLINKTX_TASK_PRIORITY + 1;
    txTaskParams.stack = &txTaskStack;
    txTaskParams.arg0 = (xdc_UArg) &optosonde_data;

    Task_construct(&txTask, rfEasyLinkTxFnx, &txTaskParams, NULL);

    }

    /*
    * ======== main ========
    */
    int opto_main(void)

    {
    /* Call driver init functions. */
    Board_initGeneral();
    Board_initI2C();

    Task_Params_init(&sensorTaskParams);
    txTaskParams.stackSize = RFEASYLINKTX_TASK_STACK_SIZE;
    txTaskParams.priority = RFEASYLINKTX_TASK_PRIORITY;
    txTaskParams.stack = &sensorTaskStack;
    txTaskParams.arg0 = 0;
    txTaskParams.arg1 = 0;

    Task_construct(&sensorTask,sendorTask,&sensorTaskParams, NULL);

    /* Start BIOS */
    BIOS_start();

    return (0);
    }
  • Hello Abdelkader,

    I am not sure why you have SysCtrlSystemReset() right after clock_stop(). It does not sound like it is ever doing to sleep after the clock_stop() as the system resets right after. Try to add your sleep after the clock_stop() and see how much current you measure.

    Regards,
    Prashanth
  • Hello PrashanthS,
    Thank you very much for replying and support,
    After implementing your recommendations the system has gone through three phases:
    1- Before opening the TMP116 sensor the system current is at 4 uA, standby mode;
    2-after the opening of the sensor and sending the RF data the current to go to 135 uA, this to last for a second, this is active sensor conversion mode;
    3- After stop clock and task sleep the system current to pass and stay at 6mA.
    I hope I managed to explain.

    Thank you for support.
  • Hello PrashanthS,
    It's good I found answer to my questions, thanks for the help to you and your team,

    Best regards,