请问cc2540的功耗如何确定?如果用外接电源(如锂电池等)供电,应选择多大容量的电源同时时间可以用得比较长久?
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.
建议参考帖子 http://www.deyisupport.com/question_answer/wireless_connectivity/bluetooth/f/103/t/59904.aspx
及官方文档 http://www.ti.com.cn/cn/lit/an/swra347a/swra347a.pdf
我这个基本没有什么外设,就是利用cc2540作为从机发送数据,还有,我想问问,先看下方从机处理程序中任务处理事件函数的其中一部分
if ( events & SBP_PERIODIC_EVT )
{
// Restart timer
if ( SBP_PERIODIC_EVT_PERIOD )
{
osal_start_timerEx( simpleBLEPeripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD );
}
if(P0_0==0)
{
Sendchartask();
}
else
{
if(P0_0==1||flag2==1)
{
flag2=1;
Sendchartask();
if(n>=3)
{
while(n++<=4000&&flag3==0)
{
if(P0_0==0)
{performPeriodicTask('b');SerialPrintString("b");SerialPrintString(" "); flag3=1;}
}
if(flag3==0){ performPeriodicTask('a');SerialPrintString("a"); SerialPrintString(" ");}
n=0;flag1=0;flag2=0;flag3=0;
}
}
else if(P0_0==0&&flag2!=1)
{
Sendchartask();
if(n>5)
{
performPeriodicTask('d');SerialPrintString("d"); SerialPrintString(" ");
m=0;n=0;flag1=0;flag2=0;
}
}
}
else {/*performPeriodicTask('c');*/SerialPrintString("c");SerialPrintString(" ");if(P0_0!=0){flag=0;}}
return (events ^ SBP_PERIODIC_EVT);
}
红色字体部分,我是每隔一段时间(这里设置成0.02秒)进入一次SBP_PERIODIC_EVT,查询是否需要发送字符数据,我想知道,这样重复查询,如果不需要发送数据,从机还会是处于低功耗状态来查询吗?如果查询到需要发送字符数据,从机会被激活,发送数据完后会重新进入低功耗状态吗?我说加入延时会断开,就是在上述函数内加一个delay()函数,就会断开!
Yan
// Minimum connection interval (units of 1.25ms, 80=100ms) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 800
// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 800
// Slave latency to use if automatic parameter update request is enabled
#define DEFAULT_DESIRED_SLAVE_LATENCY 50
// Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter update request is enabled
#define DEFAULT_DESIRED_CONN_TIMEOUT 1000
我把这些参数设置成上述情况,按道理来说超过了DEFAULT_DESIRED_CONN_TIMEOUT的时间连接应该会丢失,为什么我的不会断开连接?