To explain bit manipulation,
we'll discuss CV29, the #1 Configuration Data CV. CV 29 is probably
the second most important Configuration
Variable (second only to the address CV), allowing you to set
up the loco for several different things. Following is a list of the
things CV29 controls. Each of these features are discussed on their
own pages. For more information about any one of these features, just
click on it.
1) Loco's Base
Direction
2) Speed Step Mode
3) Automatic Analog Conversion
4) User-Loadable Speed Table to Use
5) Addressing Mode (2 or 4 digit)
Calculating the value to program
into CV29 can be daunting if you don't understand how to set individual
bits. That's what this page is about. Once you understand how to do
it with this CV, you will be able to do it with any CV that controls
multiple things, which is most prevalent in Throttle Up!'s SoundTraxx
decoders.
To complicate things, there are several
way to calculate the value. Which is best for you to learn and use
depends on your DCC system. Some systems program only in Decimal.
Some program only in Hexadecimal (a different way of counting), such
as the previous Empire Builder and Chief with the DT100 throttles.
Some systems, such as the Empire Builder and Chief, with the DT300
or DT400 throttles, allow you to use Decimal or Hexadecimal. After
you learn how to do it in Hexadecimal, I think you'll find that that's
much easier to calculate and program for CVs that control multiple
things - especially with some of Throttle Up!'s SoundTraxx sound decoders.
Some systems, such as MRC Command
2000, do not allow you to program CV29 with a calculated value. It
has specific things it will program and that's it - because the system
isn't capable of handling other features anyway. Only more advanced
systems that are capable of handling more features will allow the
individual programming of this or any other CV.
Decoders come from the factory with
a base configuration that will allow you to run locos without having
to think about CV29, or any other CV except for the base address.
Generally, all you need to do to run more than one decoder at a time
is to reprogram each decoder's address. But if you need to change
the loco's base direction, or use any of the other features controlled
by CV29, then you'll have to use it.
To try to simplify this calculation,
the information for it is on two separate pages - one for Decimal,
one for Hexadecimal. Select
the one you prefer. |