CCA operations
CCA is a method of collision avoidance that is implemented by detecting the energy level on the transmission channel before starting the transmission. The CCA threshold (defined by the CA parameter) defines the energy level that it takes to block a transmission attempt. For example, if CCA is set to the default value of 0x32 (which is interpreted as -50 dBm) then energy detected above the -50 dBm level (for example -45 dBm) temporarily blocks a transmission attempt. But if the energy level is less than that (for example -70 dBm), the transmission is not blocked. The intent of this feature is to prevent simultaneous transmissions on the same channel.
You can disable CCA by setting CA to 0. Disabling CCA can improve latency in noisy environments, but it can also interfere with other devices that are operating on the same channel. Setting or changing CA to a non-zero value only takes effect upon boot. If you adjust the CA value, ensure that you write the setting to flash with WR (Write) and restart with an FR (Software Reset).
In the event that the energy level exceeds the threshold, the transmission is blocked for a random number of backoff periods. The number of backoff periods is defined by the following formula: random(2^n - 1), where n is defined by the RN parameter and increments after each CCA failure. When RN is set to its default value of 0, then 2^n -1 is 0, preventing any delay before the first energy detection on a new frame. However, n increments after each CCA failure, giving a greater range for the number of backoff periods between each energy detection cycle.
In the event that six energy detection cycles occur and each one detects too much energy, the application tries again 1 to 48 ms later. After the application retries are exhausted, then the transmission fails with a CCA error.
Whenever the MAC code reports a CCA failure, meaning that it performed six energy detection cycles with exponential random back-offs, and each one failed, the EC parameter is incremented. The EC parameter can be read at any time to find out how noisy the operating channel is. It continues to increment until it reaches its maximum value of 0xFFFF. To get new statistics, you can set EC back to 0.
PDF
