Decoder

DCCWiki, a community DCC encyclopedia.

Decoders receive commands from throttles or other devices and are responsible for controlling the motor and/or performing certain functions around a layout.

Types Of Decoders

Mobile decoder installed on chassis for testing

Decoder manufactures can be grouped into two main categories: Mobile and Stationary.

MultiFunction Decoder

This is the correct term for an NMRA DCC mobile decoder.

Multifunction Decoder

Main article: Mobile Decoder

Multifunction decoders are installed into locomotives or other rolling stock that moves along the rails. This allows control of motors, lights, sound, and other functions. Installation may occur at the factory during manufacturing. It may be installed by a third party, such as a hobby shop. It is also possible to install them yourself.

Sound Decoder

Another form of multifunction decoder, which in addition to motor control, has sound capabilities. The sounds are tied to the motor operation, allowing for realistic effects such as the prime mover loading up, or the beat of a steam locomotive's exhaust. Other effects include dynamic brakes, rod clank, steam cocks opening, and in the case of internal combustion, starting or shut down of the prime mover.

Some sound decoders are designed for use in rolling stock, which lack a motor. These decoders only provide ambient sounds related to that car, such as cattle in a stock car, or the engine noise of the mechanical refrigerator system in a reefer car.

Accessory Decoder

This decoder sub-type provides lighting effects in passenger cars and cabooses. Marker lights can also be included. The decoder will allow some customization and the ability to turn effects on and off.

Stationary Decoders

NCE Stationary Decoder - this one is for switches
Main article: Stationary Decoder

Stationary decoders are normally mounted under the benchwork in a "stationary" position. Stationary decoders can be used to control railway switches, structure lights, scene lighting, animation, and signaling. Many have multiple outputs, allowing devices nearby to be controlled from one stationary decoder.

What Conditions Cause Decoder Failures?

The motor has the negative tab soldered to the motor frame, which completes the electrical circuit with the locomotive frame.
  1. ESD can damage a decoder prior to, or during installation
  2. Soldering using an acid flux
  3. A Soldering iron which is not ESD Safe
  4. Overvoltage on input (from track)
  5. Failure to isolate the motor from the frame.
  6. Current draw exceeds decoder ratings (wiring short or other overload condition): Be careful when first testing a multifunction decoder installation. Put the locomotive on a test track (programming track or section with a 100-ohm series resistor) instead of the main line for testing. If all functions work, and it can move (assuming motor output drive from decoder) at low speed steps, then you should be relatively safe to place it on the main. As always, follow the manufacturer's instructions for testing in addition to the above.
  7. Overheating: Imagine running a black loco in direct sunlight and hauling a heavy load at nearly the limit of the current output of the decoder. Now imagine the decoder only having current limits, and not thermal limits built in. The scenario can also happen if the decoder is installed in an area with little air space.
  8. Incorrect wiring. It is very important that you check that the motor brushes are not connected to the frame. They must be isolated. Any power source other than the decoder's outputs is a recipe for failure.

What Causes a Decoder to Reset

Decoders are small, task specific computers. Whenever they power up, they run through an initialization process.

Two situations can occur that produce an unexpected result.

Upon powering up, after the microcontroller has initialized, the validity of the decoder’s alterable parameters stored in NV-RAM (Non-Volitile Random Access Memory) is verified by performing a checksum and comparing that to a previously calculated value. If the two values don’t match, the decoder’s operating system decides that the memory has been corrupted and resets those parameters to the factory defaults.

Anytime you alter a CV, the checksum is recalculated and the result is stored in the NV-RAM.

A short circuit can also cause the memory to be scrambled, so when the checksum is done, it results in a fail and the decoder software initiates a reset to factory defaults. Should the previously calculated checksum be corrupted, the same results will occur.

This process is done without warning or user intervention. The checksum only indicates a pass or fail. The decoder cannot determine where the problem(s) are. The only solution is to clear the memory and reset its values to the factory default.

Many decoders require a power interruption to restore the decoder to factory settings when a reset is purposely initiated.

Memory Types

The decoder has two types of memory: The firmware, which is the operating system software for the decoder, and the factory default values, are usually stored in memory that is non-volatile, or permanent. It can be part of the microcontroller’s die, or a separate intergrated circuit. The user values, such as configuration variables are stored in memory that while being non-volitile, can be altered. This alterable memory can be part of the microprocessor die, or a separate IC.

There are many types of memory. The most well known is RAM, or random access memory, which will lose its contents when power is removed. Another form is ROM, or read only memory, which is not affected by power loss. It is programmed at the time of manufacture.

A familiar type of memory is NV-RAM, or Non Volatile RAM. Well known examples would be Compact Flash, SD, or Memory Sticks used for cameras, which do not lose their contents when power is removed. (Note: Eventually they will lose their contents, so don’t rely on them for long term storage. They depend on little capacitors, which eventually lose their charge.)

For this reason, storing a copy of the decoder programming is a good idea. DecoderPro can read the memory and store the contents on your computer, and you can reload them anytime. If you spend a lot of time tweaking, this will save you much grief.

