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.

[参考译文] CC1201:执行 CCA

Guru**** 2478765 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1345910/cc1201-performing-cca

器件型号:CC1201

在初始化无线电时、我将 CCA_MODE 设置为011、这"表示当 RSSI 低于阈值并且当前未接收到数据包时清除通道"。

然后我使用以下代码:

  1. 将无线电切换到 RX
  2. 确认无线电处于 RX 状态
  3. 将无线电切换到 TX
  4. 检查 CCA_STATUS 是否生效

    for (i = 0; i < MRFI_CCA_RETRIES; i++) {
      /* Radio must be in RX mode for CCA to happen.
       * Otherwise it will transmit without CCA happening.
       */

      /* Can not use the Mrfi_RxModeOn() function here since it turns on the
       * Rx interrupt, which we don't want in this case.
       */
      mrfiSpiCmdStrobe( SRX );

      uint8_t marc_state = 0;
      do {
        marc_state = mrfiSpiReadExtendedReg(CC120X_MARCSTATE);
      } while (marc_state != 0x6D);

      // /* wait for the rssi to be valid. */
      // MRFI_RSSI_VALID_WAIT();

      /* send strobe to initiate transmit */
      mrfiSpiCmdStrobe( STX );

      if (MRFI_CCA_STATUS_PIN_IS_HIGH()) {
        /* ------------------------------------------------------------------
        *    Clear Channel Assessment passed.
        *   ----------------------------------
        */

        /* Wait for transmit to complete */
        while(!MRFI_SYNC_PIN_INT_FLAG_IS_SET());

        ESP_LOGI(TAG, "Transmit done");

        /* Clear the interrupt flag */
        MRFI_CLEAR_SYNC_PIN_INT_FLAG();
        cca_passed = true;
        break;
      }

      /* ------------------------------------------------------------------
       *    Clear Channel Assessment failed.
       *   ----------------------------------
       */

      /* Turn off radio and save some power during backoff */

      /* NOTE: Can't use Mrfi_RxModeOff() - since it tries to update the
       * sync signal status which we are not using during the TX operation.
       */
      MRFI_STROBE_IDLE_AND_WAIT();

      /* flush the receive FIFO of any residual data */
      mrfiSpiCmdStrobe( SFRX );

      /* otherwise, backoff and perform CCA again */
      Mrfi_RandomBackoffDelay();

      ESP_LOGI(TAG, "CCA failed, retrying");
    }

不过、使用逻辑分析仪、我可以看到 TX 的选通命令、但 CCA_STATUS 始终为低电平。 我是否需要等到收到 TXONCCA_DONE 事件后才能检查 CCA_STATUS?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    说实话、我不确定  CCA_STATUS 是最有用的信号以及您想要使用的信号。

    相反,我建议采用以下方法:

    发出 SRX 选通

    等待 CARRER_SENSE_VALID 置位。 这将指示已进入 RX 模式并且无线电已处于此模式的时间足够长、可以确定信道中的信号强度

    发出 STX 选通

    等待 TXONCCA_DONE 上的中断

    读取  MARC_STATUS0寄存器以确定 TX 是否失败(TXONCCA_FAILED)

    如果失败(TXONCCA_FAILED = 1)、则尝试再次进入 TX (如果需要)

    如果未发送(TXONCCA_FAILED = 0)、则等待数据包发送。

    Br

    Siri