The PLL status can be read from the sub register SR_PLL_LOCK_CP with the sequence GET_PLL_STATUS. The unlocking of the PLL is a critical event, if it occurs during the reception or transmission of a frame (see PHY_UNLOCK_PLL). Generally, a test of the PLL locking can be done with a state transition from TRX_OFF to PLL_ON (see PHY_STATE_TRX_OFF__PLL_ON.
| pllstat | This parameter has the value 1, if the PLL is locked to the programmed center frequency (see RF Channel Selection), otherwise it is 0. |
/* AT86RF212::[ACTIVE] */ pllstat = trx_bit_read(SR_PLL_LOCK_CP);
The unlocking of the PLL is a critical error, if it occurs in one of the [PLL_ACTIVE] states and no TRX_IRQ_PLL_LOCK interrupt follows after a TRX_IRQ_PLL_UNLOCK interrupt within the time tLockCrit.
In this case, the software should try to execute the sequence PHY_STATE_TRX_OFF__PLL_ON in order to force the PLL to lock.
/* AT86RF212::[PLL_ACTIVE] */ /* TRX_IRQ_PLL_UNLOCK occurs here */ handle_unlock();
1.5.6