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.

[参考译文] CC2650:如何使用 RTC

Guru**** 2540720 points
Other Parts Discussed in Thread: CC2650

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1110426/cc2650-how-to-use-rtc

器件型号:CC2650
Thread 中讨论的其他器件: SYSBIOS

如何在 cc2650 Launchpad 中使用 RTC。  我希望 在每 5分钟后仅使用 RTC 打开和关闭 LED。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ashwini、

    请参阅 有关 AON_RTC Driverlib 的文档 和此 相关的 E2E 主题

    此致、
    Ryan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢 Ryan 的回复、现在我 正在访问此链接(https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/859344/cc2650-by-using-always-on-domain-how-to-print-current-date-and-time)

    #include
    #include
    #include
    #include
    #include
    #include
    char func;
    char func1;
    uint32_t func2;
    uint32_t func4;
    uint32_t 秒;
    uint32_t 电池;
    time_t t1;
    uint32_t;
    struct tm *ltm;
    char *curTime;
    辅助字符1;
    字符 str;
    uint8_t str1;
    uint8_t str2;
    int main()

    /*启动内核。 *
    AONRTCEnable();
    func=AONRTCActive();
    AONRTCEventClear (AON_RTC_CH1);
    AONRTCCompareValueSet (AON_RTC_CH1、0x5dddcc54);
    AONRTCChannelEnable (AON_RTC_CH1);
    AONRTCChannelEnable (AON_RTC_CH0);
    func1=AONRTCChannelActive (AON_RTC_CH1);
    AONRTCCombinedEventConfig (AON_RTC_CH0 | AON_RTC_CH1);
    func4= AONRTCCompareValueGet (AON_RTC_CH1);

    秒= AONRTCSecGet ();
    system_printf ("seconds=%s %d\r\n"、秒、秒);
    system_flush();

    seconds_set (func4);

    t =seconds_getTime (func4);

    T1 =时间(t);LTM = localtime (&T1);
    curTime =上升时间(LTM);

    System_printf ("time (GMT):%s\n"、curTime);
    system_flush();

    BIOS_start();
    返回0;

    我得到结果、但这不是当前时间和日期。

    seconds=(null) 0

    时间(GMT):星期三2019年11月27日01:07:32
     当我调用此函数时、我得到零或0输出。

    请更正我出错的地方。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    CC2650上没有时钟、包括 RTC、可在 断电期间保留其值。  因此、您在没有引用的情况下获得的时间戳不能合理地是当前日期。  这很可能是出厂编程设置(即 UNIX 时间不能早于设备创建时间)。  您将需要手动设置电流值、将时间信息存储在非易失性闪存中、保持器件开启、包括备用电池、并考虑器件断电的时间。

    https://e2e.ti.com/f/1/t/484591 
    https://e2e.ti.com/f/1/t/697119 

    此致、
    Ryan