The Energy Conservatory Port Devices Driver

Frontline Test Equipment, Inc. The Leader in Portable, Affordable, PC-Based Datacom Test Equipment and Custom Decodes. In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabling operating systems and other computer programs to access hardware functions without needing to know precise details about the hardware being used.

When it comes to Bluetooth Low Energy modules, chipsets and development kits, prices are only getting lower. Take for example the new nRF52840 USB dongle. The dongle costs only $10 and can serve as a great development kit with a few I/O peripherals including one button, two LEDs (one green, one RGB), and 15 GPIO pins.

The nRF52840 dongle is a compact USB dongle that’s based on the nRF52840 chipset from Nordic Semiconductor. The dongle can be used in two main use cases:

  1. Before we get into more advanced troubleshooting steps to fix the USB port issue on your Surface Pro 3, we want to make sure we cover the basics: Check and install all the latest device drivers. This ensures the hardware components of your device communicates correctly.
  2. The Device Install Kit download site does not provide access to all Emerson Process Management device files. Device files distributed on DeltaV and AMS Device Manager release media are not duplicated for download from this site.
  3. The driver for FTDI chips allows you to lower the latency time on packets. To do this, you can use the Latency Timer field, which is accessed through the Windows Device Manager. Follow these steps: From the Windows Device Manager, right-click your device from the list. In the drop-down menu that opens, select Properties. Click the Port Settings.
  • As a dongle that enables nRF Connect PC applications such as the Bluetooth Low Energy application (central and peripheral emulator), the nRF Cloud Gateway application, and the RSSI Viewer application.
  • As a development kit that can run your own custom applications or the sample applications provided with the nRF52 SDK. These include Bluetooth Low Energy, Bluetooth mesh, Thread, ZigBee, 802.15.4, ANT and 2.4GHz proprietary applications.

Keep in mind that the dongle does not have debug capabilities, but rather only supports programming or communicating via the USB port. Also, as of the time of this tutorial, the nRF Sniffer application does not support the nRF52840 dongle, but this is inevitable to change. When this feature becomes available, this low-cost dongle will serve as a great sniffer especially for capturing Bluetooth 5 BLE traffic including long-range mode (Coded PHY), high-speed mode (2M PHY), and extended advertisements packets.

In today’s blog post, we will cover how to use the dongle for running the Bluetooth Low Energy nRF Connect application as a central or a peripheral. In an upcoming post, we will go over how to use the dongle to run your own custom BLE application.

Energy

More info on the dongle can be found at the Nordic InfoCentral documentation website here: nRF52840 USB dongle.

If you’re interested in buying it, check out this page.

Download fronius port devices driver. Follow-up posts:

nRF Connect Bluetooth Low Energy application

The nRF Connect application on the desktop supports a few applications (with more being added continuously). It started out as a simple application but is now becoming the single hub for all desktop-based nRF applications. As of the writing of this tutorial, the applications included in the desktop nRF Connect app are:

  • Bluetooth Low Energy application
  • nRF Cloud Gateway application (experimental)
  • Power Profiler
  • Programmer (experimental)
  • RSSI Viewer

Today we will be focusing on using the Bluetooth Low Energy application.

The different applications that support the dongle will automatically prompt you to update the dongle with the appropriate firmware that allows the application to interface with the dongle.

The Bluetooth Low Energy supports two modes of operation:

  • As a BLE central device that can discover advertising devices (broadcasters and peripherals).
  • As a BLE peripheral that advertises, allows connections, and exposes a GATT server. The GATT can be customized with SIG-adopted services and characteristics or your own custom services and characteristics.

Installing the nRF Connect and Bluetooth Low Energy Applications

To get started, follow these steps:

  • Make sure you have the nRF52840 USB dongle connected to your computer
  • Install the nRF Connect desktop application from this link.
    The application is available for Linux, macOS, and Windows.
  • Once you have the application installed, launch the application. you will be presented with the following screen:
  • Navigate to the Add/remove apps tab

    Figure 2: nRF Connect Add/Remove apps

  • Make sure that the Bluetooth Low Energy application is installed. If not, click the Install button.
  • Make sure the application is up-to-date. Navigate to the Settings tab then click Check for updates now.
  • Navigate back to the Add/remove apps tab. If there’s an update available, click Update.
  • Navigate back to the Launch app tab, and launch the Bluetooth Low Energy application.

    Figure 4: Launch nRF Connect BLE app

  • If this is the first time you’re using this application, or if you’ve used the dongle with another app or programmed it with your own application, you will have to update the dongle with the appropriate firmware that enables it to run the Bluetooth Low Energy application. To do this, select the device from the Select serial port drop-down menu and you will be prompted to update the firmware on the device:

    Figure 5: nRF Connect select device from the serial port

  • Once it’s programmed correctly, you will see the following screen:

