When to Use a Single-Wire Interface for Encoding Data
The cool thing about all those smart devices in your home, office, and automobile is that they can all talk to each other through a variety of interfaces, some of which are very simple. At the consumer level, it's usually Bluetooth or a standard cable option like USB. In embedded systems or at the industrial level, a variety of interfaces are used to send data between products. Many times these are multi-wire interfaces like SPI, CAN, Ethernet, or a parallel bus protocol. For very simple interfaces and very simple encoded messages, there are easier options that can be implemented.
Single wire interfaces are probably the easiest interface you will ever implement, both in hardware and in the firmware/software. A single wire interface is just like its name suggests: it uses one wire for data transmission, typically mono-directionally. If you want to use a single wire interface in your system, here are some of the areas where they can be used and how to implement a specialty interface in firmware.
Single Wire Interface Structure and Usage
As was mentioned above, a single wire interface just uses one wire for data transmission between components. In reality, there is a second conductor, which is the ground reference for the interface. On a PCB, this can just be a ground plane, or if you are operating at low frequencies where returned currents are challenging, you could run the ground trace right alongside the signal trace.
If you think about it, there really is no standardized single wire interface. If you take half of a UART interface for example, one of those wires transmitting in one direction is effectively a single wire interface. The same idea applies with I2C if the clock line is not used. There are some simple ways to implement single wire interfaces, even with standardized interfaces. Two simple methods include:
|
|
|
|
Single wire interfaces are intended to transmit small chunks of data, they are not meant to be used at high data rates. These can be small data bursts that signify the presence of a component in a larger system, and the data can be captured by a GPIO on a microcontroller. The data does not need to be in a standardized format as you would see in some interfaces, it could simply use custom encoding or a specific sequence of bits.
Given these characteristics of a simple single wire interface, here is how they can be used effectively.
Data Over Flying Leads
Probably the most common case where a single wire interface is used is over a flying lead. This would be a single wire connected to a pin header or a plated through hole on a PCB, and that would then be connected to the source of the interface. This is a simple and convenient way to connect a microcontroller board to an evaluation module or another development board. It is probably also the most common way that connections will be made between popular microcontroller platforms (Arduino or ESP32) and other components or instruments via GPIOs.
Custom Logic Via GPIOs
Another common instance of single wire interface usage is with custom logic, such as you might implement in an FPGA or as an application in a microcontroller. Custom logic can demand sending a specific bit stream with specific timing, and this can be done over a GPIO. If the edge rate of the signals is slow enough, it will have no problem traversing a single wire interface.
Here, the edge rate is what matters, especially if transmitted over a flying lead. Typically, if implemented on a PCB, the wire will be placed as a trace above or near ground. If the signal has a fast edge rate (such as nanoseconds or less), then it should not be placed over a flying lead. If the signal has a slow edge rate (such as multiple microseconds seen in I2C), it can usually be placed over a flying lead without excessive radiation.
Measuring Single Wire Interfaces
Signals being sent over a single wire interface can be measured just like any other signal: with an oscilloscope. It is also helpful to measure with a near field probe when the edge rates are faster, just to confirm there is not excess noise.
Because single wire interfaces are generally slow, the signal on the rising and falling edges will appear as coming from a fast discharging capacitor. You typically won't have spiking or ringing due to excess inductance, even though the inductance of the wire is non-negligible.
Flying leads are mostly the domain of hobbyists. A product that is using a single wire interface will be much more compact, and a ground reference will naturally be somewhere close to the single wire. It's best to take this approach even inside an enclosure between two boards, when a wire might be needed between two headers on the different boards. In this case design the pinout so that there is ground being routed across the gap along the signal wire as this gives better results from an EMC perspective.
Whenever you want to build circuits that can be toggled with a single-wire interface, make sure you simulate your designs with the complete set of tools in PSpice from Cadence. PSpice users can access a powerful SPICE simulator as well as specialty design capabilities like model creation, graphing and analysis tools, and much more.
Subscribe to our newsletter for the latest updates. If you’re looking to learn more about how Cadence has the solution for you, talk to our team of experts.