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.

关于Z-Stack POWER_SAVING下的串口接收问题

Other Parts Discussed in Thread: Z-STACK, CC2530

使用的是CC2530。Z-Stack 2.5.1a

以前我问过这个问题

http://www.deyisupport.com/question_answer/wireless_connectivity/zigbee/f/104/t/51283.aspx#115133

后来我试验了这个想法。

我使用的是串口0,波特率为19200

在初始化中加入了中断 

P0DIR &= ~(1<<2); //P0.2 input
P0INP &= ~(1<<2); //P0.2 pull up
P0IEN |= (1<<2); //P0_2中断使能

P0IE = 1; //端口1中断使能
P0IFG = 0; //初始化中断标志位

数据依旧接收有些问题。

可能接收不到。也可能接收到,但接收的数据不完全正确。

求教方法

十分感谢

  • 我又在TI的论坛上找了找

    找到一个方法

    1. Compile your end device with "POWER_SAVING" option.
    2. Force your ED to stay "awake" while transmitting or receiving of serial data
      by calling osal_pwrmgr_task_state(My_App_TaskID, PWRMGR_HOLD);
    3. When RX/TX ends, allow to your ED to enter sleep mode again by calling
      osal_pwrmgr_task_state(My_App_TaskID, PWRMGR_CONSERVE);

    我使用了该API。能正确接收数据,省电性正在测试。

    如果有人用过,请告知是否真的能符合要求。

    十分感谢

    --------------------------------

    经过初步的测试。应该是可行的。希望能帮上其他朋友

  • 你好,我按你的方法去做的,果然串口能手到数据了,而且功耗好像有略微的增加,但是不知道为什么收到的字节不对,后来我又看 了一个帖子说在退出睡眠的时候使用

    osal_pwrmgr_device( PWRMGR_ALWAYS_ON );这样的话字节就是对的但是不是低功耗了,请问有没有两全其美的方法啊??