Now you’re ready to run interface with the dongle and use it as either a BLE central or as a BLE peripheral.

BLE Central Mode

Whether you’re testing a new feature of your BLE device or want to interact with an existing one, using an application that acts as a BLE central (aka central emulator apps) can help a lot.

It saves you from spending hours programming a custom application to perform your own testing. This is especially useful during the early phases of a project when the mobile companion app is not ready yet and may require a lot of effort to get it working.

There are two main aspects of acting as a central device:

  • Discovering advertising devices in the surrounding area.
  • Connecting to an advertising device (that allows connections). Usually, following a connection, the central will also interact with the peripheral’s GATT server (and vice versa) via reads, writes, notifications, and indications on characteristics.

Let’s cover each of these aspects and how to accomplish them using nRF Connect’s Bluetooth Low Energy application.

Scanning for BLE peripherals

To perform a scan for advertising BLE devices:

  • Start by clicking the Start scan button.

    Figure 7: nRF Connect Start Scan

  • I find it helpful to sort the list of scanned devices by RSSI.
    You could do this by clicking Options then Sort by signal strength.
  • To see more details about the advertising device, click the Details button. This will display the advertising data and any fields it contains.

    Figure 9: Advertising details

Devices

Connecting to BLE peripherals

After scanning for devices, you can connect to a device by clicking the Connect button next to a device in the scan results.
Once you’re connected to a peripheral, you can browse and navigate the different services and characteristics exposed by the GATT server on the device.

nRF Connect’s Bluetooth Low Energy app allows you to connect to multiple peripherals at the same time, and they will all be displayed in the same window:

You could also see the parameters and properties of the connection such as:

  • Connection interval
  • Slave latency
  • Supervision timeout
  • Bonding status
  • Pairing status

Figure 11: Connection information

Another feature available is the ability to change the properties of the connection (since the dongle acts in the central role, and hence it controls the parameters) such as:

  • Connection parameters
  • Initiating pairing
  • Disconnecting

Once you’re connected to a peripheral, you can now interact with the device’s GATT server. For example, you could read, write and enable/disable notifications and indications.

Reading characteristics

To read a characteristic, click on the characteristic of interest then click on the “reload” icon:

Figure 13: Read Characteristic

Now the new value (if any) will be updated.

Writing to characteristics

To write to a characteristic, select the characteristic of interest, then click on the text input box located under the properties (read, write, indicate, etc.). Then enter the value you wish to write, and press the checkmark button:

BLE Peripheral Mode

To set up the dongle to act as a peripheral, we first need to configure the different parameters and services and characteristics exposed by the GATT server. To do this, navigate to the Server Setup tab:

Figure 15: Server Setup

You’ll notice that the Generic Access service already exists since it’s a mandatory service. Within the service, you’ll find three characteristics defined:

  • Device Name
  • Appearance
  • Peripheral Preferred Connection Parameters

You can customize each of these characteristics by clicking on them.

You can also add services and characteristics of your own.

Once you’re done with the customizations, click the “Apply to device” button.

Port

Now you can go back to the Connection Map tab. Click the gear button next to the nRF5u dongle listing, then click on Start advertising.

Actebis 755cn3 driver download. Figure 17: Start Advertising

Once it starts advertising, a wireless icon will be displayed:

To verify the device is advertising and working properly, you can use a BLE client emulator app on a mobile phone such as Nordic nRF Connect or LightBlue Explorer.

Peripheral mode example

Let’s go ahead and set up the nRF52 USB dongle to include the Battery service and Battery Level characteristic, then connect and interact with it from a mobile app. For the mobile app I will be using LightBlue.

Here’s a video showing the whole process:

As you can see, with just a few quick steps we can set up a peripheral, discover it and connect to it from a mobile app. We can also see that changing the value of a characteristic on the device side (via the nRF Connect app on the PC) is reflected and can be seen on the mobile side.

Summary

In this tutorial, we introduced the nRF52840 USB dongle. We then talked about the two main use cases of the dongle: as a tool for nRF Connect apps or as a general nRF development kit. Today’s tutorial focused on using the dongle as an nRF Connect tool. IN an upcoming follow-up tutorial, we’ll cover the other use case: how to use the dongle as a general nRF development kit to run your own custom applications.

Don’t forget to enter your email below to stay up-to-date on the latest BLE news as well as be notified when new blog posts and tutorials get published.

Sign up to be notified when the next tutorial goes live. You’ll also receive a free BONUS report: Top BLE Developer Tools (PDF).


← The Ultimate Bluetooth Mesh Tutorial (Part 7)Prototyping BLE apps on the nRF52840 USB Dongle (Part A) →
-->

Device power states D1, D2, and D3 are the device low-power states. Starting with Windows 8, D3 is divided into two substates, D3hot and D3cold.

