|
|
How DCC Works |
|
|
|
Home | Products | Distributors | Documentation & Support | DCC | CV Calculators | Links |
|
|
Making Your Own DCC Components
|
This page provides technical information about how DCC systems work. It is not necessary to understand this to use DCC - it is provided for information to those that are interested only! DCC Packets on the RailsDCC is a digital control system. It operates by encoding messages as a sequence of 1 and 0 bits onto the two rails. remote decoders can then decode those messages and decide what action to take. Bit EncodingDCC packets are encoded by modulating the two rails A and B to one of two voltages: VL & VH. VL is nominally 0v and VH is usually between 12v & 14v. The rails are modulated such that if rail A is at VH, rail B is at VL and so on. 1 and 0 bits are encoded by varying the timing of the transitons. This ensures that:
Individual bits are encoded by a pair of signal levels as shown. A logic 1 is encoded if two consecutive levels are present with a period of nominally 58us. A logic 0 is encoded if two consecutive levels are present with a period of nominally 100us. There is a minor complication caused by support for DC locomotives without a decoder. To allow a single DC locomotive to be run, it needs to be possible to give the signal an "average" DC value. This is done by stretching one of the two halves of a "0" bit. This period can become up to 9.9ms. Packet Encoding
Message DecodingThe whole decoding process is normally carried out by a microcontroller. Its software is typically written in assembler or in "C" and looks at the DCC rail inputs to decoder individual bits, then forming them into packets. For a typical "PIC" series microcontroller this will take much of its time. Some microcontrollers are significantly faster - for example the Atmel AVR series - and can perform this as a background, interrupt driven task. Bit DecodingTypically individual bits are decoded by looking at one rail only and looking at the periods when the signal is above a threshold or below a threshold. Note that there is no guarantee that the bits will arrive with the 1st half of the bit being above threshold (as drawn for rail A): if the decoder was in a locomotive, and it is removed and put back on the rails the other way round, it will now see rails A and B swapped over. Instead, the decoding software will need to synchronise so that it is seeing Packet DecodingMobile DecodersAccessory DecodersDCC System ArchitectureCommand Bus InterfacesThe two common command buses are XpressNET and LocoNet. These are both based on asynchronous serial communication and can be interfaced using a UART. |
|
©CML Electronics Limited 2008 |