bcm-specs

[Specification

Start Noise Sampling Interrupt

  1. Save the current channel so we can check on the interrupt that the channel hasn't changed and the data is valid
  2. If this is an A PHY
    1. Lock PHYRegisterLock

    2. Lock RadioRegisterLock

    3. Mask PHYRegister 0x7A with 0xF0FF

    4. Read the value of RadioRegister 0x13

    5. Unlock RadioRegisterLock

    6. Unlock PHYRegisterLock

    7. Write the value from RadioRegister 0x13 to SHM offset 0x6C

  3. Write 0 to SHM offset 0x408

  4. Write 0 to SHM offset 0x40A

  5. Set bit 4 (0x10) in the Reg124BitField

On the Interrupt

  1. Read the 16 bit value from SHM offset 0x408 and split it into two 8 bit values

  2. If this is a G PHY
    1. Read the 16 bit value from SHM offset 0x40A and split it into two 8 bit values

  3. Read the 16 bit value from SHM offset 0x40C, convert this from the channel format written to the chip to the channel number

  4. If this is an A PHY
    1. Take the absolute value of the first 8 bit value
    2. If the second value bitwise AND'd with 1 is 0
      1. Start the Noise Sampling Interrupt again
    3. If the PHY Revision is 3 or greater
      1. Left shift the value by 2
  5. If the channel isn't the same as when we generated the noise sample return
  6. Using each 8 bit value as an offset into the in memory NRSSILookupTable, then save the looked up value

  7. If we have not yet collected 8 samples, Start the Noise Sampling Interrupt again and return

Evaluating the Noise

  1. Find the average of the samples multiply it by 125 and add 64, then divide by 128
  2. Take the channel value read from SHM offset 0x40C divided by 128 AND'd by 0x1F

  3. If the adjusted channel value is 8 or greater, add 2 to the average, otherwise subtract 25
  4. If the adjusted channel value is 8, subtract 72 from the average, otherwise subtract 48
  5. The result is the noise level in dBm (probably)

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