2009 NMRA Convention - Hartford, Connecticut logo
national train show

RP-9.3.2 Communication Standard for Basic Decoder Transmission

RP9.3.2

Active Topics under current investigation that potentially effect this RP in the future

 

This Recommended Practice covers the basic communications protocol for information transmitted from a Digital Decoder to a communication receiver (termed a detector) that is connected to the rails.  To conform to this specification, a Digital Command Station must transmit information to Digital Decoders by sending a series of bits using the NMRA digital signal described in S-9.1 and using packets as described in S-9.2 and RP-9.2.1.  This sequence of bits, termed a packet, is used to encode one of a set of instructions that the Digital Decoder operates upon. 

The Digital Decoder responds to this NMRA Digital signal by transmitting information during the first transmission window (as specified in RP-9.3.1) that follows a request for transmission. To accomplish this, the Digital Decoder must satisfy both the Communications Standard contained in this specification and the Electrical specifications specified in RP 9.3.1.

This RP is organized as follows:

  1. The General packet format.
  2. The data encoding for the Error detection byte.
  3. Operations Mode Acknowledgement.
  4. Decoder Response Transmission.
  5. Decoder Initiated Transmission.
  6. Broadcast address for Basic Decoder Transmission.
  7. Initiated Broadcast Transmission.
  8. The minimum requirements for conformance.

 

A: General Packet Format for Decoder Communication

This section specifies the data protocol for the decoder part of the two-way communication.   Transmission from a decoder takes place during the first transmission window (termed gap, as specified in RP-9.3.1) that immediately follows the packet end bit of the packet that authorizes the transmission. The packet formats for this transmission as well as the communication authorized during each transmission window is specified in this RP.

Communication from a decoder to a detector is in the form of a message that consists of two, three, or four bytes, framed as specified in RP-9.3.1. The specifications for the contents of each of these bytes follow.  Note that Byte 1 is always transmitted first. 
 

Byte 1: Data Byte 1 - The first data byte is the first byte transmitted and precedes the transmission the Error/Message Type byte. This data byte consists of 8 bits of data used by the decoder to transmit either a response to a specific request from the command station as specified in Section D or further information on acknowledgement as specified in Section C.

Byte 2: Error/Message Type Byte - The second byte of each and every decoder-transmission consists of 2 bits which specify the message type followed by 6 bits of error detection. The format of the Error/Market Byte is contained in Section B.

Byte 3: Data Byte 2 - The second data byte is optional and consists of 8 bits of data. This data is either the second byte of an Address Transmission as specified in Section D or is used by the decoder to transmit decoder initiated information as specified in Section E.  

Byte 4: Data Byte 3 - The third data byte is optional and consists of 8 bits used to indicate the packet type for decoder initiated information contained in Data Byte 2.  The specification of Data Byte 3 is contained in Section E.

 

B: Data Encoding for the Error/Message Type Byte

The second byte transmitted is the Error/Message Type Byte.  This byte contains the following format, the bit labeled MT0 is the least significant bit in the byte.

Error/Message Type Byte

b7

b6

b5

b4

b3

b2

b1

b0

E5

E4

E3

E2

E1

E0

MT1

MT0

To determine when a collision has occurred, when two or more decoders are transmitting data at the same time, a data-encoding scheme is employed. This scheme relies on the principle that the same number of one bits and zero bits are transmitted in a specified data period.  A datagram is sent during the last 6 bits of the Error/Message Type byte.  These bits are named E0-E5.  This datagram is referred to in this specification as a 3/6 transmission.  In a 3/6 transmission 3 bits always have a value of 1 and 3 bits always have a value of 0.  Any other number of "1's" received during this transmission period constitutes an error.  A detector that does not receive exactly the correct number of one and zero bits during the 3/6 transmission shall reject the entire transmission sent during that transmission window.

For data error detection, the data transmitted in E0-E5 is the number of transmitted data bits that have a value of "0's" (including those contained in E0-E5 but not including any framing bits) that will be transmitted in the entire transmission window.  The minimum number of zero bits in a transmission is 4 while the maximum number is 23. Appendix A contains the translation table between the number of "0" bits that will be transmitted and the 3/6 code that is transmitted during E0-E5.

MT1 and MT0 bits are used for transmitting the packet transmission type as specified in the following table. If there is no transmission there is no acknowledge.

MT1, MT0

Meaning

0,0

