AN370
Rev. 1.0
57
vFCast_XoSetup
Description
: Crystal oscillator (XO) setup and enable. The functions sets the XO parame-
ters based on the passed values in the tFCast_XoSetup structure instance. Then it turns the
XO on by setting the XO enable bit (mask M_XO_ENA) in the bXO_CTRL register.
Frequency casting function vFCast_Tune() will look at the bXO_CTRL.XO_ENA bit and
if the bit is set then it will use the crystal oscillator, otherwise it will use its own internal
algorithm for frequency calibration.
The vFcast_Tune() function won’t turn off the XO. It is up to the user to turn it off after
tuning (e.g., to save power). The time (10 ms) needed for XO to stabilize should also be
taken into account.
It is also possible to enable the crystal oscillator (XO) at the beginning of the boot process,
so the XO will be stabilizing while the device is going through the boot process to save
time in the main application. See bit4 of SFR PROT3_CTRL in the Si4010 data sheet and
the corresponding XO Early Enable checkbox on the NVM programmer GUI.
The user can turn the XO on and off as required by, for example, using the following C
code:
bXO_CTRL &= (~M_XO_ENA); /* Turning the XO off */
…
bXO_CTRL |= M_XO_ENA; /* Turning the XO on */
Inputs
:
priXoSetup: (pointer to tFCast_XoSetup instance which resides in XDATA) XO
setup data. See the tFCast_XoSetup table above.
Outputs
:
None
vFCast_Tune
Description
: Tunes the device’s output frequency to the desired frequency. The input fre-
quency is provided as a float 32-bit number and is in [Hz].
The function also calculates necessary data to be used by the single Tx loop main function,
vStl_SingleTxLoop(), for fine frequency correction during transmission.
The user can call this function in between packets, or just once before transmission. It
takes about ~5ms to execute this function. The function forces internal clock to run at fast-