Bluetooth Low Energy connection events require
precise timing to ensure reliable packet exchange between devices. The Bluetooth
Core Specification permits a sleep clock accuracy (SCA) of up to ±500ppm + 16µs,
which defines the maximum allowable drift of the low-frequency clock source during
standby intervals.
The internal LFOSC is a free-running oscillator
whose frequency varies across device operating conditions. To compensate for LFOSC
frequency drift, the system employs a periodic hardware calibration mechanism. The
LFOSC period is measured against the Ultra Low Leakage (ULL) clock, which serves as
an accurate reference during active mode. In the same mode, the ULL clock (CLKULL)
operates at 24MHz, derived from the High-Frequency Oscillator (HFOSC) which is
derived from the High-Frequency Crystal Oscillator (HFXT). When the device enters
standby, the CLKULL switches to using the configured Low Frequency Clock
(LFCLK).
A conversion factor, referred to as LFINC, is
derived from this measurement and applied by the Real-Time Clock (RTC) to maintain
accurate timekeeping. This verifies that Bluetooth Low Energy (LE) connection event
scheduling remains within the sleep clock timing accuracy requirements defined in
the Bluetooth Core Specification, across the device's operating lifetime.
This calibration mechanism requires the High Frequency Crystal Oscillator (HFXT) to be active. During standby, the HFXT is powered down to minimize current consumption, suspending LFINC updates and leaving any LFOSC frequency drift occurring during this interval uncompensated. LFINC re-calibration resumes upon the next periodic wake-up event or BLE activity that reactivates the HFXT.
Simplified Example of using LFOSC
without LFCAL
Step 1 - Active Mode
- HFXT (48 MHz) is active and serves as the accurate reference for HFOSC,
producing a tracked HFOSC at 96 MHz for CC27xx devices and at 48MHz for CC23xx
devices.
- CLKULL is derived from the Tracked HFOSC producing 24MHz.
- The hardware measures the selected LFCLK (LFOSC in this case) period against the
CLKULL. For example, for a ~-300ppm deviation, LFOSC frequency = 32.758kHz.
- LFINC is updated to 30.527 µs. On every LFTICK, hardware adds LFINC to the RTC
TIME counter.
- To schedule the next connection event, a COMPARE value is set to current TIME +
desired interval (1000ms). The RTC fires a wake-up when TIME reaches
COMPARE.
Step 2 - Standby Mode
- HFXT is disabled and no longer being tracked for HFOSC.
- CLKULL switches to run on selected LFCLK (LFOSC for this example) LFINC cannot
be updated as there is no reference clock to measure LFOSC against.
- The RTC and WDT remain active using LFINC from previous measurement.
- LFOSC drifts to +500ppm from
nominal (32.7844kHz), corresponding to a change of frequency of approximately
800ppm, with stale LFINC so any LFOSC drift is uncompensated.
- The RTC continues to count LFTICK edges, but each tick now represents slightly
less real time than LFINC assumes. The timing error accumulates for as long as
the drift goes uncompensated. The earlier the drift occurs within the standby
period, the larger the error at wakeup. In the worst case, the drift occurs
immediately after HFXT is disabled, accumulating over the full standby
duration.
Step 3 -
RX Window Timing
- The RTC counts 32,758 LFTICK edges, expecting 1000.00 ms to have elapsed. Actual
elapsed time: 32,758 ticks × 30.5023 µs = 999.194ms
- The peripheral's estimated RX window opens 806µs too early
- Ignoring central SCA for simplicity (typically approximately 50ppm), the central
device transmits the connection packet at T = 1000.00ms.
- With a peripheral SCA of 500ppm
and the 16µs instantaneous jitter allowance from the Bluetooth Specification,
the RX window extends 516µs before and after the estimated anchor point:
The real packet arrives 806µs after
the estimated anchor point, 290µs after the window has already closed. The
connection packet is missed.