Hi Ethan,
I would like to ask, in the connection event, what type of clock is used to determine the next connection time? Is it a hardware TIMER or a software RTC? In other words, is it related to a high-frequency clock or a low-frequency clock?
Since you have tagged nrf5 sdk and nrf52, I am assuming you are using softdevice and also assuming that you are asking about the timing for the next "connection event" and not the next connection. It is not possible to anticipate the next connection. But the "connection event" For tracking next connection event softdevice have REM (Radio Event Manager) using LFCLK based hardware RTC (RTC0) to do timekeeping for the softdevice for all roles (including connections)
Hi,
Your understanding is correct. I used softdevice, and the time I expressed refers to the time of the connection event, that is, the connection interval.
According to your statement, the connection interval was calculated using RTC(LFCLK) instead of TIMER(HFCLK). Then I would like to ask further, LFCLK has a 32k external crystal oscillator and an internal RC circuit as the clock source. Under normal circumstances, a 32k crystal oscillator should be more accurate. Then, if RC is used as the clock source and the error is relatively large, will it affect the connection distance?
Hi,
Your understanding is correct. I used softdevice, and the time I expressed refers to the time of the connection event, that is, the connection interval.
According to your statement, the connection interval was calculated using RTC(LFCLK) instead of TIMER(HFCLK). Then I would like to ask further, LFCLK has a 32k external crystal oscillator and an internal RC circuit as the clock source. Under normal circumstances, a 32k crystal oscillator should be more accurate. Then, if RC is used as the clock source and the error is relatively large, will it affect the connection distance?
Welber said:Then, if RC is used as the clock source and the error is relatively large, will it affect the connection distance?
RC is normally not used for LFCLK while using BLE, better is to use LFSYNTH deduced from HFXO for better accuracy. None of our examples for BLE uses RC INT for LFCLK.
It will not affect the connection distance, but the energy consumption (if the device is a peripheral). The reason is that with a more inaccurate clock, the software must turn on the radio a bit earlier, to handle the case where the clock is slower than it should, to be sure to catch the connection event from the central.
Hi,
Do you mean that the software will automatically detect the accuracy of the LFCLK and then start the radio in advance or delay based on this error to ensure reliability?