大家好、我希望有人能帮助我指出我所面临的问题的正确方向。
在我的应用中、我有一个 TXS 1106字节使用无限 TX 模式的 TX、该 TX 实际上由多个小数据包组成(如智能前导码示例)。
我还有一个电池供电 的 Rx'er、它使用 EWOR 监听模式来检测此传输。 这一切正常。。。 我可以正确地进行 TX 和 RX。
我的问题是、在测试过程中、我激活了一个静态载波(在另一台设备上)、并注意到载波处于激活状态时、RX'er 保持在 RX 模式。
这是不可接受的、因为电池很快就会耗尽。
在 EWOR 监听模式下、如果在有限的一段时间后未检测到同步、是否有任何方法可以自动关闭 Rx'er?
这是我的 EWOR 监听模式配置函数
@brief
@param[in]
@return
*/
void rf_radio_ewor_enable(void)
{
uint8_t reg;
rf_radio_idle();
// PKT_CRC_OK (Inverted), Asserted when good packet Rx'd (passed CRC check), deasserted on entry to RX
rf_spi_write_reg(CC112X_IOCFG0, 0x53);
// Set Sync word Byte 1 & 0
// Sync Word Detection Configuration Reg1, 16 bits [SYNC15_8: SYNC7_0], SYNC_NUM_ERROR = 11b [Bit error qualifier disabled. No check on bit errors]
rf_spi_write_reg(CC112X_SYNC1, 0xB3);
rf_spi_write_reg(CC112X_SYNC0, 0x0D);
rf_spi_write_reg(CC112X_SYNC_CFG0, 0x0B);
// Carrier Sense Threshold Configuration, Threshold = -100DBM
// Automatic Gain Control Configuration Reg3, RSSI threshold is 3 dB
// Automatic Gain Control Configuration Reg1, 8 sample AGC integration window, Wait time between AGC gain adjustments = 24 samples
rf_spi_write_reg(CC112X_AGC_CS_THR, 0x02);
rf_spi_write_reg(CC112X_AGC_CFG3, 0x11);
rf_spi_write_reg(CC112X_AGC_CFG1, 0xA0);
// eWOR Configuration Reg0, Event 2 timeout disabled, RCOSC calibration disabled, RCOSC is running
// eWOR Event 0 Configuration MSB. event 0 timeout, Tevent0 = 441.7582418 mSecs (assumes only 1106bits TX'd for margin)
// eWOR Event 0 Configuration LSB. event 0 timeout, Tevent0 = 441.7582418 mSecs (assumes only 1106bits TX'd for margin)
rf_spi_write_reg(CC112X_WOR_CFG0, 0x20);
rf_spi_write_reg(CC112X_WOR_EVENT0_MSB, 0x37);
rf_spi_write_reg(CC112X_WOR_EVENT0_LSB, 0x38);
// RFEND Configuration Reg1, Continue RX mode on RX timeout if sync word is found
// RFEND Configuration Reg0, Terminate on bad packet enabled, RX termination based on CS is enabled
rf_spi_write_reg(CC112X_RFEND_CFG1, 0x0E);
rf_spi_write_reg(CC112X_RFEND_CFG0, 0x09);
// Packet Length Configuration, max length = 125
rf_spi_write_reg(CC112X_PKT_LEN, 0x7D);
// Crystal Oscillator Configuration2, The XOSC will be turned off if the SXOFF, SPWD, or SWOR command strobes are issued
rf_spi_write_reg(CC112X_XOSC2, 0x00);
// calibrate internal 32khz OSC
// enable RC calibration
reg = rf_spi_read_reg(CC112X_WOR_CFG0);
// Enable ROSC calibration
reg &= ~RF_RCOSC_CALIBRATE_MASK;
reg |= RF_RCOSC_CALIBRATE_ENABLED;
rf_spi_write_reg(CC112X_WOR_CFG0, reg);
// must strobe idle to calibrate
rf_radio_strobe_idle_and_wait();
// disable RC calibration,
// NB must issue the SWOR as next strobe command after disabling calibration
reg &= ~RF_RCOSC_CALIBRATE_MASK;
rf_spi_write_reg(CC112X_WOR_CFG0, reg);
// Enable RX Sniff Mode
rf_spi_command_strobe(SWOR);
// enable GDO0 interrupt
hal_radio_irq_clear();
hal_radio_irq_enable();
g_radio.ewor_enabled = true;
g_radio.event_mask = false;
}
此致
Trevor