What causes Memory Corruption?

  • One of the most common causes is bad power. If the track voltage is not stable during initialization, this can cause the checksum routine to return an incorrect value, which doesn’t match the stored value.
  • If the layout experiences a short during this routine, and power is interrupted, that can be enough to force a reset.
  • The same can be caused if the locomotive itself is the cause of the short. Power cycling can do interesting things to memory contents.

Should power be interrupted while the locomotive is in operation on a section of track with low voltage or signal quality issues, it can either corrupt the memory, or interfere with the initialization of the decoder causing an error, with the result being a reset to factory defaults.

Reducing the Chances of a Decoder Reset

Good trackwork, proper wiring following the recommended best practices, proper power management and eliminating the cause of shorts goes a long way to prevent random decoder resets from occurring.

Runaway Locomotives

After a successful startup (or a restart), the decoder checks to see if there are digital or analog voltages on the track. If it sees a digital packet, it switches to a digital mode. The NMRA DCC standard defines a number of modes available, under the term “power conversion”. Most decoders only support two modes, DCC and Analog.

If the mode setting in CV29 allows for dual mode (DCC and analog), the decoder will switch from DCC mode to analog. This can happen with a noisy or distorted digital signal, as the decoder cannot determine it is DCC, so it switches to analog.

The Mode Control CV #29 uses bit #2 to indicate if an Alternate Power Source is permitted. If that bit is set to "1", the software will look at CV12, Power Conversion for the mode to use. If CV12 has a decimal value of "1", Analog operation is enabled. In this case the full track power is passed directly to the motor when the decoder switches to Analog mode.

Warning: Setting the Primary Address in CV1 to "0" when CV12 = "1" overrides the Alternate Power Source bit in CV29. A runaway will immediately occur when track power is turned on.

Another cause is intermittent power or a short that is cleared quickly. If the decoder doesn’t have enough of a power interruption to force a restart, it may interpret the signals present as a non-DCC signal. All it needs is a distorted or poor power quality signal to do this, and that is often present for a short time after the circuit protector has reconnected the track to the power source.

When this happens the locomotive can run away. There is no control, as it sees full track voltage and since it is in analog mode, that means full throttle ahead. For this reason many modellers will set the decoder to “NMRA Digital Only”. Thus the decoder will only respond to a proper DCC digital packet. It also will not respond to analog Direct Current voltages when placed on the track of a non-DCC layout.

Booster Issues

A defective or poorly designed booster may be the cause of a runaway. Although rare, it can happen with older boosters.

Some boosters manufactured many years ago had a design fault. When track power is disconnected, a booster is supposed to shut off the track output. There should be no voltage going to the track. The design of the booster prevented this, and the outputs latched at whatever state they were in when track power was cut. The result was an analog voltage on the track, which the decoder would interpret as "switch to Analog Mode" and the locomotive would launch into motion at full speed.

A defective booster with voltages present on the outputs with the track power shut off may also cause this issue. So checking the output of a booster may also narrow down the cause of a runaway.

How to Avoid a Runaway Locomotive

Good trackwork, proper wiring following the recommended best practices, proper power management and eliminating the cause of shorts goes a long way to prevent runaways from occurring.

A runaway is scary, and the only way to stop it is a total shutdown of track power.

Also read the section on Compatibility Issues for technical details on decoder addressing to avoid a runaway.

Decoder Troubleshooting

My DCC Decoder Equipped Locomotive will not Work on a Direct Current (Analog) Layout

If that occurs, the power conversion mode has been set to NMRA Digital Only, so the decoder, while powered up and active, will not apply power to the motor or respond to any changes in throttle settings.

The solution is to change CV29 so it can operate on an analog layout.

This can only be done using a DCC system, so planning is required before moving the locomotive to an analog layout. Many modellers disable the Alternate Power Source setting in CV29 by setting it to "NMRA Digital Only." This is done to prevent runaways.

Decoder Will Not Respond

New DCC Equipped Locomotive

The default address is 3

Enter the address as 3. Using numbers such as 03, 003, and 0003 will not work.

Decoder Has Sound, Will Not Move

Many sound equipped decoders include various shutdown/startup routines, as well as Idle.

Part of a Consist

If the locomotive is part of a consist it may not respond to its address.

  1. Place the locomotive on the programming track and read CV19. It should be Zero. Any other number indicates it is part of a consist. Reset CV19 to 0 to correct this.
  2. Delete the consist from your command station
Idle or Neutral

For example, the locomotive has prime mover sound, but will not respond to throttle commands.

The decoder is in IDLE or NEUTRAL. Consult the manual to see how to change that, as many decoders are different.

  • QSI: Press F9 twice, (within two seconds), then press F6 to initiate startup mode.
    • Some QSI decoders come out of idle when F3 or F6 is pressed twice.

Many Atlas and BLI products came equipped with QSI decoders. Some brass importers may have used them as well.

See Also

External Links

From the Australian NMRA site:

These refer to JMRI.

Tuning Decoders with Decoder Pro

Setting the Brake Function

Speed Matching a Diesel Tsunami Decoder