Code Monkey home page Code Monkey logo

nrf5-ble-timesync-demo's Introduction

nRF5-ble-timesync-demo

nRF52 clock synchronization demo code

SDK version

Use the latest SDK version in this repo for the latest version of this demo. Older SDKs are included as legacy reference.

nRF Connect SDK (NCS)

NCS sample is included as a standalone application. Either use west tool as described below to fetch the required repositories and to build, or use nRF Toolchain manager and Visual Studio Code plugin to add existing application. Note: when using Toolchain manager, make sure to use toolchain that matches version from west.yml in this repository (look for sdk-nrf entry in west.yml).

To install the required toolchain, follow the instructions in NCS Getting started https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/getting_started.html.

If manual installation is chosen, the NCS sample is prepared, compiled, and programmed onto nRF52840-DK by executing the following commands from the folder timesync_sample folder, which west.yml and the sample code:

  1. west init --local
  2. west update
  3. west build -b nrf52840dk_nrf52840
  4. west flash

Demo setup

Two nRF5 SDK example applications are included, BLE central and BLE peripheral UART. Use two nRF52-DK/nRF52840-DK and program one example onto each DK.

There is currently only one NCS sample included, which combines timesync functionality and Bluetooth Peripheral NUS (Nordic UART Service). Program the same sample onto both nRF52-DK/nRF52840-DK and use the button selection described below to assign one of them as the timing transmitter.

Note that the timing demo functionality is independent of the BLE role, and more than two DKs can be used. In this system there is one time sync transmitter, but no limit to the number of receivers. The same example can also be programmed to the DKs with the same time sync functionality.

Demo usage

By default, the examples are configured to be in receiver mode, and no GPIO will be toggling. Press Button 1 on one of the DKs to switch from receiver to transmitter mode. The transmitter will begin toggling a GPIO immediately, and all 4 LEDs should light up (note: In NCS sample case, only LED 1 will light up). When the receiver DK(s) receives the first sync packet, it will start toggling a GPIO as well.

The GPIO assignment is as follows:

DK GPIO
nRF52-DK P0.24
nRF52840-DK P1.14

Measure performance

Connect an oscilloscope or logic analyzer to the toggling GPIO and observe the delay between each GPIO edge.

Oscilloscope measurement

Example measurement taken under ideal conditions, in this case no competing Bluetooth radio activity and packet rate set to 100 Hz.

Oscilloscope measurement

nrf5-ble-timesync-demo's People

Contributors

nordic-auko avatar arzippi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.