Exercise 1 – Estimating and measuring how clock sources affect power consumption
In this exercise, you will learn how clock selection affects the total current consumption of a peripheral device. You will begin by exploring the most important topics related to clock selection and configuration, starting with comparing Online Power Profiler estimations for both clock options. You will then use the PPK2 to measure average current consumption over various intervals and identify connection events.
Additionally, you will observe how the accuracy of the low-frequency clock source affects window widening and average current consumption.
Optionally, you will monitor radio transceiver activity using a logic analyzer or oscilloscope to gain deeper insight into the radio transceiver behavior.
A handful of steps in this exercise are marked as optional as they require additional hardware:
Logic analyzer or oscilloscope
nRF52840 DK or dongle, or any BT sniffer
Note
Although the course supports all nRF54L Series DK boards, the exercise steps are run on the nRF54L15 DK, and the current consumption and timing results can vary depending on your selected target.
To observe and verify the current consumption, use the PPK2 using source meter mode.
Part 1 – Bluetooth LE connection
2. Change the Bluetooth LE connection interval.
The clock selection matters the most for the connection phase. When the peripheral and the central are connected, they exchange data periodically. For this phase, not only does the low-frequency clock current matter, but also the calibration procedure and peripheral reception time increase due to clock accuracy.
The default connection interval for the peripheral is 30 ms (24 * 1.25 ms). use Kconfig search to check the default value of the CONFIG_BT_PERIPHERAL_PREF_MIN_INT Kconfig option
The device with this configuration consumes around 80 µA.
This exercise demonstrates how the clock selection affects the current consumption. The difference should be around a few µA, so configure the application to have a much lower base current consumption. For applications that do not need to exchange data so often, the easiest way to do this is just to increase the connection interval.
This gives a connection interval of one second. The connection parameters were covered in Lesson 3 of this course.
3. Using an external crystal oscillator.
3.1 Select a low-frequency clock source. When using the nRF Connect SDK, use Kconfig search to check the default value of the CONFIG_CLOCK_CONTROL_NRF_SOURCE Kconfig option.
Observe that the external oscillator is the default source for the low-frequency clock. You can verify this in the .config file containing the Zephyr configuration parameters for the project, found in the {build}/l4_e1/zephyr/ folder.
Copy
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y# CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH is not set# CONFIG_CLOCK_CONTROL_NRF_HFINT_CALIBRATION is not set# CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM is not set# CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM is not set# CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM is not set# CONFIG_CLOCK_CONTROL_NRF_K32SRC_100PPM is not set# CONFIG_CLOCK_CONTROL_NRF_K32SRC_75PPM is not setCONFIG_CLOCK_CONTROL_NRF_K32SRC_50PPM=y
Kconfig
The application uses the external crystal. Notice that the system is configured to use 50 ppm accuracy of the clock by default. This fact will be helpful in the next steps of this exercise.
For the central, the clock accuracy should be 50 ppm or better.
3.2 The crystal is mounted on the nRF54L Series DK boards. It requires capacitors for the operation. The nRF54L Series SoCs are equipped with programmable internal capacitors.
You can check their configuration by browsing the devicetree (for the nrf54L15 SoC it will be: <path_to_sdk>/zephyr/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi).
3.4 The connection parameters and estimated average current consumption should look like this:
Connection interval: 1000 ms
Peripheral accuracy: 50 ppm
Central accuracy (estimated): 50 ppm
TX power: 0 dBm
4. Estimating current consumption during the connection phase.
For an empty PDU packet, the total receive and transmit size is 10 B:
1B Preamble
4B Access address
2B PDU header
3B CRC
4.1 Estimate the current consumption using the Online Power Profiler.
The estimated total average current consumption is 5.3 µA.
4.2 Estimate the data exchange time and window widening.
Using 2 Mbps PHY spends around 40 µs on receiving/transmitting.
The easiest part is the peripheral transmission, which sends 10 B and takes 40 µs. For the receiving time, you can identify the calculated receiving time (40 µs) and the window widening (WW) part. You can estimate what the WW part should be for a given clock accuracy and the connection interval using the following formula:
The Online Power Profile (OPP) tool shows a similar value. Note that the tool is for evaluation purposes only. The estimations include additional hardware-specific properties, and actual results can also differ by device by approximately 5%.
5. Verify the power and timing estimations during the connection phase.
When you have your estimations ready, see how they align with the practice.
5.1 Build and flash the application to the DK.
5.2 Establish a connection to the DK.
Open the nRF Connect for Mobile application on your smartphone. In the app, press the Play/SCAN icon in the upper right corner. Your smartphone now acts as a central device, scanning for any Bluetooth LE devices that are advertising in its presence. Several Bluetooth-enabled devices around you will start appearing. Choose the one called NORDIC_LBS and tap Connect.
5.3 (Optional) Sniffing the communication
You do not need any additional hardware to complete this course, other than the PPK2 and an nRF54L Series DK.
However, if you have an nRF52840 DK or dongle, or any BT sniffer you can also check the connection data. For the nRF52840 DK and dongle, the procedure for setting up and using the sniffer is described in Bluetooth LE Fundamentals Course: Lesson 6 Bluetooth LE Sniffer. Use the sniffer to verify if the payload and transmission time match the OPP configuration. You can also figure out the low-frequency clock accuracy of the central, and whether it matches the value (50 ppm) assumed in the OPP.
See the connection indication event sent by the central. You can confirm that the Sleep Clock Accuracy (SCA) is 50 ppm or better. Note that SCA can vary depending on the device.
See the packages being sent periodically. There is transmission in both directions, and there are 10 B in the Bluetooth LE Link Layer (including preamble). The transmission takes 44 µs for a single packet, which confirms what was estimated in the OPP.
5.4 Current consumption verification using the Power Profiler app.
Start measuring the current consumption using the PPK2, just like in previous lessons. Note that the connection interval is only changed from the default 30 ms to 1 s after five seconds from the connection request. In the app, you can confirm that the connection interval is correct and that the average current consumption is quite close to the previous estimate.
The idle current is 2.55 µA, which is a bit below the estimate in the OPP.
5.4 Identifying transmission phases.
When you take a closer at the communication, you should see something like this:
There are three main parts of the communication event.
Crystal ramp-up (followed by standby time). The application works using HFINT. Enabling the external crystal is required for the radio activity.
Radio RX (including also starting the radio and WW).
Radio TX.
6. (Optional ) Observing radio activity using external pins.
This step requires an oscilloscope or logic analyzer, and is therefore optional.
The PPK2 is a measurement tool for current measurement rather than precisely showing the events in time. For this purpose, you can use a logic analyzer or an oscilloscope. In this step, you will measure the radio transceiver activity using a logic analyzer or an oscilloscope. In the nRF Connect SDK, the MPSL is responsible for the Bluetooth LE communication. It has a feature that allows debugging the hardware behavior.
6.1 To enable MPSL debugging, add the following line in the prj.conf file:
Copy
CONFIG_MPSL_PIN_DEBUG=y
Kconfig
6.2 Build and flash the firmware to your DK.
You can use Kconfig search to check the default value of the CONFIG_MPSL_PIN_DEBUG_RADIO_READY_AND_DISABLED_PIN and identify the events and corresponding pins. See especially the radio transceiver events. Notice that pin P1.11 on an nRF54L Series device is toggled in sync with the activity of the radio transceiver.
6.3 Connect a probe to the pin and look at the communication event.
Looking at the signal, you can identify all TX and RX phases, with the radio switch (~150 µs) phase. The RX window is ~360 µs. The period starts when the radio is enabled and contains WW (until the package arrives), the receiving process, and completes when the transceiver is stopped. The radio switch and TX phases can be directly matched with the estimated values in the OPP.
7. Using an internal RC oscillator during the connection phase.
The use of the default and most common source for a low-frequency clock are already covered. As an alternative, you can use the internal RC oscillator as a low-frequency source. The benefits of both solutions were covered in Clock sources. When using an internal oscillator and calculating the power budget, you need to take into account the following factors:
Calibration procedure
Longer RX period (due to window widening procedure)
Higher run current for internal RC: +0.6 µA
7.1 Enable internal RC oscillator.
To enable an internal RC oscillator, add the following line to the prj.conf file:
Copy
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
Kconfig
7.2 Build and flash the firmware to your DK.
The internal oscillator comes with reduced accuracy. It requires a calibration procedure performed periodically to achieve and keep this level of declared accuracy. You need to know which low-frequency clock accuracy to use for the current consumption estimation. See the low-frequency clock settings in the Kconfig search.
Clock accuracy (CLOCK_CONTROL_NRF_ACCURACY_PPM):
Calibration period (CLOCK_CONTROL_NRF_CALIBRATION_PERIOD):
Clock summary:
250 ppm accuracy
4 s/8 s calibration period (depends on temperature)
7.3 You now have all the parameters for the OPP to estimate the current consumption, including the parameters already known from the previous steps of this exercise:
50 ppm central SCA
1000 ms connection interval
2 Mbps PHY
0 dBm TX power
The total average current consumption is 7.6 µA (5.3 µA using an external crystal oscillator), so the difference is more than 2 µA. The window widening area is also much larger. You can compare it with the WW from the previous steps. The rest of the communication stays on a similar level.
7.4 In the Power Profiler app, after programming the application, you can see the calibration procedure every 4 s and three connection events due to the 1 s connection interval.
The calibration procedure consumes a lot of energy and CPU time:
7.5 You can also confirm the increased idle current (due to internal RC run current): 3.28 µA (2.55 µA for external crystal):
7.6 As a summary, the average current consumption is 8.3 µA, which is pretty close to the OPP estimations.
7.7 (Optional) Analyzing the activity of the radio transceiver.
Use the scope or logic analyzer to see how the RX window (including WW) changed when using the internal RC:
You can identify when the radio is in receiving mode (~550 µs), the radio mode switch (~150 µs), and transmission (~40 µs). These values are quite close to the OPP estimations.
Part 2 – Bluetooth LE advertising
8. Configuring the advertising interval.
In this part, you will observe the current consumption during the advertisement process.
8.1 Define the advertising setting by adding the following snippet in main.c.
8.2 Apply defined settings for the advertising process.
Replace the call to bt_le_adv_start() in main.c, with the following code line
int err = bt_le_adv_start(BT_LE_ADV_CONN_100, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
C++
The advertising interval is now: 100 ms
8.3 To use the default low-frequency clock source, disable the internal oscillator in the prj.conf file:
Copy
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=n
Kconfig
8.4 Build and flash the firmware to your DK.
9. Estimating the current consumption for the internal oscillator and external crystal.
9.1 Find the size of the advertisement payload.
To estimate the current consumption, you need to know the advertisement payload, which is defined in main.c file. It contains the following information:
Flags: 1 B len + 1 B type + 1 B data = BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR
Device name: ( 1 B len + 1 B type + 10 B data + “Nordic_LBS”
9.2 Find out how to select a low-frequency clock source. Like in the connection part of the exercise, you see that the default clock source is an external crystal with 50 ppm accuracy.
9.3 Check the default setting of the radio transmission power in the {build}/l4_e1/zephyr/.config file.
Copy
CONFIG_BT_CTLR_TX_PWR_0=y
Kconfig
The radio TX power is 0 dBm.
9.4 Now you have all the data that you need to estimate the current consumption for your device. Use the Online Power Profiler to estimate the average current consumption with the the following values:
9.5 Estimate the current consumption for the internal RC oscillator.
The total current consumption is approximately one µA higher when using an external crystal. As the window widening is applied only when the connection is established, the increased current consumption is caused by higher run current and the calibration procedure.
10. Verifying the estimations.
10.1 Confirm that your application works as expected. Verify the advertising interval using the PPK2 to measure this.
10.2 (Optional) Payload verification.
When you capture the proper advertisement packet using Bluetooth LE sniffer, you can look into the timings and the structure.
The payload and packet transmission time match your design and estimation. It is 15 B Payload + 16 B Bluetooth frame (headers, addresses) = 31 B = 248 b. Using 1 Mbps, it gives 248 µs transmission time.
10.3 Measure the average current consumption.
Look into average current consumption. The application uses an external crystal by default.
10.4 To configure the project to use an internal oscillator again, enable the following Kconfig option in the prj.conf file:
Copy
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
Kconfig
10.5 Build and flash the firmware to your DK and measure the current consumption:
The current consumption has increased slightly. The measured values are not far from the estimations.
Nordic Developer Academy Privacy Policy
1. Introduction
In this Privacy Policy you will find information on Nordic Semiconductor ASA (“Nordic Semiconductor”) processes your personal data when you use the Nordic Developer Academy.
References to “we” and “us” in this document refers to Nordic Semiconductor.
2. Our processing of personal data when you use the Nordic Developer Academy
2.1 Nordic Developer Academy
Nordic Semiconductor processes personal data in order to provide you with the features and functionality of the Nordic Developer Academy. Creating a user account is optional, but required if you want to track you progress and view your completed courses and obtained certificates. If you choose to create a user account, we will process the following categories of personal data:
Email
Name
Password (encrypted)
Course progression (e.g. which course you have completely or partly completed)
Certificate information, which consists of name of completed course and the validity of the certificate
Course results
During your use of the Nordic Developer Academy, you may also be asked if you want to provide feedback. If you choose to respond to any such surveys, we will also process the personal data in your responses in that survey.
The legal basis for this processing is GDPR article 6 (1) b. The processing is necessary for Nordic Semiconductor to provide the Nordic Developer Academy under the Terms of Service.
2.2 Analytics
If you consent to analytics, Nordic Semiconductor will use Google Analytics to obtain statistics about how the Nordic Developer Academy is used. This includes collecting information on for example what pages are viewed, the duration of the visit, the way in which the pages are maneuvered, what links are clicked, technical information about your equipment. The information is used to learn how Nordic Developer Academy is used and how the user experience can be further developed.
2.2 Newsletter
You can consent to receive newsletters from Nordic from within the Nordic Developer Academy. How your personal data is processed when you sign up for our newsletters is described in the Nordic Semiconductor Privacy Policy.
3. Retention period
We will store your personal data for as long you use the Nordic Developer Academy. If our systems register that you have not used your account for 36 months, your account will be deleted.
4. Additional information
Additional information on how we process personal data can be found in the Nordic Semiconductor Privacy Policy and Cookie Policy.
Nordic Developer Academy Terms of Service
1. Introduction
These terms and conditions (“Terms of Use”) apply to the use of the Nordic Developer Academy, provided by Nordic Semiconductor ASA, org. nr. 966 011 726, a public limited liability company registered in Norway (“Nordic Semiconductor”).
Nordic Developer Academy allows the user to take technical courses related to Nordic Semiconductor products, software and services, and obtain a certificate certifying completion of these courses. By completing the registration process for the Nordic Developer Academy, you are agreeing to be bound by these Terms of Use.
These Terms of Use are applicable as long as you have a user account giving you access to Nordic Developer Academy.
2. Access to and use of Nordic Developer Academy
Upon acceptance of these Terms of Use you are granted a non-exclusive right of access to, and use of Nordic Developer Academy, as it is provided to you at any time. Nordic Semiconductor provides Nordic Developer Academy to you free of charge, subject to the provisions of these Terms of Use and the Nordic Developer Academy Privacy Policy.
To access select features of Nordic Developer Academy, you need to create a user account. You are solely responsible for the security associated with your user account, including always keeping your login details safe.
You will able to receive an electronic certificate from Nordic Developer Academy upon completion of courses. By issuing you such a certificate, Nordic Semiconductor certifies that you have completed the applicable course, but does not provide any further warrants or endorsements for any particular skills or professional qualifications.
Nordic Semiconductor will continuously develop Nordic Developer Academy with new features and functionality, but reserves the right to remove or alter any existing functions without notice.
3. Acceptable use
You undertake that you will use Nordic Developer Academy in accordance with applicable law and regulations, and in accordance with these Terms of Use. You must not modify, adapt, or hack Nordic Developer Academy or modify another website so as to falsely imply that it is associated with Nordic Developer Academy, Nordic Semiconductor, or any other Nordic Semiconductor product, software or service.
You agree not to reproduce, duplicate, copy, sell, resell or in any other way exploit any portion of Nordic Developer Academy, use of Nordic Developer Academy, or access to Nordic Developer Academy without the express written permission by Nordic Semiconductor. You must not upload, post, host, or transmit unsolicited email, SMS, or \”spam\” messages.
You are responsible for ensuring that the information you post and the content you share does not;
contain false, misleading or otherwise erroneous information
infringe someone else’s copyrights or other intellectual property rights
contain sensitive personal data or
contain information that might be received as offensive or insulting.
Such information may be removed without prior notice.
Nordic Semiconductor reserves the right to at any time determine whether a use of Nordic Developer Academy is in violation of its requirements for acceptable use.
Violation of the at any time applicable requirements for acceptable use may result in termination of your account. We will take reasonable steps to notify you and state the reason for termination in such cases.
4. Routines for planned maintenance
Certain types of maintenance may imply a stop or reduction in availability of Nordic Developer Academy. Nordic Semiconductor does not warrant any level of service availability but will provide its best effort to limit the impact of any planned maintenance on the availability of Nordic Developer Academy.
5. Intellectual property rights
Nordic Semiconductor retains all rights to all elements of Nordic Developer Academy. This includes, but is not limited to, the concept, design, trademarks, know-how, trade secrets, copyrights and all other intellectual property rights.
Nordic Semiconductor receives all rights to all content uploaded or created in Nordic Developer Academy. You do not receive any license or usage rights to Nordic Developer Academy beyond what is explicitly stated in this Agreement.
6. Liability and damages
Nothing within these Terms of Use is intended to limit your statutory data privacy rights as a data subject, as described in the Nordic Developer Academy Privacy Policy. You acknowledge that errors might occur from time to time and waive any right to claim for compensation as a result of errors in Nordic Developer Academy. When an error occurs, you shall notify Nordic Semiconductor of the error and provide a description of the error situation.
You agree to indemnify Nordic Semiconductor for any loss, including indirect loss, arising out of or in connection with your use of Nordic Developer Academy or violations of these Terms of Use. Nordic Semiconductor shall not be held liable for, and does not warrant that (i) Nordic Developer Academy will meet your specific requirements, (ii) Nordic Developer Academy will be uninterrupted, timely, secure, or error-free, (iii) the results that may be obtained from the use of Nordic Developer Academy will be accurate or reliable, (iv) the quality of any products, services, information, or other material purchased or obtained by you through Nordic Developer Academy will meet your expectations, or that (v) any errors in Nordic Developer Academy will be corrected.
You accept that this is a service provided to you without any payment and hence you accept that Nordic Semiconductor will not be held responsible, or liable, for any breaches of these Terms of Use or any loss connected to your use of Nordic Developer Academy. Unless otherwise follows from mandatory law, Nordic Semiconductor will not accept any such responsibility or liability.
7. Change of terms
Nordic Semiconductor may update and change the Terms of Use from time to time. Nordic Semiconductor will seek to notify you about significant changes before such changes come into force and give you a possibility to evaluate the effects of proposed changes. Continued use of Nordic Developer Academy after any such changes shall constitute your acceptance of such changes. You can review the current version of the Terms of Use at any time at https://academy.nordicsemi.com/terms-of-service/
8. Transfer of rights
Nordic Semiconductor is entitled to transfer its rights and obligation pursuant to these Terms of Use to a third party as part of a merger or acquisition process, or as a result of other organizational changes.
9. Third Party Services
To the extent Nordic Developer Academy facilitates access to services provided by a third party, you agree to comply with the terms governing such third party services. Nordic Semiconductor shall not be held liable for any errors, omissions, inaccuracies, etc. related to such third party services.
10. Dispute resolution
The Terms of Use and any other legally binding agreement between yourself and Nordic Semiconductor shall be subject to Norwegian law and Norwegian courts’ exclusive jurisdiction.
Switch language?
Progress is tracked separately for each language. Switching will continue from your progress in that language or start fresh if you haven't begun.
Your current progress is saved, and you can switch back anytime.
•Support for nRF54LS05 DK (Available through the early access sampling program) •Support for the nRF54LM20B with Axon NPU for Edge AI applications
Bluetooth LE updates
•Quality of Service module is now production-ready. •New experimental features for RF testing (Direct Test Mode) and low-latency packet handling (LE Flushable ACL).
MCUboot & Partition Manager
•Single-Slot DFU and RAM Load mode are both promoted to fully supported •Partition Manager is officially deprecated in favor of Zephyr's devicetree-based partitioning.