Hi Guys,
I´m working to configure Ebyte Module E18-MS1PA2 CC2530 (w/ PA and LNA inside), but I didn´t have success to setting it correctly. According the Ebyte datasheet is necessary to change those files hal_board_cfg.h, mac_radio_defs.c and mac_pib.c. Even after setting up it nothing is happaning!
Note: I tryng to incluse HAL_PA_LNA or HAL_PA_LNA_CC2590, one at time, on IAR compiler option, but I saw erros on mac_pib.c. I dodn´t know if it is necessary to do!
I using at this moment the Z-Stack Home 1.2.2a.44539.
I did tE18-MS1PA2-PCB_UserManual_EN_v1.0.pdfhose configurations on files:
on HAL_board_cfg.c - on global variables.
/* ------------------------------------------------------------------------------------------------ * 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
on mac_radio_defs.c - insite the macRadioTurnOnPower(void) function
, I have set up the P1.1 and P1.0 settings at the end of function (from lines #46 to #52).
note: I have nothing connected physically on CC2530 on those pins.
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.
*/
}
on mac_pib.c - inside the macPib_t macPibDefaults local variables
/* ------------------------------------------------------------------------------------------------
* 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 */
};