D1 and D2 are intermediate low-power states. Many classes of devices do not define these states. All devices must define D3hot.

The following sections describe D1, D2, and D3:

Device Power State D1

Device power state D1 is the highest-powered device low-power state. It has the following characteristics:

Power consumption
Consumption is less than in the D0 state but greater than or equal to that in the D2 state. Frequently, D1 is a clock-gated state in which the device receives just enough power to preserve the device's hardware context. Typically, the specification for a bus or device class that supports D1 describes this state in more detail.

Device context
In general, device context is preserved by the hardware and need not be restored by the driver. The specification for a bus or device class that supports D1 typically provides detailed requirements for preserving this context.

Device driver behavior
Home diagnostics driver download for windows 7. Drivers must save and restore or reinitialize any context lost by the hardware. Typically, however, devices lose little context upon entering this state.

Restore time
In general, the time required to restore the device to D0 from D1 should be less than restoration from D2 to D0.

Wake-up capability
A device in D1 might be able to request wake-up. To supply information about whether this state can support a wake signal, a bus driver uses the DEVICE_CAPABILITIES structure or, starting with Windows 8, the GUID_D3COLD_SUPPORT_INTERFACE driver interface.

Typically, devices that use D1 do so because resuming from this state does not require the driver to restore the device's full hardware context. To minimize the user's perception of delay, restoring a device to D0 from D1 should incur the least possible delay. Minimizing delay in the state transition is more important than reducing power consumption.

Device Power State D2

D2 is an intermediate device low-power state with the following characteristics:

Power consumption
Consumption is less than or equal to that in the D1 state.

Device context
In general, most device context is lost by the hardware. Frequently, this state preserves the part of the context that is used to signal wake events. The specification for a bus or device class that supports D2 typically provides detailed requirements for preserving this context.

Device driver behavior
Device drivers must save and restore or reinitialize any context lost by the hardware. A typical device loses most context when it enters D2.

Restore time
Restoring the device from D2 to D0 takes at least as long as restoring the device from D1 to D0. A graphics adapter that has a large frame buffer is an example of a device that has a large amount of hardware context to restore after a transition from D2 to D0. For such a device, the restore time from D2 might be much greater than the restore time from D1.

Wake-up capability
A device in D2 might be able to request wake-up. To supply information about whether this state can support a wake signal, a bus driver uses the DEVICE_CAPABILITIES structure or, starting with Windows 8, the GUID_D3COLD_SUPPORT_INTERFACE driver interface.

Typically, drivers that support D2 do so because their devices cannot support wake from D3. For these devices, power consumption in the D2 state drops to the lowest level from which the device can recover in response to a wake signal. In contrast to the D1 state, which is implemented to reduce the delay perceived by the user, the goal in implementing the D2 state is to conserve power. As a result, the restore time from D2 to D0 typically exceeds that from D1 to D0. In the D2 state, for example, reduced power on the bus might cause a device to turn off some of its functionality, thus requiring additional time to restart and restore the device.

Many classes of device do not define this state.

Device Power State D3

D3 is the lowest-powered device low-power state. All devices must support this state.

Starting with Windows 8, the operating system subdivides D3 into two separate and distinct substates, D3hot and D3cold. Earlier versions of Windows define the D3 state, but not the D3hot and D3cold substates. However, all versions of the PCI Bus Power Management Interface Specification define separate D3hot and D3cold substates, and versions 4 and later of the Advanced Configuration and Power Interface Specification define D3hot and D3cold substates.

Although versions of Windows before Windows 8 do not explicitly define the D3hot and D3cold substates of D3, these substates exist implicitly in these earlier versions of Windows. A device is implicitly in the D3hot substate if the device is explicitly in the D3 state, and the computer is in the S0 system power state. In D3hot, a device is connected to a power source (although the device might be configured to draw low current), and the presence of the device on the bus can be detected. A device is implicitly in the D3cold substate if it is explicitly in the D3 state, and the computer is in a low-power Sx state (a state other than S0). In this implicit D3cold substate, the device might receive a trickle current, but the device and the computer are effectively turned off until a wake event occurs.

Starting with Windows 8, a device can enter and leave the D3cold substate while the computer remains in the S0 state. To support this new behavior, D3hot and D3cold must be explicitly defined as distinct substates of D3.

D3hot is the only substate of D3 that the device can enter directly from D0. A device makes a transition from D0 to D3hot under software control by the device driver. In D3hot, the device can be detected on the bus that it connects to. The bus must remain in the D0 state while the device is in the D3hot substate. From D3hot, the device can either return to D0 or enter D3cold. D3cold can be entered only from D3hot.

