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.

[参考译文] 如何使用 PA 和 LNA 配置 CC2530

Guru**** 1490375 points
Other Parts Discussed in Thread: CC2530, CC2590, Z-STACK
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/995529/how-do-i-configure-the-cc2530-with-pa-and-lna

主题中讨论的其他器件:CC2530CC2590Z-stackCC2591CC2592CSD

大家好、

我´mn´t 配置 Ebyte 模块 E18-MS1PA2 CC2530 (其中包含 PA 和 LNA)、但我没有成功正确设置它。 根据亿字节数据表、需要更改这些文件  hal_board_cfg.h、 mac_radio_defs.c 和 mac_PIB.c  即使在设置之后,也没有什么事情发生!

注意:我会选择使用 HAL_PA_LNA  或  HAL_PA_LNA_CC2590、每次一个、在 IAR 编译器选项上、但我在 mac_PIB.c 上看到了 erros 我n´t 知道是否有必要这样做!

我现在使用的是 Z-Stack Home 1.2.2a.44539。

我对文件执行了 te2e.ti.com/.../E18_2D00_MS1PA2_2D00_PCB_5F00_UserManual_5F00_EN_5F00_v1.0.pdfhose 配置:

在 HAL_board_cfg.c 上-全局变量。

/* ------------------------------------------------------------------------------------------------
 *                                       CC2590/CC2591 support
 *
 *                        Define HAL_PA_LNA_CC2590 if CC2530+CC2590EM is used
 *                        Define HAL_PA_LNA if CC2530+CC2591EM is used
 *                        Note that only one of them can be defined
 * ------------------------------------------------------------------------------------------------
 */
#define HAL_PA_LNA
#define xHAL_PA_LNA_CC2590

在 mac_radio_defs.c 上- InSite macRadioTurnOnPower (void)函数

,我在函数末尾设置了 P1.1和 P1.0设置(从第46行到第52行)。

注意:这些引脚上的 CC2530上没有物理连接任何东西。

