Decoders receive commands from throttles or other devices and are responsible for controlling the vehicles and/or performing certain functions around a layout.
Decoders can be grouped into two main categories: Multifunction and Accessory, each having additional sub-classifications. In summary, they are:
- MultiFunction - Used in rolling to stock, such as locomotives to control movement, lights, and sound. Can also be used in cars to control lights or other animations.
- Sound - Responsible for playing noises typically heard around a train, such as a engine sound, horns, and bells. Sound decoders are technically considered a multifunction decoder because many can also control lights or animations.
- Stationary - Control lights, switches, and animations around a layout.
- 1 MultiFunction Decoder
- 2 Sound Decoder
- 3 Function Only Decoder
- 4 Sound Only Decoder
- 5 Accessory Decoders
- 6 Conditions Which Cause Decoder Failures
- 7 What Causes a Decoder Reset
- 8 Memory Types
- 9 Runaway Locomotives
- 10 Multifunction Decoder Troubleshooting
- 11 See Also
- 12 External Links
- Main article: Multifunction Decoder
Commonly called mobile decoder, NMRA refers to these as multifunction decoder. Multifunction decoders are installed into vehicles such as locomotives or other rolling stock that moves along the rails. It allows complete control of motors, lights, sound, and other functions. Installation may occur at the factory during manufacturing, installed by a third party, such as a hobby shop, or install them yourself.
Multifunction decoders can be further broken down into two types: retail and OEM. Retail decoders are often full function decoders that you buy at the hobby shop for installation, either by the shop or yourself. OEM decoders are supplied directly to the factory for installation in a vehicle during manufacture, and may not have all the functions of a retail decoder. OEM decoders can have custom programming for various functions specific to that model, as well as the appropriate sounds.
Another form of multifunction decoder, which in addition to motor and function 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. Plus other associated sounds such as horn/whistle, bell, coupler noises and other ambient effects.
While many decoders are supplied from the factory with a particular sound set, some premium decoders allow for complete reprogramming with custom sound effects. While you can download new sound files (formatted for that decoder) and load them into a retail decoder, OEM sound files often are locked to a specified decoder model and cannot be loaded into a retail decoder.
Function Only 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.
Sound Only Decoder
Some sound decoders are designed for use in rolling stock which lacks 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.
There also were sound decoders designed to be installed in a locomotive in additional to a multifunction decoder which lacked sound. With the introduction of multifunction decoders with integrated sound these sound only types faded away.
- Main article: Accessory Decoder
Accessory decoders are normally mounted under the benchwork in a stationary position. Accessory decoders are used to control railway turnouts, structure lights, scene lighting, animation, and signalling. Many have multiple outputs, allowing devices nearby to be controlled from one accessory decoder.
Conditions Which Cause Decoder Failures
- ESD can damage a decoder prior to, or during installation
- Soldering using Acid Flux
- A Soldering iron which is not ESD Safe
- Overvoltage on input (from track)
- Failure to isolate the motor from the frame.
- 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.
- 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 or air flow.
- Incorrect wiring. It is very important that you check that the motor brushes are not connected to the frame. They must be isolated. Manufacturers may use the frame as part of the electrical circuit, much like automobiles. Any power source other than the decoder's outputs is a recipe for failure.
What Causes a Decoder 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 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 can also be trigged by a distorted DCC signal on the track causing memory corruption.
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. Cycle the track power off and on again to complete the process.
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 decoder's 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 Possibility of a Decoder Reset
Good trackwork, proper bus 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.
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 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 quality power signal, which 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 will not respond to analog Direct Current voltages when placed on the track of a non-DCC layout.
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 turned off or the signal from the command station is lost a booster is required to shut off its track outputs. There should be no voltage going to the track under these conditions. The design of the booster prevented this, its outputs then latched at whatever state they were in at that time. The result was an analog voltage on the track, which the decoder would interpret as "Switch to Analog Mode" launching the locomotive 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.
Avoiding Runaway Locomotives
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. (See note on Booster Issues above.)
Multifunction Decoder Troubleshooting
- Main article: Multifunction Decoder Troubleshooting
Some multifunction decoders may not properly consist with other decoders, have memory corruption, weak or bad solder joints, track over-voltage, overheating, etc. Troubleshooting can take a bit of time to diagnose and correct. Be sure to check out the Multifunction Decoder Troubleshooting article for tips.
- Decoder installation - How to install mobile decoders
- Multifunction Decoder Troubleshooting
- Installing LEDs with DCC Decoders
- Configuration variable
From the Australian NMRA site:
These refer to JMRI.