- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
CC2530是否有专门的脱离PC机测试信号的程序?
用Studio测试时可以的,你可以把线引出来。
如果你需要直接跑代码测试,参考下面的代码,在ZNP的工程里面可以找到。
void znpTestRF(void)
{
uint8 rfTestParms[4] = { 0, 0, 0, 0 };
if ((SUCCESS != osal_nv_item_init(ZNP_NV_RF_TEST_PARMS, 4, rfTestParms)) ||
(SUCCESS != osal_nv_read(ZNP_NV_RF_TEST_PARMS, 0, 4, rfTestParms)) ||
(rfTestParms[0] == 0))
{
return;
}
// Settings from SmartRF Studio
MDMCTRL0 = 0x85;
RXCTRL = 0x3F;
FSCTRL = 0x5A;
FSCAL1 = 0x2B;
AGCCTRL1 = 0x11;
ADCTEST0 = 0x10;
ADCTEST1 = 0x0E;
ADCTEST2 = 0x03;
FRMCTRL0 = 0x43;
FRMCTRL1 = 0x00;
MAC_RADIO_RXTX_OFF();
MAC_RADIO_SET_CHANNEL(rfTestParms[1]);
MAC_RADIO_SET_TX_POWER(rfTestParms[2]);
TX_PWR_TONE_SET(rfTestParms[3]);
switch (rfTestParms[0])
{
case 1: // Rx promiscuous mode.
MAC_RADIO_RX_ON();
break;
case 2: // Un-modulated Tx.
TX_PWR_MOD__SET(1);
// no break;
case 3: // Modulated Tx.
// Modulated is default register setting, so no special action.
// Now turn on Tx power for either mod or un-modulated Tx test.
MAC_RADIO_TX_ON();
break;
default: // Not expected.
break;
}
// Clear the RF test mode.
(void)osal_memset(rfTestParms, 0, 4);
(void)osal_nv_write(ZNP_NV_RF_TEST_PARMS, 0, 4, rfTestParms);
while (1); // Spin in RF test mode until a hard reset.
}
上一篇:CC2540 开了低功耗识别不了电路板的USB,怎么解决?
下一篇:协调器上电时在哪里判断网络中存在相同设置的网络