From just
£79

Digital Command Control (DCC) protocol decoding

Introduction

DCC (Digital Command Control) is a standard defined by the National Model Railroad Association (NMRA) DCC Working Group and is a standard for manufacturers to allow the independent control of multiple locomotives and accessories on a train set.

This approach overcomes the limitation of controlling multiple locomotives on the same track where, traditionally, voltage on track was used to control the speed and direction of a train.

The Digital Command Station sends DCC NMRA signals in a differential digital form, by periodically reversing the 15 V DC power supply to the track.

A Hornby Somerset Belle Train Set, which is supplied with a Hornby DCC Select Controller, was used as the source of DCC signals. The Select Controller sends the combined power and data through the Track to Controller Link Wire (actually a pair of wires) to the rails, and thus also sends information signals for the locomotive and accessories connected to the track.

The locomotive contains a DCC Decoder which has a unique address and decodes instructions sent to it. The Select Controller uses the Programming Track method to program decoders, and only instructions from packets with the matching address will be actioned by the decoder. Accessory decoders may also be connected to the track to control components such as motors to change the points.

The NMRA Communications Standards for Digital Command Control (S-9.2) states that the information sent by Digital Command Stations consists of a sequence of bits (called a packet) which is used to encode one of a set of instructions that the Digital Decoder will operate upon. The packets must be precisely defined to ensure the proper encoding and decoding of instructions.

An example of an acceptable command control packet consists of three data bytes which is preceded by a preamble and a start bit as shown in the table below:

Portion

Number of bits

Description

Example DCC packet structure

Preamble

Typically 12

Indicates start of a packet, with all bits set to ‘1’.

Packet Start Bit

1

First bit with value ‘0’ that follows a valid preamble. Terminates preamble and indicates next bits are an address byte.

Address Data Byte

8

Eight bits of address information; used to indicate the address of the decoder that the packet is intended for.

Data Byte Start Bit

1

Precedes a data byte and has a value of ‘0’.

Instruction Data Byte

8

Data byte used to transmit commands to decoders.

Data Byte Start Bit

1

Precedes a data byte and has a value of ‘0’.

Error Detection Data Byte

8

Indicates that the packet is complete and can also be used to verify the validity of the packet.

Packet End Bit

1

Marks the termination of the packet – has a value of ‘1’.

Baseline packets are included in the S9.2 standard to ensure minimum operability between different systems. This packet format can used for simple instructions such as speed and direction for locomotives.

An Extended Packet Format is defined in the S-9.2.1 standard for support of different types of decoders, additional functions, addresses and speeds, and consists of a packet whose length is between 3 and 6 data bytes, each separated by a '0' bit.

Decoding with PicoScope 6

1. The first step is to acquire the DCC signal of interest using PicoScope. Here the signals have been captured from the Somerset Belle Digital Train Set using a PicoScope 5444B set to 12-bit resolution. We used a x10 oscilloscope probe, so the voltage range selected was ±50 V, in conjunction with a timebase of 5 ms/div.

2. Next, select Serial Decoding from the Tools menu.

PicoScope 6 Serial Protocol Decoder selection

3. Click Create and select DCC from the list of available protocols.

PicoScope 6 DCC protocol decoder configuration dialog

4. In the DCC configuration dialog select the PicoScope Data input channel and set the Threshold as required. Set a Display Name and ensure that the packets will be displayed in the Graph and Table. Ensure that the data values are displayed as Binary in the Table, then click OK.

5. Click OK to see the decoded DCC messages in the PicoScope graph display and table.

Example PicoScope 6 Link file for DCC protocol

A link file can be used to map the values to text strings enabling you to identify the train(s) that the packets were intended for and the instruction.

The image below shows a packet that was sent to the Somerset Belle train with an instruction for direction and speed. The table shows the values that have been mapped where possible using the contents of the link file.

PicoScope 6 display with DCC Protocol Decoder applied

Acknowledgement

Pico Technology would like to thank Hornby for provision of the Somerset Belle Digital Train Set featured in this article.

Testimonials

The kit (2408B) is of obvious quality, easy to setup and calibrate and the free to download software has a reasonable learning curve. Superb kit, superb support, what more can I say.

Rop Honnor

I have been using my 4224 PicoScope for years. I travel abroad so this has been ideal due to its physical size. Storage of waveforms on my Laptop is very easy allowing me to quickly email waveforms to my Colleagues.

Andrew

Not many USB scopes works on Win & Mac & Linux too, so that proves me that guys from Pico really cares about us, customers. This made my decision much easier when I was looking to buy an USB scope.

Raul Trifan

We have been using Picoscope 6404D for quite some time, and are amazed by its accuracy and powerful emulations while working with numerous signal evaluations.

J Mohanty

PicoLog TC-08: This is a very nice unit that works consistently and reliably.

Jeff Hulett

It is a great scope. I had a weird problem - it did not work on one of my PC’s. Customer service gave me first class service. If I could give 6 stars for customer service - I would do so.

Niels Larsen

Perfect Partner for Development of Encoder controlled Stepper Motor Actuators. Since the included software is really stable, this type of device is a great tool for great tasks!

Helmut Schoettner

A superb piece of equipment worth its weight in gold

Nigel Clinch

So simple to use & beats any other I have ever used hands down.

John D Samsing

Great functionality in a compact size. I really like moving the mouse pointer to a position and having the Time and Voltage display the values at that point. Calibration equipment is a breeze with that feature.