1 data byte datagram containing packet receipt acknowledgement. Further information about the type of acknowledgement and specific information transmitted is specified in Section C.

0, 1

1 data byte datagram consisting of the specific data that was requested in the packet received as specified in Section D

1, 0

2 data byte datagram containing the decoder address and flag bits as specified in Section D

1,1

3 data byte datagram consisting of one byte of requested data as specified in section D and two bytes of unsolicited decoder initiated data specified in Section E

 

C: Transmission of Acknowledgement/Flag Data

When MT1 and MT0 of the Error/Message Type Byte are both "0" then Data Byte 1 contains acknowledgement data and flag Bits.   If a decoder receives a packet that should be acknowledged as specified in RP-9.2.1, supports acknowledgement, and has acknowledgement enabled as per RP-9.2.2, then the decoder shall transmit the desired acknowledgement in the specified bits in the following table.  Bits 0-2 transmit the acknowledgement type, Bits 3-7 are flag bits as specified in the following tables.  Bit patterns not specified are reserved by the NMRA for future use. The least significant bit is Bit 0. 

Acknowledgement bits

Bits 2-0

Meaning

000

Command received

001

Command Not Supported

010

There is no response specified but the state is the same as the request (positive Acknowledgement)

011

There is no response specified but the state is not the same as the request (Negative Acknowledgement)

100

Configuration does not allow response

 

Flag Bits

Bit Position

Value

Meaning of Value

Bit 3

Always 1

Reserved by the NMRA for future use

Bit 4

Always 1

Reserved by the NMRA for future use

Bit 5

=0

Decoder has a fault Condition

Bit 6

Always 1

Reserved by the NMRA for future use

Bit 7

=0

Decoder has an active Consist Address


 

D: Decoder Response Transmission

The transmission of a Decoder Response Transmission is an advanced form of a packet acknowledgement in response to the specific instruction received.  The following tables describe the format for the various types of data and describe after the receipt of which packet types each data type is allowed to be transmitted. The least significant bit in each data byte is the right most bit specified in each field of the following tables. 

The following lists the data messages and their formats that can be sent in response to receiving a packet. This table will be expanded as additional formats are approved for use.

Transmission Type

Data Byte 1

Message Type
MT1, MT0

Data Byte 2

Data Byte 3

14 bit Address
Transmission

FB0, DT A13, A12, A11, A10, A9, A8

1, 0

A7, A6, A5, A4, A3, A2, A1, A0

Not sent

7 bit Address
Transmission

FB0, DT, 1, 1, C, 0, 0, 0

1, 0

0, A6, A5, A4, A3, A2, A1, A0

Not sent

Current Speed

FB1,  S6, S5, S4, S3, S2, S1, S0

0, 1

Not Sent

Not Sent

Current Speed

FB1,  S6, S5, S4, S3, S2, S1, S0

1, 1

Decoder initiated information as specified in Section E

Contents of CV

D7, D6 , D5, D4, D3, D2, D1, D0

0, 1

Not Sent

Not Sent

Contents of CV

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

Decoder initiated information as specified in Section E

           

Notes:

1.     FBx are flag bits that is reserved by the NMRA for future use.  FBx has a value of 1

2.     DT = 0 locomotive is moving forward as defined by the DC motion of right rail positive direction integrated with CV29 and CV19 settings

3.     A -  represents the bits in the decoders address as specified in RP-9.2.1  Unless specifically requested, the address transmitted is the address used to control the motor.

4.     C = 1 means that the decoder is in a consist

5.     S – represents the actual current speed step as normalized to a 128 speed step value

6.     D – represents the data bits in a CV as specified in RP-9.2.2

7.     All other Data Messages and their formats are reserved by the NMRA.

The following table specifies which data response transmission messages are to be transmitted immediately following the receipt of a packet with a specified instruction type field as specified in RP-9.2.1.

Transmitted Data Messages

 

Instruction Fields of Received Packet

Decoder Control (0000)

Consist Control (0001)

128 Speed Step Control Instruction (001 11111)

Restricted Speed Step Instruction (001 11110)

Speed and Direction Instructions (010 and 011)

Function Group Instructions (100 and 101)

Future Expansion Instruction (110)

Configuration Variable Access Instruction (111)

All Others

7/14 bit Address
Transmission

X

R

R

R

R

Current Speed

R

X

R

X

X

R

R

Contents of CV

R

R

R

X

R

** R = Instruction and data transmission are Reserved

