Decoder Acknowledgement
There is an acknowledgement (ACK) mechanism specified. This allows the decoder to act on instructions regardless of the ability of the programmer to detect the ACK signal.
There are two mechanisms defined:
BASIC
ADVANCED
BASIC
This is defined by the decoder providing an increased load on the programming track, of at least 60mA for 6mS. One method is to apply power to the motor, or a similar load connected to the decoder.
Many decoders apply a short burst of power to the motor, causing the locomotive to lurch forward.
ADVANCED
Covered by NMRA Standards S-9.3.1 and 9.3.2
Timing
The decoder should not send an ACK pulse until all the CV bits have been written into non-volatile memory.
The programmer should scan for the pulse after end bit of the second service mode instruction packet, or as many packets as needed to send the instructions, as well as the specified decoder recovery time. The programmer must continue to send packets to the programming track (which turns off power to the decoder) until the end of the decoder recovery time.
Modes
There are three methods of service mode programming:
Paged Mode
This mode is the most commonly used programming mode and is the preferred method.
Direct Mode is another mode allowed by the NMRA DCC Recommended Practices.
Direct Mode is becoming more popular.
Physical Register Mode is an older, obsolete method of programming that is not used in current production decoders.
This mode allows you to program a decoder no matter what state it is in. You do not even need to know the address (hence the danger of programming all your decoders at once). It will also work if the decoder's memory has become corrupted.
Service Mode also includes a CV Readback capability. The decoder can be read and its settings determined. Not all command stations support readback.
Configuration Variable Read back
Paged Mode
Paged Mode introduced the term "CV" (Configuration Variable).
It is very slow when reading back the CVs.
To read a CV, a number is sent to the decoder. If the response is negative, the number is incremented by one, and the process repeats until a positive response is received from the decoder. This process can repeat up to 256 times.
Reading the complete CV set of a decoder will take a long time. Every CV will be tested sequentially in this manner.
Direct Mode
The popularity of Direct Mode is increasing all the time. It is a very fast mode of programming. The NMRA would like to replace Paged Mode programming with Direct Mode.
Faster Readback of CVs
Instead of asking "Is it 1?, Is it 2?", Direct Mode takes a different approach.
It asks if Bit 1 of the CV is set. Then "Is Bit 2 set?"
Instead of making up to 256 inquires to determine the value of a CV, it can do it with eight. It can read the entire decoder's CVs very quickly.
Service Mode Instruction Packets
Bits are numbered right to left, Bit 0 is the rightmost bit and the Least Significant Bit.
Long Preamble: The packet will have a preamble of at least 20 bits, to allow the decoder time to process the instructions.
Power On Cycle: After applying power to the track, the programmer will send at least 20 valid packets before service mode operations commence. This allows the decoder to power up and stabilize.During this time a current draw greater than 250mA lasting more than 100mS after initialization of packet transmissions is considered a fault condition. A decoder should not draw more than 100mA of current, except when processing an acknowledgement.