The range of addresses available on a DCC system.
- This DCC topic deals with the address range used by mobile decoders. For stationary decoders, see the article on Accessory Decoder Addressing.
Mobile Decoders can be addressed by either two or four digit numbers. If you have a large number of decoders, you may want a system that can handle four digit addressing. The digits in question are Hexadecimal (base 16) numbers, not Decimal (base 10).
With two digits you can have addresses from 1 to 127 (excluding 0 and 3). Four digit addressing increases that range (in theory) from 0 to 10239.
Movement & speed
|DCC Core components|
|Track work components|
- 1 Select-and-Run
- 2 NMRA Address Ranges
- 2.1 Address Partitioning, Extended Packet Format (S-9.1.2)
- 2.2 Multifunction Decoder Addressing
- 2.3 NMRA Multifunction Decoder Address Range Summary
- 2.4 Packet Construction
- 2.5 Compatibility Issues
- 2.6 Address Zero
- 3 DCC Systems and Addressing Ranges
- 4 Programming an Address
- 5 Additional Reading
- 6 Which One Should I Use?
- 7 External links
With Digital Command Control there is no need to worry about where the train is located, which cab you're using, or flip switches to get a cab to talk to a loco. To run a loco, you simply pick up a cab, select the loco address (number) you wish to run, and control it. This allows you to easily and quickly control the train's speed, direction, lights, sounds, or devices such as couplers or animation.
NMRA Address Ranges
- The NMRA defines the address structure for 2 and 4 digit address, the actual implementation is determined by the manufacturer of the system. Not all systems implement this in the same way in their software, so there may be some issues running locomotives set up for 2 digit addresses on one DCC system when using another system.
In this article, numbering systems will be indicated using mathematical notation, where a subscript indicates the radix or base, where 1210 indicates a decimal (base 10) value, or C216 is Base 16 or Hexidecimal. The $ symbol will also indicate a hexadecimal number.
Address Partitioning, Extended Packet Format (S-9.1.2)
This allows the decoder to determine if the packet is a multifunction or accessory decoder packet.
|Address||Binary Value||Hexadecimal Value||Name|
|0||0000 0000||00||Broadcast Address|
|0 - 127||0000 0001 - 0111 1111||$00 - $0C||Multifunction Decoder, 7 bit address|
|128 - 191||1000 0000 - 1011 1111||$80 - $BF||Basic Accessory Decoder with 9 bit address, Extended Accessory Decoder 11 bit address|
|192-231||1100 0000 - 1100 0111||$0C - $E7||Multifunction decoders with a 14 bit address (First Byte, signals a second address byte follows)|
|232 - 254||1110 1000 - 1111 1110||$E8 - $FE||Reserved|
|255||1111 1111||$FF||Idle Packet|
Multifunction Decoder Addressing
NMRA Standards for Locomotive (Mobile) Decoders:
- One to 127 are Primary Addresses (Sometimes called Short Addresses)
- One through 10,239 are Extended (or Long) Addresses
- Advanced Consist Addresses share the Primary Address' 1-127 range
- The Primary Address of "0" can have several applications.
The NMRA defines two ranges of addresses for mobile decoders:
Primary Address Range
- The first address range defined is 1 through 127. This is called the Primary Address. It is a one byte (eight bit) address which in Hexadecimal (see Binary) can have the value of 0116 to 7F16 (1 ..127 decimal) - hence it is called a two digit address. Other terms used for the Primary address are "Short Address", "Baseline Address", "7-bit address", and "2-digit address". It is called a 7-bit address because the first (most significant) bit in the first byte of a DCC packet is always a zero when it is addressing a multifunction decoder in primary address mode. The MSB of this byte is used for other purposes.
Extended Address Range
- The second range of addresses is from 1 through 10239 (116 to 27FF16 - hence 4-digit address). This is called the Extended Address. Other terms used for the Extended addresses are "4-digit address", "14-bit address" and "Long Address". It is called a 14-bit address because 6 bits are transmitted in the first byte of a DCC packet in extended mode and 8 bits in the second byte. To reach FFFF16 (or 6553510) would require all 16 bits, meaning there would not be any bits left to indicate which addressing mode is in use.
- $27FF is 0010 0111 1111 1111 in Binary.
- It is possible for command stations to restrict the available addresses, but the NMRA DCC Standard mandates those limitations be identified on the package and in the instructions.
NMRA Multifunction Decoder Address Range Summary
- Primary Addresses are the values from 1 to 127. These values are found in CV1 (Primary Address)
- Extended Addresses are values from 0 to 10239. These values are stored in CVs 17 and 18 (Extended Address), and are only active if the Extended Address Mode flag in CV29 is set.
- Advanced Consist Addresses also use the Primary Address range.
- Address "0" can have a number of meanings. That address is not permitted in CV1 (Primary Address).
- Manufacturers of DCC command stations are not required to implement the entire range of Primary and Extended addresses. Such as 1 - 99 for Primary Addresses.
- The terms "2 digit" and "4 digit" address are not technically correct.
- Primary Address is limited to 127, as the MSB (most significant bit) of the equivalent two byte binary number is used to indicate headlight status. The same limitation applies to 4 digit addresses.
- Extended Addresses use the MSBs of the first byte to indicate extended addressing and headlight mode.
- Two digit address refers to a single byte binary or 2 digit hex number, four digit means a 2 byte address. The actual decimal value can be more than 9999 in 4 digit mode.
"D" is direction "X" is an extra bit for speed steps, which may be used to headlight control to maintain compatibility. A Value of 0111 1111 is address 127: It will be transmitted like this:
If bits 0-5 are any value except 111111, and 6 and 7 are set to value of 1, the decoder interprets that as an extended address and expects a second byte for address data. The address byte can have any value from 1 to 127.
- The Least Significant Bit is transmitted first, so it can be a little confusing. Data is sent in serial fashion and clocked into a shift register one bit at a time. As each bit of data arrives, the values in the shift register move to the right. After all eight bits have arrived the LSB will be in the correct place at Bit 0.
EXTENDED ADDRESS PACKET
|First Address Byte||Second Address Byte||Instruction Byte||Error Byte|
|Preamble||0||AAAA 0A11||AAAA AAAA||0||CCCD DDDD||0||EEEE EEEE||1|
In this example, the most significant bits of the first address byte are 6 and 7, set to "11", and if the others are not 111111, it indicates that another byte of address data will follow. Bit 5 forms part of the address partition value, with a valid value of 1 or 0. Bit 4 must be zero. Since bits 0-5 cannot equal 111111, this limits the available address range. The only valid decimal values for the first byte (CV17) are 192 to 231.
|Packet Value||Value in Shift Register||Hexadecimal Value||Decimal Value|
|0000 0011||1100 0000||$C0||192|
|1110 0111||1110 0111||$E7||231|
Example of Differences Between 2 and 4 Digit Addressing
Numbers in CV 17 and CV18 are expressed in Hexadecimal. The address is a decimal value.
- There is some overlap of addresses, different command stations handle that overlap differently. For example, some command stations do not allow you to use the low addresses (1-99 or 1-127) in four-digit mode. This is often done for cost reasons, allowing them to use components and software that cannot handle the full range. As noted above, it is permitted, but any restrictions must be clearly identified on the packaging and in the instructions for the DCC system in question.
- Primary Address Range may be restricted to numbers between one and ninety-nine (0x63). A locomotive programmed for 101 (0x65) will not run on a DCC system which restricts the maximum address to 99.
- The Extended Address range is limited to a maximum value of 9999. For most users this will not be an issue, as they still have 90% of the address space available.
- With an overlap in some cases between Primary and Extended Address values 1-127, the decoder can recognize the difference between them based on the number of bytes used to transmit the address.
- If the Primary Address in CV1 is set to a value of 0, the decoder will upon power up switch to the Alternate Power Source defined in CV12. This will override the value set in CV29. Any locomotive configured in this manner will immediately accelerate to full speed when the DCC track power comes on.
- The standard doesn't require the manufacturer to implement all the addresses possible in that range.
- Address Zero is reserved in the NMRA Standard S9.2.1 for exclusive usage as a "Broadcast Address".
Any DCC locomotive receiving a DCC command packet sent to this address must accept the DCC command without regard or consideration of its assigned address. NCE uses this feature in the Power Pro software to clear consists.
The value stored in CV1 does not need to be "0" for this feature to work. Therefore, this address is NOT a locomotive address that a user needs for the normal control of his trains. However, this is an address the DCC system itself may want to send. An example at the DCC system level is E-STOP command which will halt all trains immediately without disconnection of track power.
DCC Systems and Addressing Ranges
NMRA Standard Addressing Schemes
- Primary Address: 1 - 127
- Extended Address: 0 - 10239
- Analog Operation: Allowed
- Advanced Consist Address: 1 - 127
|NMRA Addressing Method||Address|
|Primary||1 - 127||$1 - $7F||1 to 0111 1111|
|Extended||1 - 10239||$1 - $27FF||1 to 0010 0111 1111 1111|
|Advanced Consist||1 - 127||$1 - $7F||1 to 0111 1111|
- 0 = Analog Mode
- 1-127: Primary Address
- 128-9983: Extended Address
- Advanced Consist Address: 1 - 127
- 0 = Analog Mode (Not supported by EasyDCC)
- 1-99: Primary Address
- 100-9999: Extended Address
- 1-99: Advanced Consist Address
Although Atlas DCC systems are supplied by Lenz, their software lacks support for Extended Addresses and Analog operations.
- The EZDCC system lacks support for Advanced Consisting
- Analog operation uses another address.
- No Extended Addresses
- Primary Address Range limited to 1-9
- 0 = No locomotive selected
- 1-127: Either Primary or Extended depending on how selected, a leading 0 (i.e. 0100) will make selection extended. See Consisting article for more details.
- Primary Address 100 is not the same as Extended Address 0100
- 0000-9999: Extended Address
- The command station will accept any address as an Extended Address. A two digit extended address must be padded with leading zeros during entry. For example, Extended Address 55 is entered as 0055. The throttle will display an asterisk before the address indicating an Extended Address.
- Advanced Consist Address: 1 - 127
- Current NCE products do not support analog (no decoder installed) locomotives, older NCE systems, including those built around NCE OEM parts and software, did allow analog operations using a home built (analog only) throttle.
- Analog Mode = User assigned address
- 1-127: Primary Address
- 100-10239: Extended Address
- 1-99: Advanced Consist Address
Programming an Address
Something to keep in mind:
Attempting to program an address using Program on the Main (POM) mode can cause problems if the current address is an Extended Address.
See the article on Decoder Programming for more details.
- Most command stations are setup to handle all the needed calculations required to program addresses. Their software eliminates the need to calculate and enter values into CV29, CV17 and CV18. This is why there may be an overlap between manufacturers regarding Primary and Extended address implementation.
More information is available in the NMRA DCC Standards documents:
Which One Should I Use?
The choice of two or four digit addressing is a personal one.
If you have less than 20 or 25 locos on the layout, two-digit addressing works. Just give each loco an address using the last two digits of the road number on the side of the loco. If you have duplicate numbers, use the first two digits of the road number. If that doesn't work, you may have to renumber one or more locos - or use four-digit addressing.
- Mixing Primary and Extended addressing can lead to an unintended problem with consisting. Two locomotives with Extended Addresses are consisted and assigned Consist Address 30. A third locomotive with the Primary Address of 30 also exists, and will be included in the consist. Commands sent to Address 30 will be acted on by Consist Address 30 and Primary Address 30. Despite the fact that locomotive #30 is not physically part of the consist, it is logically part of it.
Remember, no matter if you picked the first two, or the last two digits, be consistent.
To use four-digit addressing, you must have a command station and decoders that support four-digit addressing, and throttles that can use it. Typically, all decoders support four-digit addressing, and the majority of DCC systems support four-digit addressing. You'll need to research your choice of system for compatibility.
Four digit addressing makes it easy to just use the road number of a locomotive as its address.