This documentation was made by Mr. Walter Fiedler, Thüringer Straße 22, 63329 Egelsbach. Because he does not has Internet-access he has choosen this way of publishing.
The translation was made by Matthew Romer.
Neither I can comment this documentation nor I can answer questions; so please contact Mr. Fiedler - or in case of problems with the translation Mr. Romer - directly. My part of this pulbication is limites to the WWW-adapting ; I did not change the content or it´s translation in any way. You can download the original and it´s translation. So I am not responsible for the content of this documentation and any results and consequences of it´s usage.
Note:
At some places in this document references are made to the driving direction. It is to be noted that only newer delta or digital decoder (with ICs of the type 701.17, 701,21 and 701,22) are able to interpret this absolute direction of travel information. All older decoders (with ICs of the type ZyMOS and 701,13) do not understand this absolute direction of travel information, but modify the driving direction only by the switch " Drive position " " 1 ". Therefore it can occur with these older decoders that the driving direction displayed in the controllers control 80f (6036) and Infra control 80f (6070) do not correspond with the actual driving direction of the decoder.
I will not be held responsible for any damage that may occur from the use of the information contained in this document. You are to use this information at your own risk.
Note:
In the examples of switching or control requests two stop bits are indicated. These two stop bits are created by switching a device from a Slave operation to a Master operation, resulting in a normal stop bit. The two stop bits are also used to check whether a certain device actually adapts to another operating mode. This does not apply to the control 80 (6035) module.
On the hardware side the I2C-Bus consists of two lines:
The following rules generally applies with the I2C-Bus:
Control Unit
1111 1110
Locomotive instruction
000X XXX0
Switching commands for solenoid devices
001X XXX0
Switching commands for extra functions " f1 " to " f4 " of control 80f (6036)
010X XXX0
Switching commands for extra functions " f1 " to " f4 " of INTERFACES (6050 or 6051)
0100 0001
Note:
For the third quarter 2000 there will be a new keyboard (6040) from Märklin. These devices are able to immediately display the current settings for each accessory; by adjusting the DIP switches on the back of the keyboard. This allows for the display of all possible 256 accessory settings.
Hereunder applies: If several of these new devices are attached to a central unit, the central unit always assigns all available addresses, independently of how many devices of the types specified above are actually attached. That is because of the fact that these new keyboards (6040) acknowledge each byte, which will transfer on the I2C-Bus with an acknowledgement bit. This behavior does not disturb however by any means with other communication within the Digital-Systems.
The devices such as key board (6040), SWITCH board (6041) or the SWITCH board 2000 of the company SES, attached left to the central processing unit, do not need to be addressed by software. With these devices the addressing is done via hardware by the DIP switches on the back of the units.
Here is an example of the software related addressing. In addition to the built in controller of the control unit (6021) there are two more devices, which are connected to the control unit (6021). Thus altogether four addresses will be assigned, but only three devices are available and acknowledge the receipt of an address (Q = acknowledgement bit).
Structure of the addressing bytes:
Address Address Address Address 0000 0010 0 0000 0100 0 0000 0110 0 0000 1000 1 Device 1 Q Device 2 Q Device 3 Q Device 4 Q
Initialization attempt for extended Motorola format:
Recipient sender data byte data byte stop bit 1111 1110 0 1000 0000 0 0110 1111 0 0100 0000 0 10 Central unit Q Special addr. Q Decimal 111 Q Q
The complete acknowledgement reads:
Recipient sender data byte data byte stop bit 1000 0000 0 1111 1110 0 0110 1111 0 0100 0000 0 0 Special addr. Q Central unit Q Decimal 111 Q Q
If the control unit (6021) is in the H0-Modus (switch 2 at the rear side switched " OFF "), or the controllers control 80f (6036) or Infra control 80f (6070) are connected to the central unit (6020), the first initialization attempt is not recognized resulting in an incomplete acknowledgement.
This incomplete acknowledgement reads:
Recipient stop bits 1000 0000 0 0 Special addr. Q
Thus the central unit does not accept this operating mode of the controllers.
The controllers control 80f (6036) and Infra control 80f (6070) transmit another initialization code to the central unit, for which each sending address the respective device address is indicated.
Initialization for H0-Modus:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0110 0011 0 0000 0000 0 10 Central Unit Q device addr. Q decimal 99 Q Q
The acknowledgement for it reads:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0110 0011 0 1110 0000 0 0 Device addr. Q Central Unit Q decimal 99 Q Q
Thus the devices control 80f (6036) and Infra control 80f (6070) are initialized.
By the link between these devices and the central unit, the central unit transmits first continuously a locomotive module instruction with (genuine) the decoder address " 80 " (this corresponds at a locomotive decoder all eight switches placed on " OFF ") and the data byte " 0 " to the track (Idle State). Thus one avoids, by negative DC voltage the locomotives briefly jerking while resting against the track (stop state) when switching accessories.
Only if at a controller or at the INTERFACE another valid locomotive decoder address is input, the genuine decoder address " 80 " (Idle State) is no longer transmitted to the track.
- Bit 0 to 3 = drive position (0=Stop, 1=change direction, 2 to 15=speed) - Bit 4 = direction of travel dependent auxiliary function " function " - Bit 5 to 7 = 000 = request or positive acknowledgement = 111 = negative acknowledgement, address invalid or already occupied.
Control request for locomotives in the H0-Modus:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0XXX XXXX 0 000X XXXX 0 10 Central Unit Q device addr. Q 00 to 79 Q drive position Q
If this control request is accepted, then the acknowledgement reads:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 000X XXXX 0 0 Device addr. Q Central Unit Q 00 to 79 Q drive position Q
If the control request is not accepted e.g. with occupied decoder address, then the acknowledgement message from the central unit reads:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 111X XXXX 0 0 Device addr. Q Central Unit Q 00 to 79 Q 111=occupied Q
Note:
Even if the control unit (6021) is adjusted to the extended Motorola format (switch 2 at the rear side of the central unit is switched " ON "), the control requests of control 80 (6035) and INTERFACE (6050 or 6051) as well as the pertinent acknowledgement messages during more accepted and not accepted control requests are exactly the same from the appropriate messages in the H0-Modus described here.
- Bit 0 to 3 = drive position (0 = deadlock, 1 = change direction of travel, 2 to 15 = speed) - Bit 4 = direction of travel dependent auxiliary function " function " - Bit 5 to 7 = 001 = request = 10X = positive acknowledgement, X = 0 driving direction backwards, X = 1 forward = 110 = negative acknowledgement, address invalid or already occupied. = 010 = request " force transfer "
Data communication with control 80f in the extended Motorola format, control request:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0XXX XXXX 0 001X XXXX 0 10 Central unit Q device addr. Q 00 to 79 Q drive position Q
The acknowledgement for it, if the request is accepted, reads:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 10XX XXXX 0 0 Device addr. Q Central unit Q 00 to 79 Q drive position Q Direction
If another controller already occupies the requested address, a special acknowledgement of the central unit is returned. The fourth byte contains the controller's address of which the locomotive address is already called instead of the drive position information. This device address is indicated in such a way so that the sender or the recipient is able to decipher the information:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 110X XXX0 0 0 Device addr. Q Central unit Q 00 to 79 Q occupies of Q Device addr.
At the controller with the flashing address display if the same address is again entered, the address is taken over on this device and on the previous device that already occupied the address.
This special control request reads:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0XXX XXXX 0 010X XXXX 0 10 Central unit Q device addr. Q 00 to 79 Q drive position Q Transfer control
An acknowledgement from the central unit, which accepts this request, follows:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 10XX XXXX 0 0 Device addr. Q Central unit Q 00 to 79 Q drive position Q Direction
Note:
With the control unit (6021) decoder addresses are transmitted starting from " 81 " not to the track but to serve (partly) to the call of special system functions of the central unit. See in addition also the paragraph " Undocumented functions for the Control Unit (6021) " at the end of this document.
Structure of the switching request for function instruction:
Recipient sender decoder data byte stop bit 1111 1110 0 010X XXX0 0 0XXX XXXX 0 0000 XXXX 0 10 Central unit Q device addr. Q 00 to 79 or Q f1 to f4 Q 00 to 99The acknowledgement of the central unit reads:
Recipient sender decoder data byte stop bit 010X XXX0 0 1111 1110 0 0XXX XXXX 0 0000 XXXX 0 0 Device addr. Q Central unit Q 00 to 79 or Q f1 to f4 Q 00 to 99
Since addresses for function decoders can be called also with several devices at the same time, no acknowledgement message with e.g. address already occupied can occur here.
Structure of the switching request:
Recipient sender data byte stop bit 1111 1110 0 001X XXX0 0 00XX XXXX 0 10 Central unit Q device addr. Q Q
The acknowledgement of the central unit reads:
Recipient sender data byte stop bit 001X XXX0 0 1111 1110 0 00XX XXXX 0 0 Device addr. Q Central unit Q Q
If the central unit is however in the " stop" mode, the receipt of the switching request is only shortened acknowledged:
Recipient stop bits 001X XXX0 0 0 Device addr. Q
During this state the keyboard (6040), SWITCH board (6041) or MEMORY (6043) regularly transmits a new switching request to the central unit (if one is selected from the above mentioned controllers), until the central unit is in the " go" mode and the switching request is completely acknowledged.
Only when the switching request is completely acknowledged, the display in the keyboard (6040) is updated.
Once the appropriate key is released at the keyboard (6040), the keyboard (6040) will send a power-off instruction to the central unit. In the data byte the four bits of the decoder output number (bit 0 to 3) are reset. The two bits for the decoder section address (bit 4 and 5) must remain unchanged thereby.
Switching request for power-off instruction:
Recipient sender data byte stop bit 1111 1110 0 001X XXX0 0 00XX 0000 0 10 Central Q device addr. Q Q
The acknowledgement of the central unit reads:
Recipient sender data byte stop bit 001X XXX0 0 1111 1110 0 00XX 0000 0 0 Device addr. Q Central Q Q
Note:
If a switching request is transmitted by the MEMORY (6043), the MEMORY address is not transferred, but the appropriate keyboard address and decoder section address for this instruction.
Please note that the four switches at the rear of the MEMORY (6043) are not structured the same way as the four switches at the rear of the keyboard (6040) or the switchboard (6041). Only switches 1 and 2 are used to determine the address of the MEMORY (6043). This means that only four MEMORY (6043) units can be connected to the I2C-Bus in the Märklin Digital-System.
When controlling switching accessories the INTERFACE (6050 or 6051) produces the same transmissions just like the MEMORY (6043). Only with the power-off instruction is there a small difference in the data being transmitted. The INTERFACE (6050 or 6051) resets in the data byte only the bit for placing (bit 3) to an off state. The keyboard (6040) resets against it with the power-off instruction all four bits (for decoder output), thus the bits 0 to 3. The two bits for the decoder section address (bit 4 and 5) must remain unchanged also here.
Only when switching functions a special device address is output, i.e. the address 0, although during the software related addressing only addresses are turned off including 1. Computer interface gives it a small difference: The INTERFACE (6050 or 6051) resets the data byte by only changing the bit (bit 3), the key board (6040) resets against it with the power-off instruction all four bits (for decoder output), thus the bits 0 to 3. The two bits for the decoder section address (bit 4 and 5) must remain unchanged also here.
Beyond that also " f1 " to " f4 " is set over the INTERFACE (6050 or 6051) with the specification of the sender address, the bit 0 only with switching request for extra functions. During the pertinent acknowledgement message from the central unit this bit 0 is again reset.
Therefore the instruction structure for switch commands for the interface here in detail:
Recipient sender decoder data byte stop bit 1111 1110 0 0100 0001 0 0XXX XXXX 0 0000 XXXX 0 10 Central unit Q device addr. Q 01 to 80 or Q f1 to f4 Q 01 to 99
The acknowledgement of the central unit reads:
Recipient sender decoder data byte stop bit 0100 0000 0 1111 1110 0 0XXX XXXX 0 0000 XXXX 0 0 Device addr. Q Central unit Q 01 to 80 or Q f1 to f4 Q 01 to 99
A locomotive control request from the central unit (6020) in the " stop" mode reads:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0XXX XXXX 0 000X XXXX 0 10 Central Q device addr. Q 00 to 79 Q drive position Q
The shortened acknowledgement reads then:
Recipients 000X XXX0 0 Device addr. Q
The clocking line SCLK and the data line SDA remain low until the central processing unit is again in the " go" mode. The I2C-Bus is thus blocked.
However with control 80 (6035) and INTERFACES 46 clock cycles have passed, with control 80f (6036) and Infra control 80f (6070) 48 clock cycles have passed due to the switching of slave to master operation.
After the change to the " go" mode the acknowledgement is again continued here.
Sender decoder data byte stop bit 1111 1110 0 0XXX XXXX 0 000X XXXX 0 0 Central unit Q 00 to 79 Q drive position Q
Now a new control request follows due to the temporal delay:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0XXX XXXX 0 000X XXXX 0 10 Central unit Q device addr. Q 00 to 79 Q drive position Q
And in addition the appropriate acknowledgement:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 000X XXXX 0 0 Device addr. Q Central unit Q 00 to 79 Q drive position Q
Since the change of the central unit (6020) into the " go" mode 102 clock cycles passed, with control 80f (6036) and Infra control 80f (6070) and 104 clock cycles with the control 80 (6035) and INTERFACES (6050 or 6051).
At a control 80f (6036) during the " stop" mode if a new address was entered, then a further control request with 76 clock cycles will follow:
Recipient sender decoder data byte stop bit 1111 1110 0 000X XXX0 0 0XXX XXXX 0 000X XXXX 0 10 Central unit Q device addr. Q 00 to 79 Q drive position Q
And the pertinent acknowledgement:
Recipient sender decoder data byte stop bit 000X XXX0 0 1111 1110 0 0XXX XXXX 0 000X XXXX 0 0 Device addr. Q Central unit Q 00 to 79 Q drive position Q
Also when switching functions in the " stop" mode of the central unit (6020) the switching request is acknowledged first by a shortened by acknowledgement statement from the central unit, and the clocking line SCL as well as the data line SDA thereafter held low until the central unit is again in " the go" mode.
Switching request for functions in the " stop" mode:
Recipient sender decoder data byte stop bit 1111 1110 0 010X XXX0 0 0XXX XXXX 0 0000 XXXX 0 10 Central unit Q device addr. Q 00 to 79 or Q f1 to f4 Q 00 to 99
The shortened acknowledgement of the central unit reads:
Recipients 010X XXX0 0 Device addr. Q
The clocking line SCL and the data line SDA remain low until the central processing unit is again in the " go" mode. The I2C-Bus is thus blocked. With control 80f (6036) and Infra control 80f (6070) 48 clock cycles will have passed.
Bei Control 80f (6036) und Infra Control 80f (6070) vergingen bis hierher 48 Taktzyklen.
After the change to the " go" mode the acknowledgement is again continued here.
Sender decoder data byte stop bit 1111 1110 0 0XXX XXXX 0 0000 XXXX 0 0 Central unit Q 00 to 79 or Q f1 to f4 Q 00 to 99
Now a new switching request follows due to the temporal delay:
Recipient sender decoder data byte stop bit 1111 1110 0 010X XXX0 0 0XXX XXXX 0 0000 XXXX 0 10 Central unit Q device addr. Q 00 to 79 or Q f1 to f4 Q 00 to 99
The acknowledgement of the central unit reads:
Recipient sender decoder data byte stop bit 010X XXX0 0 1111 1110 0 0XXX XXXX 0 0000 XXXX 0 0 Device addr. Q central unit Q 00 to 79 or Q f1 to f4 Q 00 to 99
Since the change of the central unit (6020) into the " go" mode 104 clock cycles have passed.
At the control 80f (6036) during the " stop" mode if a further function was switched or if a new function decoder address was input, then now a further switching request with 76 clock cycles follows:
Recipient sender decoder data byte stop bit 1111 1110 0 010X XXX0 0 0XXX XXXX 0 0000 XXXX 0 10 Central unit Q device addr. Q 00 to 79 or Q f1 to f4 Q 00 to 99
The acknowledgement of the central unit reads:
Recipient sender decoder data byte stop bit 010X XXX0 0 1111 1110 0 0XXX XXXX 0 0000 XXXX 0 0 Device addr. Q central unit Q 00 to 79 or Q f1 to f4 Q 00 to 99
Note:
Functions, which were switched during the " stop" mode before an address change, are transmitted to the track once the system is change into " the go" mode, but are not stored in the calling device.
Also when switching accessories in the " stop" mode of the central unit (6020) the switching request is acknowledged afterwards only by a shortened acknowledgement by the central unit and the clocking line SCL as well as the data line SDA is held low until the central unit is again switched in " the go" mode.
Switching request for accessories in the " stop" mode:
Recipient sender data byte stop bit 1111 1110 0 001X XXX0 0 00XX XXXX 0 10 Central unit Q device addr. Q Q
The shortened acknowledgement of the central unit reads:
Recipients 001X XXX0 0 Device addr. Q
The clocking line SCL and the data line SDA remain now on Low until the central processing unit is again in the " go" mode. The I2C-Bus is thus blocked.
With keyboard (6040), MEMORY (6043) and INTERFACES (6050 or 6051) passed to here 37 clock cycles.
After the change to the " go" mode the acknowledgement is again continued here.
Sender data byte stop bit 1111 1110 0 0000 XXXX 0 0 Central unit Q Q
If before the change into the " stop" mode an accessory was switched on and during " the stop" mode the key were again released, then the transfer is hereby terminated.
Otherwise the switching request is repeated now:
Recipient sender data byte stop bit 1111 1110 0 001X XXX0 0 00XX XXXX 0 10 Central unit Q device addr. Q Q
The complete acknowledgement of the central unit reads:
Recipient sender data byte stop bit 001X XXX0 0 1111 1110 0 00XX XXXX 0 0 Device addr. Q central unit Q Q
Since the change of the central unit (6020) into the " go" mode 75 clock cycles have passed. If during the " stop" mode a keyboard key were pressed and released again, still the power-off instruction is transferred and acknowledged to ensure the accessory is turned off.
Switching request for power-off instruction:
Recipient sender data byte stop bit 1111 1110 0 001X XXX0 0 00XX 0000 0 10 Central unit Q device addr. Q Q
The acknowledgement of the central unit reads:
Recipient sender data byte stop bit 001X XXX0 0 1111 1110 0 00XX 0000 0 0 Device addr. Q central unit Q Q
Since the change of the central unit into the " go" mode 131 clock cycles passed.
Note:
Only newer decoders of the type c90 (60901 or 60902) " understand " the specification of the driving direction. With older decoders only the drive position is set to " 0 " (stop) and the direction of travel dependent auxiliary function is switched off. The last driving direction is preserved in the decoder however and can thereby be different from the display in the controller.
The switching request for functions, generated by the central unit, read:
Recipient sender decoder data byte stop bit 1111 1110 0 0100 0010 0 0XXX XXXX 0 0000 XXXX 0 10 Central unit Q device 1 Q 00 to 99 Q f1 to f4 Q
Control request for locomotive data read:
Recipient sender decoder data byte stop bit 1111 1110 0 0000 0010 0 0XXX XXXX 0 01XX XXXX 0 10 Central unit Q device 1 Q 00 to 79 Q drive position Q
The bit sequence 01XX XXXX in the data byte is used otherwise with forced address transfer. For the control request for locomotive data the driving direction is falsely indicated normally as (the driving direction is only indicated for the acknowledgement message by the central unit, not however during the control request). That leads to the fact that during driving direction " forward " the data of the attached devices control 80f (6036) and Infra control 80f (6070) are not recognized and with the first call of a locomotive the direction of travel dependent auxiliary function " function " are always switched off.
The specification of the driving direction is usually transmitted in the acknowledgement of the Control unit (6021).
After the control unit (6021) has processed all switching or control requests, still another control request for driving equipment No. 1 follows, for which the decoder address " 99 " is indicated:
Recipient sender decoder data byte stop bit 1111 1110 0 0000 0010 0 0110 0011 0 001X XXXX 0 10 Central unit Q device 1 Q dec. 99 Q drive position Q
This is acknowledged as invalid:
Recipient sender decoder data byte stop bit 0000 0010 0 1111 1110 0 0110 0011 0 111X XXXX 0 0 Device 1 Q central unit Q dec. 99 Q 111=occupied Q
If any input device control 80 (6035), control 80f (6036), INTERFACE (6050 or 6051) or Infra control 80f (6070) a valid locomotive decoder address within the range of " 01 " to " 80 ", the control unit begins the Refresh cycle.
All decoder addresses are now contained in the Refresh cycle, which were stored before being powered off or before the RESET of the Digital-Systems where the data byte is not equal to " 00 ". The addresses, with which both the data byte for functions " f1 " to " f4 " as well as the data byte for locomotive drive position contained and the " function " have a value " 0 " and where the adjusted driving direction is set to " forward ", these addresses are not added to the refresh cycle.
Note:
Only newer decoders of the type c90 (60901 or 60902) " understand " the specification of the driving direction. Older decoders which have been resting for some time will set the driving direction to " forward ", even if the driving direction was previously set to " backwards ". Thus it can occur that the driving direction displayed in the controllers control 80f (6036) and Infra control 80f (6070) does not correspond the actual driving direction.
The translation was made by Matthew Romer. © 2002. Many thanks to him for this grateful work.
The WWW-adaption was made by Dr. M. Michael König. © 2002.