打印

CC1310 standby模式功耗问题

[复制链接]
2474|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
fuyuqingfeng|  楼主 | 2017-6-8 21:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 fuyuqingfeng 于 2017-6-13 16:56 编辑

1、请教下 CC1310基于TI_RTOS 如何配置进入standby模式,不是task_sleep()  是系统进入睡眠,以实现超低功耗。资料说TI_RTOS会自动管理电源进入低功耗模式,条件是在所有任务挂起的情况下。这样就不能自主的控制功耗,请问有什么方法能实现在想要进入standby时再进入?
2、使用pinstandby例程时,测试的standby模式下电流为几个uA,手册上说的是0.7uA,怎么配置才能达到手册上的参考值?

相关帖子

沙发
dirtwillfly| | 2017-6-8 22:47 | 只看该作者
把所有任务挂起就ok了。不然即使你强制进入低功耗状态,也会被任务唤醒的

使用特权

评论回复
板凳
fuyuqingfeng|  楼主 | 2017-6-8 23:08 | 只看该作者
dirtwillfly 发表于 2017-6-8 22:47
把所有任务挂起就ok了。不然即使你强制进入低功耗状态,也会被任务唤醒的 ...

有没有例程代码看下呢?我刚接触这个芯片和TI的rtos  很多都不太懂

使用特权

评论回复
地板
fuyuqingfeng|  楼主 | 2017-6-8 23:12 | 只看该作者
fuyuqingfeng 发表于 2017-6-8 23:08
有没有例程代码看下呢?我刚接触这个芯片和TI的rtos  很多都不太懂

这是官方例程pinstandby,它只是在线程里调用sleep()

int main(void)
{
    pthread_t           thread;
    pthread_attr_t      pAttrs;
    struct sched_param  priParam;
    int                 retc;
    int                 detachState;

    /* Call driver init functions */
    Board_initGeneral();

    /* Set priority and stack size attributes */
    pthread_attr_init(&pAttrs);
    priParam.sched_priority = 1;

    detachState = PTHREAD_CREATE_DETACHED;
    retc = pthread_attr_setdetachstate(&pAttrs, detachState);
    if (retc != 0) {
        /* pthread_attr_setdetachstate() failed */
        while (1);
    }

    pthread_attr_setschedparam(&pAttrs, &priParam);

    retc |= pthread_attr_setstacksize(&pAttrs, THREADSTACKSIZE);
    if (retc != 0) {
        /* pthread_attr_setstacksize() failed */
        while (1);
    }

    retc = pthread_create(&thread, &pAttrs, mainThread, NULL);
    if (retc != 0) {
        /* pthread_create() failed */
        while (1);
    }

    BIOS_start();

    return (0);
}

void *threadFxn0(void *arg0)
{
    PIN_State   pinState;
    PIN_Handle  hPin;
    uint_t      currentOutputVal;
    uint32_t    standbyDuration = 5;

    /* Allocate LED pins */
    hPin = PIN_open(&pinState, LedPinTable);

    /* Loop forever */
    while(1) {
        /* Sleep, to let the power policy transition the device to standby */
        sleep(standbyDuration);

        /* Read current output value for all pins */
        currentOutputVal =  PIN_getPortOutputValue(hPin);

        /* Toggle the LEDs, configuring all LEDs at once */
        PIN_setPortOutputValue(hPin, ~currentOutputVal);
    }
}

/*
*  ======== mainThread ========
*/
void *mainThread(void *arg0)
{
    pthread_t           thread0;
    pthread_attr_t      pAttrs;
    struct sched_param  priParam;
    int                 retc;
    int                 detachState;

    /* Shut down external flash on LaunchPads. It is powered on by default
     * but can be shut down through SPI
     */
#if defined(CC2650_LAUNCHXL) || defined(CC2640R2_LAUNCHXL) || defined(CC1310_LAUNCHXL) || defined(CC1350_LAUNCHXL)
    SPI_init();
    bool extFlashOpened = ExtFlash_open();
    if (extFlashOpened) {
        ExtFlash_close();
    }
#endif

    /* Create application thread */
    pthread_attr_init(&pAttrs);

    detachState = PTHREAD_CREATE_DETACHED;
    /* Set priority and stack size attributes */
    retc = pthread_attr_setdetachstate(&pAttrs, detachState);
    if (retc != 0) {
        /* pthread_attr_setdetachstate() failed */
        while (1);
    }

    retc |= pthread_attr_setstacksize(&pAttrs, THREADSTACKSIZE);
    if (retc != 0) {
        /* pthread_attr_setstacksize() failed */
        while (1);
    }

    /* Create threadFxn0 thread */
    priParam.sched_priority = 1;
    pthread_attr_setschedparam(&pAttrs, &priParam);

    retc = pthread_create(&thread0, &pAttrs, threadFxn0, NULL);
    if (retc != 0) {
        /* pthread_create() failed */
        while (1);
    }

    return (NULL);
}


使用特权

评论回复
5
dirtwillfly| | 2017-6-9 08:11 | 只看该作者
建议多看看官网提供的文档http://www.ti.com.cn/cn/lit/ug/spruhd4m/spruhd4m.pdf

使用特权

评论回复
6
vivilzb1985| | 2017-6-9 21:08 | 只看该作者
这个是可以直接的调用相关的操作模块的

使用特权

评论回复
7
fuyuqingfeng|  楼主 | 2017-6-9 21:46 | 只看该作者
dirtwillfly 发表于 2017-6-9 08:11
建议多看看官网提供的文档http://www.ti.com.cn/cn/lit/ug/spruhd4m/spruhd4m.pdf

官网文档看了一些 还是没搞明白

使用特权

评论回复
8
fuyuqingfeng|  楼主 | 2017-6-9 21:46 | 只看该作者
vivilzb1985 发表于 2017-6-9 21:08
这个是可以直接的调用相关的操作模块的

能指点一下吗?

使用特权

评论回复
9
i1mcu| | 2017-6-11 21:52 | 只看该作者
执行函数里面调用Task_sleep()

使用特权

评论回复
10
i1mcu| | 2017-6-11 21:58 | 只看该作者
只要没有关闭standby模式,TI-RTOS会自动进入standby模式

使用特权

评论回复
11
fuyuqingfeng|  楼主 | 2017-6-11 22:11 | 只看该作者
i1mcu 发表于 2017-6-11 21:52
执行函数里面调用Task_sleep()

我是想测试CC1310在睡眠模式下的电流,手册上说的是0.7uA,我怎么都测不出来这个数据,测试的电流总是在几个uA左右 不知道什么原因。(就是调用这个函数测试的)

使用特权

评论回复
12
fuyuqingfeng|  楼主 | 2017-6-11 22:12 | 只看该作者
i1mcu 发表于 2017-6-11 21:58
只要没有关闭standby模式,TI-RTOS会自动进入standby模式

是的,可是我在睡眠模式下测得的电流是几个uA,大于手册里说的0.7uA  这是为什么呢?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

7

主题

65

帖子

1

粉丝