Keep DCCWiki free of advertisements, contribute today.

Digital packet

From DCCWiki, a community DCC encyclopedia. Please contribute today to keep it free.

Jump to: navigation, search

A packet is a bundle of data sent over the wires and rails in the case of model railroading. The concept is similar to sending a message via email or a web page request and response on the WWW. In model railroading DCC, packets are made up of several "words", and most words are one or two bytes long. A byte is 8 bits, such as 10010110.

[edit] Structure of a digital packet

The most common DCC packet consists of a preamble, a message, and a postamble. The most common packets are four-word bundles. Words are made up of ONEs and ZEROs, as in any digital computer system.

  1. Preamble -- Tells decoders a packet is about to start.
  2. Address -- tells the Decoders which of them this data is meant for.
  3. Instruction -- typically tells the addressed decoder the speed and direction of its locomotive.
  4. Postamble/Error Detect -- since DCC is just like a computer network operating in a very noisy environment, it is necessary to be able to detect errors in the data, should they occur.

The Preamble is merely a string of several "ONE" bits as specified in the NMRA DCC standard, which tells every device listening on the rails that a new packet is starting.

The Address alerts the device the message is intended for, usually a decoder. It also tells all other devices to ignore this packet.

The Instruction or Command tells the device to set a function (light, bell, whistle, horn, coupler, etc.) on or off, to change to a specified speed step, to reverse direction, to emergency stop, etc.

The Postamble indicates the packet is complete. A Postamble is used because packets vary in length. It also allows the decoders to check the validity of the packet. If the packet is corrupted, a decoder looking at the Postamble would find the checksum included in the Postamble is wrong. It would ignore the packet and wait for an uncorrupted one to arrive. (This is one reason why the command stations keep repeating the packets over time.) A corrupted packet most commonly would occur if dirty wheels or track prevented the whole packet from being read properly.

[edit] Data Rate

DCC packets are transmitted at the rate of approximately 8000 bits per second.

[edit] Specifics

Until this page is further developed by the community, please see this site for diagrams and other information for further details about sending data from the command station to the decoder

Personal tools