bcm-v4 [Specification]

## Measuring Gains

The goal of this section is to find four gain values, TRSW_RX, the LNA lod, the LNA value and the PGA Value. The maximum RX Gain is required. If this is a negative value, use 0 instead.

After using the tables below to check the values:

1. If the LNA lod value is 0

1. AND Radio Register 0x7A with 0xFFF7

2. Otherwise
1. OR Radio Register 0x7A with 0x8

### Loopback Gain Enabled

1. If using the TRSW_RX value is desired
1. Take the TRSW_RX Gain (in hdB, from Loopback Gain measurement) and divide by 2

2. If the maxmimum Gain value is greater or equal to the result
1. Subtract the result from the maximum Gain value, this value will be referred to as the TRSW_RX Gain
2. The TRSW_RX value is 0x20

2. Otherwise
1. The TRSW_RX Gain is the maximum Gain value
2. The TRSW_RX value is 0

3. If the TRSW_RX Gain is < 9

1. The LNA lod value is 0

4. Otherwise
1. The LNA lod value is 1

2. Subtract 0x8 from the TRSW_RX Gain value
5. Clamp the TRSW_RX Gain value between [0, 0x2D]
6. Divide the TRSW_RX Gain value by 3 to find the PGA Value

7. If the PGA Value is 5 or greater

1. Subtract 5 from the PGA Value

2. The LNA Value is 2

8. Otherwise
1. The LNA Value is 0

### Loopback Gain Disabled

 TRSW_RX 0x20 LNA Value 0

The other values depend on the maximum RX gain as shown below:

 Maximum RX Gain LNA lod PGA Value >= 0x14 1 2 0x14 > x >= 0x12 1 1 0x12 > x >= 0xF 1 0 0xF > x 0 0

Exported/Archived from the wiki to HTML on 2016-10-27