This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Approach for synchronize two devices

Hello,

in our project we have a nRF52840DK as central (s140) and a custom board with nRF52832 chip as peripheral (s132). The software on the nRF52840DK is based on the ble_app_uart_c example and the software on the nRF52832 chip is based on the ble_app_uart example. The nRF52832 sends data to the nRF52840DK via NUS. This works fine. 

We want to roughly know, how "old" our data is, when it is received by the nRF52840DK. For this the data get timestamped. The idea is that the real-time clocks on the two devices are roughly in sync. The nRF52840DK will then know how "late" the data is. After some research, this should be achievable by implementing the following:

  • Device 1 enables the NUS notification and starts the real-time clock with the right prescaler.
  • Device 1 makes use of the ble_radio_notification to know exactly when to start the RTC.
  • Device 2 receives the "enable of the NUS notification" and starts the real-time clock as well with the same prescaler.

For implementing this correctly, we have a few questions:

  1. Where gets the NUS notification enabled in the ble_app_uart and ble_app_uart_c example?
  2. How to use the ble_radio_notification right?
  3. Where gets the "NUS notification enabled" received by ble_app_uart and ble_app_uart_c example on the other device?
  4. How to start the real-time clock with the right pre-scaler?

Thank you so much in advance.

Parents Reply Children
Related