Back to Contents
Back to DCC
Link to Sitemap


Decoder CV programming

All decoders have Configuration Variables (CVs) which can be used for configuring the performance of the decoder. We'll cover only CV29, the main configuration CV, but the same principles apply to other CVs for setting not only how well the decoder runs, but also the functions, lights, etc. And of course, sound; if you've got a sound decoder.

Bits, and the programming of

A question of terminology...

Some manufacturers of decoders refer to 'the third bit', or 'Bit 2'. This is caused/confused by the fact that convention numbers the bits starting at '0'. So with some you have 'the first bit' to 'the eighth bit', with others it's 'Bit 0' to 'Bit 7'. It's actually not difficult to work out which convention is being used, the instructions given for CV29 will often provide guidance.

Fortunately there are very few CVs that need programming by setting bits...

Calculating values for programming the decoder

Providing that you're comfortable adding a few figures together it's not difficult to calculate the decimal equivalent to a binary number:

Now supposing we need to set Bits 0,1,2,6 and 7 (that's the first, second, third, seventh and eighth bits) 'on'. Then we need to add the following numbers together (you can see the above list for where the numbers come from):

1 + 2 + 4 + 0 + 0 + 0 + 64 + 128 = 199

So the value you'll need to program in is '199'

Determining what has been set in a decoder

Of course a variation on the above technique will also work, in reverse, if you're trying to establish what bits have been set for a particular CV. It's probably easiest to explain using an example; there's nothing more than a little simple subtraction required:

Right; let's pick a random number, how about '178'?

Working from the decimal values of most significant bit to the least significant bit we're going to try and subtract each one in turn. If we can, then the bit is set. If it can't be subtracted then it isn't set.

So, '178'.

The main Configuration Variable; CV29

Right, lets deal with a ‘biggie’; CV29. This is the main configuration CV for all decoders. Many decoders have additional configuration CVs for higher functions; but we’ll only concern ourselves with CV29 for the moment. The effects of correctly setting CV29 are not subtle as it controls direction, the number of speed steps, whether the decoder will work on analogue control, speed table, 2-digit or 4-digit addressing and probably one or two other things that are proprietary to the manufacturer of your decoder. For that reason you'll need the manual for the decoder handy before we get down to the nitty gritty.

This particular CV is worth getting to grips with and is the reason that I've decided to include the method for calculating the programming values (above). CV29 is set entirely by selecting what functions (and therefore what bits) you want to set.

Direction

Should be the simplest and most obvious one to sort out. If the loco goes 'forwards' when it's told to , and the front headlights light up then you're sorted. If, however, your pride and joy merrily rolls off in the wrong direction then this bit will need setting. Beware that if the headlights are not co-ordinated with the direction of travel this can't be remedied by programming. You'll need to swap a set of leads over - either the grey/orange pair on the motor or the yellow/white pair on the lights. Once they're co-ordinated you can then set the direction.

Speed steps (flashing headlamps?)

Generally it’s worth going for the highest number of speed steps your controller will support. In my case that’s 28/128; as the ‘Compact’ is normally 28 speed steps. It can be easily re-configured for 128 speed steps; which is lucky really as you have to do it for every loco every time you turn it on! However, the greater the number of speed steps the finer the control you have. The speed difference between the first and last step is still the same; it’s either 128 small steps or 28 (or 14 if you’re using an old system) larger ones. The finer step settings are particularly useful at the slow speed end of the scale.

If you find that you're getting the headlights turning on and off as the loco accelerates or decelerates then the controller isn't set to the same number of speed steps as the decoder. If that happens it's probably worth setting everything to as large a number of speed steps as you can.

Analogue control

The other function I feel I should draw your attention to. If you’re operating on DCC layouts it’s well worth setting the value required to restrict the loco to digital operation. This does a number of things, firstly; it allows the use of some of the higher functionality in the decoder, which may be disabled by having the decoder capable of driving on analogue. The effects of this may not be subtle and also may not be fully detailed in your decoder manual. A classic example is with the fitting of ‘Power 1’ modules to ‘Gold’ decoders; unless set to digital only, the Power 1 will have no effect on the running at all. And the same is true of fitting the on-board power system to Zimo decoders; it’ll only work if CV29 is set to digital only operation.

Another, surprising, advantage of digital only operation is to do with tolerance of dirt on the track. If the decoder is set to operate on both DCC and analogue it will wait to operate until it has detected whether it’s under DCC or analogue command. So imagine the scenario with the loco bowling along when it hits some dirt. The decoder temporarily ‘glitches’ and the momentum of the loco (especially if it’s got a flywheel) carries it over the dirt. The decoder will then hold off until it’s detected it’s on DCC (or analogue) control and then move off; the result will be something of a lurch as the decoder pauses for a few milliseconds. If the decoder has been programmed for DCC only then the decoder will resume drive as soon as power is returned – frequently with no obvious indication of it ever having stopped.

Speed Table

All the modern decoders offer programming the speed values by either setting the start, medium and maximum speed values or by programming a full speed table. This bit will need setting if you want to use the speed table option. Most of the time I don't; but I've used the Lenz LE1025 in some American diesel locos by Atlas and Proto-2000 with the speed table set and I feel it's been worth it to get them all performing identically.

It's a lot of faff though, even with the SPROG.

2- or 4-digit addressing

If you're happy using the short (or basic, or primary) address with values between 01 and 99 (or 128 in the case of some control systems) then leave this bit unset. For using the long (or full, or extended) address, with values between 0001 and 9999 (or 10239 in the case of some systems) then you'll need to set this bit. Some of the more basic control systems (including the Lenz 'Compact') can only manage the short addresses. The short address is stored in CV1, the long address in CV17 and CV18. Most systems that are capable of using the long addresses have a cute way of setting the value in the CVs, so here I won't go into how that works.

Origin or real life as it exists / who does what:
This page last updated 24/01/2007. Copyright © Euram Solutions and Steph Dale 2004-2007. All Rights Reserved.
Steph Dale can be contacted through the contacts page