8.10 Antenna Switching

The ATWILC devices support antenna diversity where dual antennas are connected to the chip using an external antenna switch.

Antenna switches are controlled using two input signals to select which antenna is in operation, and the user uses two different configurations with respect to the control GPIOs:
  1. Dual GPIO – two different ATWILC device GPIOs are used to control each of the antenna switch’s control lines.
  2. Single GPIO – a single ATWILC device GPIO is used to control one of the switch’s control lines, and its inverse is connected to the other control line. This configuration requires an external inverter. The antenna selection algorithm evaluates the average RSSI every second, and based on that, it determines if it needs to switch the antenna.

The average RSSI is calculated based on the RSSI read while receiving each packet. If the average RSSI is below threshold, it switches to the other antenna and sets a new threshold to the average RSSI of the abandoned antenna. To avoid unnecessary switching, the antenna switching happens only when the RSSI is below -30dBm, and has a margin of 1dBm to avoid hysteresis.

Sysfs entries can be used to configure the ATWILC device driver for the Antenna Diversity mode, and the GPIOs that are used to control the antenna switch at run time.