TI工程师:
我使用simpleBLEMulti修改的多角色从机连接,未连接的时候,待机功耗1.7uA,但是连接后,功耗0.2mA。
我看文档,连接后不会一直0.2mA的功耗,但我不知道该去修改哪些参数,可以降低连接之后的功耗。
请问连接后,需要修改哪些参数?连接后,开启定时器会影响休眠机制吗?
Barbara Wu:
请问您当前的连接参数是怎么设置的?如果连接间隔很短,为了维持连接,会频繁的通讯,功耗就会增加。0.2mA是怎么测出来的?平均功耗吗?
ye yang5:
回复 Barbara Wu:
WBJ:
0.2mA是使用万用表测的,发现电流在200uA上下跳动,没有进入睡眠。
我从机的设置参数如下:
// Advertising interval when device is discoverable (units of 625us, 160=100ms) #define DEFAULT_ADVERTISING_INTERVAL 1600
// Limited discoverable mode advertises for 30.72s, and then stops// General discoverable mode advertises indefinitely #define DEFAULT_DISCOVERABLE_MODE GAP_ADTYPE_FLAGS_GENERAL
// 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
// Whether to enable automatic parameter update request when a connection is// formed #define DEFAULT_ENABLE_UPDATE_REQUEST FALSE//TRUE
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL; GAP_SetParamValue(TGAP_CONN_PAUSE_PERIPHERAL, DEFAULT_CONN_PAUSE_PERIPHERAL); GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt); GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt); GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt); GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt);
/*——–PERIPHERAL————-*/ // For all hardware platforms, device starts advertising upon initialization uint8_t initialAdvertEnable = TRUE; // By setting this to zero, the device will go into the waiting state after // being discoverable for 30.72 second, and will not being advertising again // until the enabler is set back to TRUE uint16_t advertOffTime = 0; uint8_t enableUpdateRequest = DEFAULT_ENABLE_UPDATE_REQUEST; uint16_t desiredMinInterval = DEFAULT_DESIRED_MIN_CONN_INTERVAL; uint16_t desiredMaxInterval = DEFAULT_DESIRED_MAX_CONN_INTERVAL; uint16_t desiredSlaveLatency = DEFAULT_DESIRED_SLAVE_LATENCY; uint16_t desiredConnTimeout = DEFAULT_DESIRED_CONN_TIMEOUT; GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &initialAdvertEnable, NULL); GAPRole_SetParameter(GAPROLE_ADVERT_OFF_TIME, sizeof(uint16_t), &advertOffTime, NULL); GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof(scanRspData), scanRspData, NULL); GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData, NULL); GAPRole_SetParameter(GAPROLE_PARAM_UPDATE_ENABLE, sizeof(uint8_t), &enableUpdateRequest, NULL); GAPRole_SetParameter(GAPROLE_MIN_CONN_INTERVAL, sizeof(uint16_t), &desiredMinInterval, NULL); GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desiredMaxInterval, NULL); GAPRole_SetParameter(GAPROLE_SLAVE_LATENCY, sizeof(uint16_t), &desiredSlaveLatency, NULL); GAPRole_SetParameter(GAPROLE_TIMEOUT_MULTIPLIER, sizeof(uint16_t), &desiredConnTimeout, NULL);
Albin Zhang:
回复 ye yang5:
万用表测的就是平均。。。。 其实电流是变的。 你可以示波器+采样电阻看看。
如果参数合适的话,200uA也不意外。
你可以用这个文档估算一下。swra478
BR. AZ