D3cold is a substate of D3 in which the device is physically connected to the bus but the presence of the device on the bus cannot be detected (that is, until the device is turned on again). In D3cold, one or both of the following is true:

  • The bus that the device connects to is in a low-power state.
  • The device is in a low-power state in which the device does not respond when the bus driver tries to detect its presence on the bus.

The transition from D3hot to D3cold occurs with no device driver interaction. Instead, the device driver indicates whether it is prepared for a D3cold transition before it initiates the transition from D0 to D3hot. Subsequently, a transition from D3hot to D3cold may or may not occur, depending on whether all of the conditions are right to enable this transition.

Two such conditions are that all of the devices that use the same power source are in D3hot and are prepared for a D3cold transition. When the last of these devices enters D3hot, the parent bus driver or ACPI filter driver turns off the power source to these devices, which is to say that the devices enter D3cold.

The Energy Conservatory Port Devices Driver

A device that is in D3cold can leave this substate only by entering D0. There is no direct transition from D3cold to D3hot.

When the computer is in the S0 state and a device enters the D3hot substate, the device driver is typically unable to determine in advance whether the device's next transition will be to D3cold or D0. The one exception is when the computer is preparing to leave the S0 state. In this case, the next transition is to D3cold.

The following sections describe D3hot and D3cold:

For more information, see Supporting D3cold in a Driver.

D3hot substate

D3hot has the following characteristics:

Power consumption
Power is mostly removed from the device, but not from the computer as a whole. The computer, which is in the S0 state, might continue running in this state, or it might be preparing to move from S0 to a low-power Sx state.

Device context
The device driver is solely responsible for restoring device context. The driver must preserve and then restore all device context or must reinitialize the device upon transition to the D0 state.

Device driver behavior
The device driver is solely responsible for restoring device context, typically from the most recent working configuration.

The Energy Conservatory Port Devices Drivers

Restore time
Total restore time is the highest of any of the device power states, except for D3cold, but is typically not much greater than the restore time from D2.

Wake-up capability
A device in the D3hot substate may or may not be able to request wake-up. To supply information about whether this substate can support a wake signal, a bus driver uses the DEVICE_CAPABILITIES structure or, starting with Windows 8, the GUID_D3COLD_SUPPORT_INTERFACE driver interface.

In D3hot, only minimal trickle current is available. Drivers and hardware must be prepared for the absence of power. The specification for a bus that supports D3hot typically provides detailed requirements for power sources that can be used in this state. To return the device to the working state, the device's drivers must be able to restore and reinitialize the device without depending on the BIOS to run any code in the option ROM that might be available for the device.

The parent bus driver will not remove system power from the parent bus of any device that enters D3hot unless the computer as a whole transitions to the S0 state.

All classes of device define the D3hot substate.

D3cold substate

D3cold has the following characteristics:

Power consumption
Power has been fully removed from the device and possibly from the entire system. The device may be able to draw current from side-band sources, depending on its construction.

Device context
The device driver is solely responsible for restoring device context. The driver must preserve and then restore device context or must reinitialize the device upon transition to the D0 state.

Device driver behavior
The device driver is solely responsible for restoring device context, typically from the most recent working configuration.

Restore time
Total restore time is the highest of any of the device power states.

Wake-up capability
In the D3cold substate, a device might be able to trigger a wake signal to wake a sleeping computer. This capability is reported in the DEVICE_CAPABILITIES structure and, starting with Windows 8, by the GetIdleWakeInfo routine in the GUID_D3COLD_SUPPORT_INTERFACE driver interface. After the signal wakes the computer, the device driver initiates the device's transition from D3cold to D0. For more information, see the following remarks.

Starting with Windows 8, a device in the D3cold substate might be able to trigger a wake signal to a computer that is in the S0 system power state. This capability is reported by the GetIdleWakeInfo routine. The DEVICE_CAPABILITIES structure does not contain information about this capability. After the wake signal arrives, the device driver initiates the device's transition from D3cold to D0. In this case, the computer is awake when the signal arrives, and only the device needs to wake.

In many existing hardware platforms, a device that is in a low-power Dx state can trigger a wake signal to wake a sleeping computer. However, the same device might not be able to trigger a wake signal if the computer is running in the S0 state. Thus, the driver for this device must not initiate the device's transition from D0 to a low-power Dx state when the computer is in the S0 state. Otherwise, after the device leaves D0, it will be unavailable until the computer leaves the S0 state. This device should leave the D0 state only when the computer is preparing to leave the S0 state.

If a device that is in a low-power Dx state can trigger a wake signal to a computer that is running in the S0 state, the device is not required to remain in D0 when the computer is in S0. If the computer is in S0, and the device is in D0 but is idle, the driver can arm the device to trigger a wake signal, and then initiate the device's transition from D0 to this low-power Dx state.

Some classes of device define the D3cold substate.

For more information, see Supporting D3cold in a Driver.