Configuring Antenna Diversity#

The antenna diversity configuration options available for Zigbee EmberZNet consist of selecting Rx and/or Tx antenna diversity and configuring the underlying peripherals correctly. To configure antenna diversity, you must be familiar with your device’s overall antenna configuration, that is, if it uses a FEM/LNA for either Tx or Rx, and also be familiar with the device’s pin layout. Check the data sheet for your device for these settings or contact Silicon Labs support if you have questions.

These instructions assume you have installed Simplicity Studio and the Zigbee EmberZNet SDK (software development kit), and that you have a project open in the Simplicity IDE (integrated development environment).

Tx/Rx Diversity Configuration#

On the Software Components tab, install the RAIL Utility, Antenna Diversity Configuration component. To configure Rx and/or Tx diversity:

  1. Select TX/RX Antenna Diversity options (default is both enabled).

  2. Select MODEM under Selected Module (default is selected).

  3. Select ANT0 GPIO pin.

  4. Optionally select ANT1 GPIO if you have two antenna GPIOs.

  5. Ignore all other options.

    RAIL Utility, Antenna Diversity ConfigurationRAIL Utility, Antenna Diversity Configuration

In the Chip-external Antenna Diversity Configuration card, the antenna options for both Rx and Tx diversity are as follows:

  • Disable Antenna Diversity (don’t alter antenna selection): The code does not control ANTENNA_SELECT_GPIO.

  • Use Antenna 0 only: ANTENNA_SELECT_GPIO is set to high during Tx/Rx.

  • Use Antenna 1 only: ANTENNA_SELECT_GPIO is set to low during Tx/Rx.

  • Enable Antenna Diversity (Switch between antennas dynamically): Tx/Rx antenna selection is dynamic and Tx/Rx diversity is enabled.

The fields in the SL_RAIL_UTILITY_ANT_DIVERSITY card change based on the device you have connected. Regardless of what else is available, for antenna diversity only two are relevant, Select Module and the antenna GPIO pin selections. Leave all other values at their default settings.

  • Select Module (MODEM or None): Defaults to MODEM. Do not change.

  • Antenna pin selections: Set ANT0. Optionally set ANT1 if the device has two antenna GPIOs.

Runtime Configuration#

Tx diversity settings can be changed at runtime using the CLI or EZSP without any restriction. The ability to change Rx antenna diversity modes at runtime depends on the component configuration settings. Rx antenna diversity has an additional configuration parameter.

Enable/Disable Runtime PHY Select: When this option is enabled (toggled on), both the standard and the diversity-enabled PHYs are compiled into the image, thereby allowing the application to use API calls to change PHY (from standard to diversity or vice-versa) at runtime. Note that the code size of the image will increase significantly when this option is enabled. The decision to enable runtime Rx antenna diversity PHY select is a tradeoff between code size and reception quality when Rx antenna diversity is disabled. Some customers might want to enable runtime PHY select to test different PHYs with a single build even if they only want to ship with one PHY in practice. The implications of the different component configuration selections are summarized as follows.

Rx Antenna Diversity

Runtime PHY Select

Runtime configuration?

After Rx antenna diversity is disabled at runtime

Enabled

Disabled

Yes

The system stays on the Rx antenna diversity PHY.

Disabled

Enabled

Yes – can enable Rx Diversity

- -

Enabled

Enabled

Yes

The system switches to another PHY with better reception.

Disabled

Disabled

Not possible

- -

Command Line Interface#

To query and set Rx and Tx diversity modes using a CLI at runtime, install the Zigbee Utility, Antenna Diversity CLI component.

Zigbee Utility, Antenna Diversity CLIZigbee Utility, Antenna Diversity CLI

The commands are shown in the following table. The interpretation of returned results for get operations and permissible values for set operations are:

  • SL_RAIL_UTIL_ANTENNA_MODE_DISABLED: 0 (Do not alter antenna selection)

  • SL_RAIL_UTIL_ANTENNA_MODE_ENABLE1: 1 (Use antenna 1)

  • SL_RAIL_UTIL_ANTENNA_MODE_ENABLE2: 2 (Use antenna 2)

  • SL_RAIL_UTIL_ANTENNA_MODE_DIVERSITY: 3 (Choose antenna 1 or 2 dynamically)

Command

Command Description

API Function

Arguments

Name

Type

plugin antenna get-antenna-tx- mode

Returns the current setting for the Tx antenna diversity mode

emberAfPluginAntennaGetAntennaTxMode

n/a

n/a

plugin antenna set-antenna-tx- mode

Sets Tx diversity mode to argument

emberAfPluginAntennaSetAntennaTxMode

Tx Antenna Mode

uint8_t

plugin antenna get-antenna-rx- mode

Returns the current setting for Rx antenna diversity mode

emberAfPluginAntennaGetAntennaRxMode

n/a

n/a

plugin antenna set-antenna-rx- mode

Sets Rx diversity mode to argument

emberAfPluginAntennaSetAntennaRxMode

Rx Antenna Mode

uint8_t