MAC_INTERNAL_API void macRadioTurnOnPower(void)
{
  /* Enable RF error trap */
  MAC_MCU_RFERR_ENABLE_INTERRUPT();

#if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || \
    defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592
  /* table ID is referenced only when runtime configuration is enabled */
  if (macRadioDefsRefTableId & 0xf0)
#endif /* defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 */

#if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || \
    defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592 || \
    defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590 || \
    defined HAL_PA_LNA_SE2431L || defined HAL_PA_LNA_CC2592
  { /* either if compound statement or non-conditional compound statement */
    
    /* (Re-)Configure PA and LNA control signals to RF frontend chips.
    * Note that The register values are not retained during sleep.
    */
    
    if (paLnaChip == PA_LNA_SE2431L)
    {
      /* CPS or P0_7 maps closely to the HGM line */
      HAL_PA_LNA_RX_HGM(); 
  
      /* EN or CSD line is controlled via software so setting it high here to start the SE2431L frontend */
      HAL_PA_LNA_RX_CSD_HIGH();
      
      /* CTX or P1_1 maps closely to PAEN */
      RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV;
      OBSSEL1       = OBSSEL_OBS_CTRL0;
    }
    else if(paLnaChip == PA_LNA_CC2592)
    {
      /* P1_1 -> PAEN */
      RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV;
      OBSSEL1       = OBSSEL_OBS_CTRL0;
      
      /* P1_0 -> EN (LNA control) */
      RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV;
      OBSSEL0       = OBSSEL_OBS_CTRL1;
    }  
    else 
    {   
      /* P1_1 -> PAEN */
      RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV;
      OBSSEL1       = OBSSEL_OBS_CTRL0;
      
      /* P1_0 -> EN (LNA control) */
      RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV;
      OBSSEL0       = OBSSEL_OBS_CTRL1;
    }
    
    /* For any RX, change CCA settings for CC2591 compression workaround.
    * This will override LNA control if CC2591_COMPRESSION_WORKAROUND
    * flag is defined.
    */
  }

在 mac_PIB.c 上- macPib_t macPibDefaults 局部变量内

/* ------------------------------------------------------------------------------------------------
 *                                           Local Variables
 * ------------------------------------------------------------------------------------------------
 */

/* PIB default values */
static CODE const macPib_t macPibDefaults =
{
  54,                                         /* ackWaitDuration */
  FALSE,                                      /* associationPermit */
  TRUE,                                       /* autoRequest */
  FALSE,                                      /* battLifeExt */
  #if defined (HAL_PA_LNA)					  /*Proprietary Ebyte*/
  20,
  #elif defined (HAL_PA_LNA_CC2590)
  11,
  #else
  #endif 
  6,                                          /* battLifeExtPeriods */
  NULL,                                       /* *pMacBeaconPayload */
  0,                                          /* beaconPayloadLength */
  MAC_BO_NON_BEACON,                          /* beaconOrder */
  0,                                          /* beaconTxTime */
  0,                                          /* bsn */

  {0, SADDR_MODE_EXT},                        /* coordExtendedAddress */
  MAC_SHORT_ADDR_NONE,                        /* coordShortAddress */
  0,                                          /* dsn */
  FALSE,                                      /* gtsPermit */
  4,                                          /* maxCsmaBackoffs */

  3,                                          /* minBe */
  0xFFFF,                                     /* panId */
  FALSE,                                      /* promiscuousMode */
  FALSE,                                      /* rxOnWhenIdle */
  MAC_SHORT_ADDR_NONE,                        /* shortAddress */

  MAC_SO_NONE,                                /* superframeOrder */
  0x01F4,                                     /* transactionPersistenceTime */
  FALSE,                                      /* assocciatedPanCoord */
  5,                                          /* maxBe */
  1220,                                       /* maxFrameTotalWaitTime */

  3,                                          /* maxFrameRetries */
  32,                                         /* ResponseWaitTime */
  0,                                          /* syncSymbolOffset */
  TRUE,                                       /* timeStampSupported */
  FALSE,                                      /* securityEnabled */

  /* Proprietary */
  0,                                          /* phyTransmitPower */
  MAC_CHAN_11,                                /* logicalChannel */
  {0, SADDR_MODE_EXT},                        /* extendedAddress */
  1,                                          /* altBe */
  MAC_BO_NON_BEACON,                          /* deviceBeaconOrder */
  0,                                          /* power savings for rf4ce */
  0,                                          /* default is frame Ver is always 0, 
                                                 except for security enabled packets */
  0,                                          /* diagsRxCrcPass */
  0,                                          /* diagsRxCrcFail */
  0,                                          /* diagsRxBcast */
  0,                                          /* diagsTxBcast */
  0,                                          /* diagsRxUcast */
  0,                                          /* diagsTxUcast */
  0,                                          /* diagsTxUcastRetry */
  0                                           /* diagsTxUcastFail */
};

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

    您好、Alexander、

    "什么都没有发生"是指什么?  定义 HAL_PA_LNA 时会看到什么错误、您使用的是哪个版本的 IAR EWARM? 您是否删除了 HOLD_AUTO_START、设置监听器以查看无线数据包、并使用逻辑分析仪监控 PA_EN/LNA_EN 线路?  您已将哪些示例应用程序加载到 CC2530中?  有关预期操作的更多信息、请与模块开发人员联系。

    强烈建议您考虑使用 SimpleLink CC13X2和 CC26X2器件、LaunchPad 和第三方 EVM、以实现更强大的 Zigbee 解决方案、每季度更新一次的软件和内部 PA 器件选项。

    此致、
    Ryan

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

    您好、Ryan、感谢您的回复!

    我´ll 回答您的问题。

    首先、为了让您更好地了解我的环境、我有一个支持两种字节无线电模型的定制板、第一个 E18-MS1PA2 (LNA 内部)和 E18-MS1 (不带 LNA)。 我的参考是 E18-MS1、它非常适用于我的应用/代码、我将最后一个开始并连接到网关中。 n´t、我没有使用协议分析器来检查 e!8-MS1PA2的行为。

    n´t,当我说"没有发生任何事情"时,我没有在这里列入详细情况。 我n´t MS1-PA2的定制板不要连接到网关!

    2.我之前删除了 HOLD_AUTO_START、正如我说过的、在网关上连接的 MS1板。

    的应用基于 samplpleLight、但我做了一些更改、但我保留了 hal_board_cfg.c  

    4、我联系了亿佰特检查我是否需要做些额外的事情、但是他们告诉我我需要查看随附的数据表、我需要注意 P1.0和 P1.1。

     我在   IAR 编译器选项中包含了其中一个 HAL_PA_LNA 或 HAL_PA_LNA_CC2590。 但是、当我在 IAR 上包含并开始重建所有内容时、我会遇到以下错误:

    BR、

    Alex

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

    在 Z-Stack Home 1.2.2a 中、我认为您无需在 mac_PIB.C 的 macPibDefaults 中添加这些代码 只需定义 HAL_PA_LNA 来测试 E18-MS1PA2以查看其是否正常工作。

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

    您的环境具有可测试的工作设置、这一点很好。  我同意 YK,对于 Z-Stack HA 1.2.2a,不需要对 macPibDefaults 进行更改。  正如亿佰特所指出的、如果您继续遇到问题、您应该进一步评估 P1.0/1.1。

    此致、
    Ryan

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

    Ryan 和 YK 先生、您好、  

    感谢大家!

    我成功配置了 Ebyte MS1PA2无线电模块。  

    我进行了两个设置,看了 YK 先生告诉我, 我在编译器选项中包括 HAL_PA_LNA,并在  mac_radio_defs.c 上 macRadioTurnOnPower 函数的末尾(其他)保留这些代码行 正如他们在代码上看到的:

    MAC_INTERNAL_API void macRadioTurnOnPower(void)
    {
      /* Enable RF error trap */
      MAC_MCU_RFERR_ENABLE_INTERRUPT();
    
    #if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || \
        defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592
      /* table ID is referenced only when runtime configuration is enabled */
      if (macRadioDefsRefTableId & 0xf0)
    #endif /* defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 */
    
    #if defined MAC_RUNTIME_CC2591 || defined MAC_RUNTIME_CC2590 || \
        defined MAC_RUNTIME_SE2431L || defined MAC_RUNTIME_CC2592 || \
        defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590 || \
        defined HAL_PA_LNA_SE2431L || defined HAL_PA_LNA_CC2592
      { /* either if compound statement or non-conditional compound statement */
        
        /* (Re-)Configure PA and LNA control signals to RF frontend chips.
        * Note that The register values are not retained during sleep.
        */
        
        if (paLnaChip == PA_LNA_SE2431L)
        {
          /* CPS or P0_7 maps closely to the HGM line */
          HAL_PA_LNA_RX_HGM(); 
      
          /* EN or CSD line is controlled via software so setting it high here to start the SE2431L frontend */
          HAL_PA_LNA_RX_CSD_HIGH();
          
          /* CTX or P1_1 maps closely to PAEN */
          RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV;
          OBSSEL1       = OBSSEL_OBS_CTRL0;
        }
        else if(paLnaChip == PA_LNA_CC2592)
        {
          /* P1_1 -> PAEN */
          RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV;
          OBSSEL1       = OBSSEL_OBS_CTRL0;
          
          /* P1_0 -> EN (LNA control) */
          RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV;
          OBSSEL0       = OBSSEL_OBS_CTRL1;
        }  
        else 
        {   
    		// proprietary for Ebyte MS1APA2-PCB
          /* P1_1 -> PAEN */
          RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV;
          OBSSEL1       = OBSSEL_OBS_CTRL0;
          
          /* P1_0 -> EN (LNA control) */
          RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV;
          OBSSEL0       = OBSSEL_OBS_CTRL1;
        }
        
        /* For any RX, change CCA settings for CC2591 compression workaround.
        * This will override LNA control if CC2591_COMPRESSION_WORKAROUND
        * flag is defined.
        */
      }

    感谢大家。

    BR

    Alex