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.

CC26xx power management for UART Deiver question

Other Parts Discussed in Thread: CC2640, SYSBIOS

Dear All:

I refer power management for CC26xx SimpleLink Wireless MCUs User’s Guide Chapter 3,

it's about UART Drive , when the URAT drive opens , it's declares a power dependency upon the UART peripheral , with a call

to Power_setDependency() , if I use empty project , where should I put Power_setDependency() ?

seems I get error ...

  • Since you don't define hwAttrs in your project, you can use the following defines in PowerCC26XX.h instead of hwAttrs->powerMngrId.

    #define PowerCC26XX_PERIPH_GPT0 0
    #define PowerCC26XX_PERIPH_GPT1 1
    #define PowerCC26XX_PERIPH_GPT2 2
    #define PowerCC26XX_PERIPH_GPT3 3
    #define PowerCC26XX_PERIPH_SSI0 4
    #define PowerCC26XX_PERIPH_SSI1 5
    #define PowerCC26XX_PERIPH_UART0 6
    #define PowerCC26XX_PERIPH_I2C0 7
    #define PowerCC26XX_PERIPH_TRNG 8
    #define PowerCC26XX_PERIPH_GPIO 9
    #define PowerCC26XX_PERIPH_UDMA 10
    #define PowerCC26XX_PERIPH_CRYPTO 11
    #define PowerCC26XX_PERIPH_I2S 12
    #define PowerCC26XX_PERIPH_RFCORE 13
    #define PowerCC26XX_XOSC_HF 14
    #define PowerCC26XX_DOMAIN_PERIPH 15
    #define PowerCC26XX_DOMAIN_SERIAL 16
    #define PowerCC26XX_DOMAIN_RFCORE 17
    #define PowerCC26XX_DOMAIN_SYSBUS 18
    #define PowerCC26XX_NUMRESOURCES 19
  • I had include :
    #include <ti/drivers/power/PowerCC26XX.h>
    just like you said.

    my purpose is easy , just want let CC2640 into sleep node , so I can test power consume will be 1~2 μA ,
    but most of people tell me that I don't need to worry about how to into sleep mode or standby mode , TI RTOS
    will into standby mode if nothing to do. I did , after awhile , power consume is 4.15mA . I am curious of how is it into standby mode
    and power consume is 1~2 μA ?
  • If you use TI BLE stack and define POWER_SAVING, CC2640 would enter sleep mode when there is nothing to handle in task queue. If you use TI RTOS directly, I think this would be automatic.
  • You mean define POWER_SAVING ? Even I am not use BLE protocel , I still use TI BLE stack let CC2640 can working?
    in SimpleBLEPeripheral project main.c code ,

    #include <ti/sysbios/family/arm/cc26xx/Power.h>
    ...
    ...
    ...
    int main(){
    ...
    ...
    #ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
    #endif // POWER_SAVING

    it's gray area , means power saving is not working ?
    }
  • Those two are Power_SB_DISALLOW and Power_IDLE_PD_DISALLOW and disallow means not power saving. If you don't define POWER_SAVING, they would be enable.
  • That's why you said CC2640 will into standby mode if it's noting to do.
    because I don't need to worry about power consume , it's automatic.
    but when I measure cc2640 standby mode power consume , it's not low power ?
    I mark SimpleBLEPeripheral_createTask() in main.c like this :
    //SimpleBLEPeripheral_createTask();
  • I have done similar test in www.ti.com/.../swra478a.pdf and see similar results. I suggest you to do the same steps.
  • Hello:
    I still not fix Power_setDependency question.
  • If you use SimpleBLEPeripheral example, you don't have to call Power_setDependency.
  • In fact , I am not use SimpleBLEPeripheral example , I use Empty example:

    /*

    *  ======== empty.c ========

    */

    /* XDCtools Header files */

    #include <xdc/std.h>

    #include <xdc/runtime/System.h>

    /* BIOS Header files */

    #include <ti/sysbios/BIOS.h>

    #include <ti/sysbios/knl/Clock.h>

    #include <ti/sysbios/knl/Task.h>

    /* TI-RTOS Header files */

    #include <ti/drivers/I2C.h>

    #include <ti/drivers/PIN.h>

    #include <ti/drivers/SPI.h>

    #include <ti/drivers/UART.h>

    #include <ti/drivers/Watchdog.h>

    #include <ti/drivers/Power.h>

    #include <ti/drivers/power/PowerCC26XX.h>

    /* Board Header files */

    #include "Board.h"

    #define TASKSTACKSIZE   512

    Task_Struct task0Struct;

    Char task0Stack[TASKSTACKSIZE];

    /* Pin driver handle */

    static PIN_Handle ledPinHandle;

    static PIN_State ledPinState;

    /*

    * Application LED pin configuration table:

    *   - All LEDs board LEDs are off.

    */

    PIN_Config ledPinTable[] = {

       Board_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,

       Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,

       PIN_TERMINATE

    };

    /*

    *  ======== heartBeatFxn ========

    *  Toggle the Board_LED0. The Task_sleep is determined by arg0 which

    *  is configured for the heartBeat Task instance.

    */

    Void heartBeatFxn(UArg arg0, UArg arg1)

    {

       while (1) {

           Task_sleep((UInt)arg0);

           PIN_setOutputValue(ledPinHandle, Board_LED0,

                              !PIN_getOutputValue(Board_LED0));

       }

    }

    /*

    *  ======== main ========

    */

    int main(void)

    {

       Task_Params taskParams;

       /* Call board init functions */

       Board_initGeneral();

       //Board_initI2C();

       //Board_initSPI();

       Board_initUART();

       // Board_initWatchdog();

       /* Construct heartBeat Task  thread */

       Task_Params_init(&taskParams);

       taskParams.arg0 = 1000000 / Clock_tickPeriod;

       taskParams.stackSize = TASKSTACKSIZE;

       taskParams.stack = &task0Stack;

       Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);

       Power_setDependency(hwAttrs->powerMngrId);   //error

       /* Open LED pins */

       ledPinHandle = PIN_open(&ledPinState, ledPinTable);

       if(!ledPinHandle) {

           System_abort("Error initializing board LED pins\n");

       }

       PIN_setOutputValue(ledPinHandle, Board_LED1, 1);

       System_printf("Starting the example\nSystem provider is set to SysMin. "

                     "Halt the target to view any SysMin contents in ROV.\n");

       /* SysMin will only print to the console when you call flush or exit */

       System_flush();

       /* Start BIOS */

       BIOS_start();

       return (0);

    }

  • I'd try the UART echo example in TI-RTOS. The TI-RTOS UART driver already sets the power dependency as needed.

    Tom
  • Dear Tom:
    I just want to verify CC26xx SimpleLink Wireless MCUs User’s Guide Chapter 3 , Example : UART Driver