Changes in ZigBee after CC2530 adds CC2591 amplifier

First need to modify:
(if using CC2530 + CC2590EM, define HAL_PA_LNA_CC2590 if using CC2530 + CC2591EM, define HAL_PA_LNA Note that only one of the definitions can be used)
Enable in hal_board_cfg.h, remove X
/* ------ -------------------------------------------------- ----------------------------------------
* 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


Generally, if the power amplifier is designed according to the official circuit, then only the above settings are required. If there are changes in the official circuit, then you need to follow the following, and then modify it according to your actual situation:

In the TI Ztack protocol stack, the connection between CC2530 and CC2591 is shown in the figure below:

CC2591 has three pins connected to CC2530. If the hardware pins are connected to other pins, it needs to be modified on the protocol stack. It is worth noting that PA_EN and EN can only be connected to P1_0 to P1_5, which is determined by CC2530. HGM can be arbitrarily defined.
Let's talk about how these three pins are modified in the protocol stack. 
1. Modification of HGM: If HAL_PA_LNA is defined, the corresponding
HAL_BOARD_INIT function will be called first during initialization. In this function, there is a pin P0DIR |= BV(7) of Set PA/LNA HGM control, then modify the Pin definition can be. Then in mac_radio_defs.h
 #define HAL_PA_LNA_RX_HGM() st( P0_7 = 1; )    
#define HAL_PA_LNA_RX_LGM() st( P0_7 = 0; ) can be modified here. 
2. Modify PA_EN and EN, the modifications here are hidden. Find the
macRadioTurnOnPower function in mac_radio_defs.c, in this function find /* P1_2 -> PAEN */ 
RFC_OBS_CTRL0 = RFC_OBS_CTRL_PA_PD_INV; OBSSEL2 = OBSSEL_OBS_CTRL0;  
/* P1_5 -> EN (LNA control) */
RFC_OBS_CTRL1 = RFC_OBS_CTRL_LNAMIX_PD_INV; 
OBSSEL5 = OBSSEL_OBS_CTRL1;

The first is to set PAEN. If it is P1_3, set OBSSEL3, and which pin of the P1 port is used, set the corresponding OBSSEL register. The same is true for EN.





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324771366&siteId=291194637