Introduction
The Digital Addressable Lighting Interface (DALI) is a protocol described in the technical standard IEC 62386 for digital control of building lighting systems. The interface is a simple two-wire affair with a maximum system size of 64 addresses. DALI stands separate from building-automation bus architectures but can be tied into those structures to pass along data regarding the status and condition of the lighting system. Many standard interfaces, including DALI, are based on the fundamental building blocks of the Manchester or NRZ line-encoding schemes. The following is a brief tutorial in using Teledyne LeCroy’s Manchester software to decode DALI signals with its digital oscilloscopes.
About the DALI Physical and Data Link Layers
Before examining the decoding of the specific signal used for this document, it may be instructive to cover some of the basic information regarding the DALI technical specification. More information on DALI is available at: dali-ag.org. Additionally, the DALI-interface has been described in the fluorescent lamp ballast standard IEC 60929 under Annex E.
At the physical layer, DALI uses an effective data transfer rate of 1.2 kb/s, enabling interference-free system operation. The physical low-level has been defined with the interface voltage at 0 V (-4.5 V to 4.5 Volt) on the receiver’s side. The high-level condition is represented by the interface voltage of 16 V (9.5 V to 22.5 V) on the receiving side. A maximum voltage drop of 2 V between sender and receiver is admissible on the leads of the interface.
There are two types of data frames in the DALI interface: forward frames and backward frames. Forward frames consist of 19 bits with timing as shown in Figure 1:
- 1 start bit: (logical ‘1’, bi-phase code)
- 1 address byte ‘YAAA AAAS’: (bi-phase code)
- 1 data byte ‘XXXX XXXX’: (bi-phase code)
- 2 stop bits: (idle line)
Additionally, the least significant bit of the address byte (selector bit ‘S’) indicates whether the data byte contains a direct arc power level or a command:
S = "0": data byte = direct arc power level
S = "1": data byte = command
A forward frame must have duration in time of 38 Te, with Te, the duration in time of 1 bit at 1.2 kb/s being 416.67 μs.
Backward frames are sent only after the reception of a query command or a write memory command. A backward frame consists of 11 bits with timing shown in Figure 2:
- 1 start bit: (logical ‘1’, bi-phase code)
- 1 data byte ‘XXXX XXXX’: (bi-phase code)
- 2 stop bits: (idle line)
Depending on the command, the backward frame (= answer) shall be either a ‘Yes’ / ‘No’ or 8-bit information:
- ‘Yes’: 1111 1111
- ‘No’: The control gear shall not react (idle line)
- 8-bit information: XXXX XXXX
A backward frame must have duration of 22 Te.
Embarking on a Decode
Start by acquiring a signal. For purposes of this document, the signal being examined is a 1.2-kb/s DALI forward frame signal consisting of two start bits (skipped), a 6-bit address (the Y and S bits shown in Figure 1 are omitted), and one data bit as shown in Figure 3.
Once the signal is acquired and suitably displayed on the oscilloscope screen, use the Analysis drop-down menu at the top of the screen to access the Serial Decode dialog box, as shown in Figure 4.
Pressing the Protocol button in the Decode 1 row brings up a popup menu of different protocols (what appears in the menu is determined by which serial-decode software options are installed in the oscilloscope). The decode options appear in Figure 5:
Select Manchester in the Protocol popup menu. Next, designate the source of the on-screen trace. In this case, the trace is stored in Memory 1 or M1. Although a memory trace is used in this example, the decoder works on all channels and math, memory, and zoom traces. In the Serial Decode dialog box, assign the on-screen trace to Decode 1 by turning Decode 1 on. Then press the Setup button for Decode 1, which opens the Decode Setup tab in the dialog box.
The Three Tabs: Basic, Decode, and Levels
Upon entering the Decode Setup tab, note its layout as shown in Figure 6:
Be sure to check the View Decode box. Note that Source 1 (Data) is set to M1 and the Protocol to Manchester. The Basic tab will be open on the right by default. Try switching between the Basic, Decode, and Levels tabs. Then return to the Basic tab for the next section of the tutorial.
The Basic Tab
The Basic tab, shown at right in Figure 4, provides all of the fundamental controls required to allow proper bitlevel decoding. The configurable Manchester decoder supports a wide range of bit rates. Input the appropriate Bit Rate using the Bit Rate parameter in the Physical Layer portion of the Basic tab. The DALI physical specification dictates a fixed data transmission rate of 1.2 kb/s.
The Timeout Definition for the gap between bursts comprises two parameters, Units and # Bits. The former can be set to either Bits or Seconds. If Bits is chosen, the range is from 1 to 100. If Seconds is used, the range is from 1 to 99.99 μs. The DALI specification dictates that for transmission of consecutive forward frames, the elapsed time between the end of the last stop bit and the beginning of the first start bit in the next forward frame must be at least 22 Te.
The Idle State, which complements the Timeout Definition parameters, may be set to either IdleHigh, IdleLow, or Don’t Care. Setting the Idle State helps to precisely define the separation gap between data bursts. In the case of DALI, the idle state is set to IdleHigh.
The Polarity may be set to either Falling = 0 or Falling = 1. This determines whether an edge falling through the threshold level is decoded as a logical 0 or a logical 1, respectively. The DALI specification dictates that an edge rising through the threshold is decoded as a logical 1. Thus, for this example, Polarity is set at Falling = 0.
The next section of this tutorial will cover the Decode tab. But to ensure that the bit-level decode is correct, zoom in on a portion of the decoded signal by drawing a rectangle around it on the screen with the stylus. This opens a zoomed view of that portion as shown in the lower portion of the screen capture in Figure 7.
On the Decode tab, set the Data Mode to Bits. Note that in the zoomed view Z1, which corresponds to the highlighted portion in the center of M1, each binary 1 is represented by a negative half-bit period pulse followed by a positive half-bit period pulse. Similarly, a binary 0 is represented by a positive half-bit period pulse followed by a negative half-bit period pulse. This type of signaling is also called split–phase encoding. In this case, Polarity is set to physical Falling = 0.
Tap the Z1 annotation box and uncheck Trace On at the upper left. Close the Zoom dialog and reopen the Decode Setup dialog by tapping the Manchester data table. On the Decode tab, set Data Mode back to Words.
The Decode Tab
The next series of steps will cover the Decode tab, where decode at the word level is set up. First, note that when the Data Mode is switched to Bits, all of the word-level parameters on the tab are greyed out. Switching the Data Mode back to Words makes them all active as shown in Figure 8.
The First Transition Used (FTU) parameter accounts for items that may precede the actual data payload. These might include such elements as a preamble or a synchronization sequence. The default setting for FTU is zero; it can range in increments of one to a maximum of 400.
The Bit Stretch Tolerance parameter comes into play when transitions often occur at mid-bit. Due to hardware or signal-propagation issues, these mid-bits may not be perfectly equidistant. This parameter is adjusted to better decode jittery signals. After setting the Bit Rate on the Basic tab, the Bit Stretch Tolerance may require adjustment from its default setting of 20% to achieve stable decoding.
At the bottom of the Decode tab is a number of parameters for Grouping of Bits into Words. Figure 9 shows the DALI signal grouped into words.
The first step in the process is to ensure that the Data Mode is set to Words.
Within the Manchester decode software are tools and capabilities to group bits into Sync Bits, PrePad, Data Bits, and PostPad. Again, the DALI forward frame signal consists of one start bit, one address byte, one data byte, and two stop bits (idle line).
PrePad bits in a DALI frame would include the start bits and address. In Figure 9, they are the portions of the bit stream seen with a purple overlay. With the start bits skipped in this example, the PrePad bits are the six address bits in this example. As noted above, the Y and S bits shown in Figure 1 are omitted.
The Manchester decoder can parse from 1 to 32 Data bits. The DALI specification calls for one data byte. The trace used for this document uses a single Data bit for the Selector bit as seen in Figure 1. The selector bit is set at a logical one, indicating that the data payload will contain a command. The Data Bits appear with a blue overlay.
Typically, PostPad bits numbering from zero to 32 serve to group information following the data bits. PostPad bits can represent a CRC, a checksum, or other protocol constructs. In the example shown in this document, the PostPad bits are used for the actual data payload of the frame. Within the data is the value 145, which in the DALI protocol represents a command to Query Control Gear. Because they are idle-line bits, the Stop bits indicated in Figure 1 are omitted. PostPad bits appear with a yellow overlay.
The Level Tab
The last of the three tabs in the Decode Setup dialog box is the Level tab, shown in Figure 10.
Levels can be set using either percentage or absolute voltage values as determined by the Level Type setting. The Level setting itself determines the threshold that transitions must cross to be counted as transitions. The default value is 50% or 1.5 V for percentage and absolute level types, respectively.
Hysteresis settings are used to account for noisy signals with spikes that may create false transitions if they cross the Level threshold. It appears as a blue-shaded band centered vertically on the Level setting. The default Hysteresis value is 15%, but it may be varied from zero to 50%.
Conclusion
Teledyne LeCroy’s configurable Manchester decoder is an extremely capable tool, enabling users to explore the intricacies of DALI signals as well as others encoded with the Manchester scheme. Armed with a bit of foreknowledge of the signal under test, users may exploit the decoder’s nearly unlimited flexibility with respect to signal parameters to cleanly decode and display signals and extract data relative to their physical characteristics.