每30秒更换一次AGC值。并一直在扫描c1:00:00:00:00:c2 ,看扫到的次数,及返回的RSSI值。 汇总1下: 1-DAIF_DCOC_RX_GIDX 值越小,增益越大。 PHY 得到的信号就越强。 当天线端信号较强时,+AGC后 PHY的信号,可能削顶。 2-当发生削顶时,推算RSSI减的Delta值是不变。 因此出现 AGC越大,RSSI反而越小的情况。 3- RSSI 是指天线侧的信号。根据PHY的信号通过一定算法补偿后得出。 不同AGC档位补偿值不一样。 手动设置AGC测试Log总结: (6621CxC) 1-未发生过强信号溢出情况下,且同一个AGC设置条件下,RSSI基本一致。 2-当发生强信号且AGC大,导致后面溢出时, RSSI推算不准确。会出现AGC越小,算出来的RSSI越大。 co_timer_t sim_timer; uint8_t agc = 0; uint8_t scan_on = 0; void sim_timer_handler(co_timer_t *timer, void *param) { agc += 2; if (agc > 8) { agc = 0; } log_debug("\nAGC Set to %d", agc); CPM_ANA_AHB_CLK_ENABLE(); REGW(&HS_DAIF->DCOC_CFG, MASK_1REG(DAIF_DCOC_RX_GIDX, agc)); //0-最大增益挡位 //REGW(&HS_DAIF->DCOC_CFG, MASK_1REG(DAIF_DCOC_RX_GIDX, 8)); //8-最小增益挡位 REGW(&HS_DAIF->DCOC_CFG, MASK_1REG(DAIF_DCOC_FILT_GIDX, 2)); REGW(&HS_DAIF->DCOC_CFG, MASK_1REG(DAIF_DCOC_CALI, 1)); CPM_ANA_CLK_RESTORE(); if (scan_on == 0) { scan_on = 1; log_debug("\nscan start"); app_central_scan_start(); } } running AGC Set to 2 scan startapp_central_scan_start@507 state=0, todo=0 app_central_create_scan@230 gapm_activity_created_ind_handler@102, type=1, index=0 app_central_update_state=1, index=0, reason=0 scan state=1, todo=0,reason=0 app_central_update_state=a1, index=0, reason=0 scan state=2, todo=0,reason=0 app_central_start_scan@271 app_central_update_state=a4, index=0, reason=0 scan state=3, todo=0,reason=0 ...... 情形1_(模拟信号弱):扫描端有天线, 从端相距1m,从端无安装天线 AGC Set to 0............. [agc=0].[-71]report addr c1:00:00:00:00:c2... [agc=0].[-72]report addr c1:00:00:00:00:c2.................. [agc=0].[-71]report addr c1:00:00:00:00:c2.... [agc=0].[-74]report addr c1:00:00:00:00:c2.......................... [agc=0].[-71]report addr c1:00:00:00:00:c2..... [agc=0].[-74]report addr c1:00:00:00:00:c2............ [agc=0].[-71]report addr c1:00:00:00:00:c2... [agc=0].[-71]report addr c1:00:00:00:00:c2.... [agc=0].[-74]report addr c1:00:00:00:00:c2............ [agc=0].[-70]report addr c1:00:00:00:00:c2....... [agc=0].[-74]report addr c1:00:00:00:00:c2....... [agc=0].[-71]report addr c1:00:00:00:00:c2.. [agc=0].[-71]report addr c1:00:00:00:00:c2.... [agc=0].[-71]report addr c1:00:00:00:00:c2... [agc=0].[-71]report addr c1:00:00:00:00:c2............... AGC Set to 2...... [agc=2].[-69]report addr c1:00:00:00:00:c2..... [agc=2].[-68]report addr c1:00:00:00:00:c2.................. [agc=2].[-72]report addr c1:00:00:00:00:c2....... [agc=2].[-68]report addr c1:00:00:00:00:c2............ [agc=2].[-68]report addr c1:00:00:00:00:c2.... [agc=2].[-69]report addr c1:00:00:00:00:c2..... [agc=2].[-69]report addr c1:00:00:00:00:c2.... [agc=2].[-69]report addr c1:00:00:00:00:c2................... [agc=2].[-69]report addr c1:00:00:00:00:c2... [agc=2].[-69]report addr c1:00:00:00:00:c2...... [agc=2].[-68]report addr c1:00:00:00:00:c2........ [agc=2].[-71]report addr c1:00:00:00:00:c2......... [agc=2].[-69]report addr c1:00:00:00:00:c2...... [agc=2].[-72]report addr c1:00:00:00:00:c2............. [agc=2].[-69]report addr c1:00:00:00:00:c2... [agc=2].[-69]report addr c1:00:00:00:00:c2 AGC Set to 4..... [agc=4].[-75]report addr c1:00:00:00:00:c2...... [agc=4].[-74]report addr c1:00:00:00:00:c2.. [agc=4].[-70]report addr c1:00:00:00:00:c2............ [agc=4].[-70]report addr c1:00:00:00:00:c2. [agc=4].[-70]report addr c1:00:00:00:00:c2...... [agc=4].[-72]report addr c1:00:00:00:00:c2.. [agc=4].[-73]report addr c1:00:00:00:00:c2.. [agc=4].[-76]report addr c1:00:00:00:00:c2..... [agc=4].[-74]report addr c1:00:00:00:00:c2...... [agc=4].[-71]report addr c1:00:00:00:00:c2.... [agc=4].[-74]report addr c1:00:00:00:00:c2.......... AGC Set to 6.................... AGC Set to 8... AGC Set to 0 [agc=0].[-72]report addr c1:00:00:00:00:c2............. [agc=0].[-72]report addr c1:00:00:00:00:c2..... [agc=0].[-74]report addr c1:00:00:00:00:c2...... [agc=0].[-72]report addr c1:00:00:00:00:c2..... [agc=0].[-72]report addr c1:00:00:00:00:c2.......... [agc=0].[-74]report addr c1:00:00:00:00:c2... [agc=0].[-71]report addr c1:00:00:00:00:c2..... [agc=0].[-71]report addr c1:00:00:00:00:c2............. [agc=0].[-74]report addr c1:00:00:00:00:c2.................. [agc=0].[-71]report addr c1:00:00:00:00:c2........................... [agc=0].[-75]report addr c1:00:00:00:00:c2............. [agc=0].[-74]report addr c1:00:00:00:00:c2.... AGC Set to 2 [agc=2].[-72]report addr c1:00:00:00:00:c2......... [agc=2].[-71]report addr c1:00:00:00:00:c2............ [agc=2].[-69]report addr c1:00:00:00:00:c2............ [agc=2].[-72]report addr c1:00:00:00:00:c2........... [agc=2].[-69]report addr c1:00:00:00:00:c2...... [agc=2].[-69]report addr c1:00:00:00:00:c2....... [agc=2].[-69]report addr c1:00:00:00:00:c2...... [agc=2].[-69]report addr c1:00:00:00:00:c2...... [agc=2].[-69]report addr c1:00:00:00:00:c2................... [agc=2].[-68]report addr c1:00:00:00:00:c2....... [agc=2].[-72]report addr c1:00:00:00:00:c2.............................................. [agc=2].[-72]report addr c1:00:00:00:00:c2. [agc=2].[-69]report addr c1:00:00:00:00:c2......... [agc=2].[-69]report addr c1:00:00:00:00:c2..... [agc=2].[-69]report addr c1:00:00:00:00:c2.......... [agc=2].[-69]report addr c1:00:00:00:00:c2. AGC Set to 4... [agc=4].[-73]report addr c1:00:00:00:00:c2......... [agc=4].[-70]report addr c1:00:00:00:00:c2... [agc=4].[-72]report addr c1:00:00:00:00:c2..... [agc=4].[-74]report addr c1:00:00:00:00:c2.... [agc=4].[-70]report addr c1:00:00:00:00:c2 [agc=4].[-74]report addr c1:00:00:00:00:c2......... [agc=4].[-69]report addr c1:00:00:00:00:c2........ [agc=4].[-71]report addr c1:00:00:00:00:c2................. [agc=4].[-73]report addr c1:00:00:00:00:c2...... [agc=4].[-70]report addr c1:00:00:00:00:c2...... [agc=4].[-73]report addr c1:00:00:00:00:c2.... [agc=4].[-72]report addr c1:00:00:00:00:c2 AGC Set to 6...................... AGC Set to 8... AGC Set to 0...... [agc=0].[-74]report addr c1:00:00:00:00:c2.. [agc=0].[-71]report addr c1:00:00:00:00:c2......... [agc=0].[-74]report addr c1:00:00:00:00:c2............. [agc=0].[-71]report addr c1:00:00:00:00:c2...... [agc=0].[-75]report addr c1:00:00:00:00:c2........... [agc=0].[-71]report addr c1:00:00:00:00:c2.......... [agc=0].[-72]report addr c1:00:00:00:00:c2............. [agc=0].[-71]report addr c1:00:00:00:00:c2..... [agc=0].[-74]report addr c1:00:00:00:00:c2......... [agc=0].[-72]report addr c1:00:00:00:00:c2............ [agc=0].[-73]report addr c1:00:00:00:00:c2. [agc=0].[-72]report addr c1:00:00:00:00:c2............. [agc=0].[-71]report addr c1:00:00:00:00:c2...... [agc=0].[-72]report addr c1:00:00:00:00:c2................ [agc=0].[-72]report addr c1:00:00:00:00:c2.. [agc=0].[-72]report addr c1:00:00:00:00:c2............. AGC Set to 2........ [agc=2].[-72]report addr c1:00:00:00:00:c2.... [agc=2].[-72]report addr c1:00:00:00:00:c2..... [agc=2].[-70]report addr c1:00:00:00:00:c2.... [agc=2].[-69]report addr c1:00:00:00:00:c2...... [agc=2].[-73]report addr c1:00:00:00:00:c2.... [agc=2].[-69]report addr c1:00:00:00:00:c2............ [agc=2].[-73]report addr c1:00:00:00:00:c2.. [agc=2].[-69]report addr c1:00:00:00:00:c2............. [agc=2].[-72]report addr c1:00:00:00:00:c2....... [agc=2].[-72]report addr c1:00:00:00:00:c2... [agc=2].[-69]report addr c1:00:00:0 |