I think we should do it like in other BLE implementations for NRF52
(SoftDevice, Zephyr) and use a combination of RTC and TIMER peripherals.
   There are quite a few places in the BLE protocol where we need to count
the time in various ranges from seconds to mili-seconds.
   It is not possible to achieve this with just one timer device.

   There is only one watchdog instance and at least two RTC instances in
the NRF52 chips.
   The watchdog timer should be left for user-specific applications.
   The system timer (SysTick) is not low-power friendly, so it is not
suitable either.
   Ultimately, we should use the TICK event from RTC as the system clock.

   Another thing is that we probably don't want to use the oneshot
interface but instead work directly with the TIMER/RTC peripherals.
   In a few days I'll add PR with TIMER and RTC support.

pt., 17 lip 2020 o 04:40 Matias N. <mat...@imap.cc> napisaƂ(a):

> Hi,
> I'm working on a BLE Link Layer for NuttX, which sits between HCI layer
> and low-level radio-layer. I'm starting with BLE scanning and I need to set
> a timer to periodically execute the radio reception to listen for
> advertisements. I'm trying to see which interface should this layer use:
> oneshot or watchdog? From what I understand, the oneshot would use a
> separate timer that of the system timer. I can only think of that
> difference, is there other?
> In any case, I'm not sure what would be desireable to use for this. I like
> the simplicity of the watchdog (nothing to implement) but maybe it is
> better to use a separate timer?
>
> At the hardware level, the NRF52832 is already designed to have two
> identical hardware timers, one usually used for the OS and the other for
> handling BLE timeouts, so maybe using a oneshot on the second timer is most
> apropriate.
>
> What do you think?
>
> Best,
> Matias

Reply via email to