*** Note transmission of data messages is not allowed in blank fields and 8 bits of all 1s will be transmitted.

 

E: Unsolicited Decoder Initiated Transmission

When MT1 and MT0 of the Error/Message Type Byte are both "1" then Data Byte 2 contains unsolicited decoder initiated data.  Data Byte 3 contains the identification of data transmitted and additional data bits as specified in the following table.

Transmission Type

Data Byte 1

Message Type
MT1, MT0

Value in Data Byte 3

Reserved for future 12 bit data transmission

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

D11, D10, D9, D8  1110

Reserved for future 12 bit data transmission

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

D11, D10, D9, D8  1101

Reserved for future 12 bit data transmission

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

D11, D10, D9, D8  1011

Reserved for future 12 bit data transmission

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

D11, D10, D9, D8  0111

Reserved for future 12 bit data transmission

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

D11, D10, D9, D8  1110

CV Address Transmission

A7, A6, A5, A4, A3, A2, A1, A0

1, 1

A9, A8, 1, 1  0011

Dynamic CV Data Transmission

D7, D6 , D5, D4, D3, D2, D1, D0

1, 1

A3, A2, A1, A0, 1111

Reserved for Future Use

1, 1

All other values of Data Byte 3

CV Address transmission is used by the decoder to transmit the address of a CV that contains information that needs to be transmitted. The contents of the CV are obtained in response to the receipt of a Configuration Variable Access

Dynamic CVs are used to transmit information that relates to the current operation of the decoder.  The block of 16 CVs is from the range of 880 to 895 as defined in RP-9.2.2.

 

F: Broadcast Address For Basic Decoder Transmission

Packets sent to address 00000000 (the broadcast address) will trigger a response by all Multi Function Digital Decoders that correctly receive the packet and that have the applicable transmissions enabled as specified in the applicable sections of RP-9.2.1, RP-9.2.2.  Broadcast is only designed for mobile decoders and is not permitted for accessory digital decoders.  Decoders located at permanent fixed locations should be configured to disable the use of broadcast transmission for transmission over the rails. The broadcast with the 00001111 instruction is used to trigger all enabled decoders acknowledge and to transmit their address if so configured by the set decoder flags decoder control instruction.

 

G: Initiated Broadcast Transmission

A decoder to can be instructed to transmit only when addressed (default) or to broadcast its address using the MT1 and MT0 datagram type in the Error/Message Type Byte as  "1's" in every transmission window by one of several means defined below.   Decoders which implement this feature must be able to discern the difference between normal and the detector initiated broadcast and must be properly configured to support this feature.

If a properly configured decoder detects three preambles in a row that contain the detector initiated broadcast and has the appropriate bits set in CV26, the decoder can begin transmitting 7/14 address datagrams as specified in Section D that contain the address the decoder responds to speed and direction commands during each subsequent preamble.  The decoder must cease this form of transmission following the receipt of any preamble that does not contain the detector initiated broadcast transmission request.

Following are the allowed methods for a detector to request a broadcast transmission.

            Asymmetrical DCC signal

Receipt of a packet that has a DCC signal that has a non symmetrical voltage of at least 1 volt.

            Signal Controlled Influence Signal

Receipt of a preamble that contains a Signal Controlled Influence cutout as specified in NMRA TI-9.2.1

CV 28 is used to indicate which method is used.  See RP-9.2.2 for details.

 

H: Required Elements for Conformance

The minimum requirements for Decoders and Detectors for conformance to this RP are as follows. All Decoders and Detectors that support this RP must adhere to the requirements in sections A and B and must implement Section C: Transmission of Acknowledgement/Flag Data   and Section F: Broadcast Address Decoder Transmission for the 00001111 instructions.  If RP-9.3.2 is implemented then CVs 31 and 32 become mandatory as a uniform spec and the Set Decoder Flags instruction as specified in RP-9.2.1 must be supported.

 

Appendix A: 3/6 Data Encoding Translation

The following table provides the translation table for encoding information using the 3/6 encoding scheme.

Number of 0 Bits transmitted

3/6 code transmitted

4

100011

5

100110

6

011100

7

011010

8

011001

9

010101

10

010011

11

010110

12

001110

13

001101

14

001011

15

000111

16

110001

17

110010

18

110100

19

111000

20

101100

21

101010

22

101001

23

100101

 Return to Index


The above NMRA Recommended Practice, RP-9.3.2, was last revised in
July, 2003.