Note
This documentation can contain errors or have missing parts. If you find something please create an Issiue.
Tip
Addionaly you can download an Webpage for testing all of these comands. Or test it here: Märklin Intercace Controll
Tip
You can simulate the behaviour of the 6050/6051 here: 6050 Interface Simulator programs like com0com are needed for simulation.
This is an documutation that explains how the Märklin 6050/6051 and 6023/6223 comunicate
Both use serial comunication with the folowing specs:
- Baud: 2400 //on my 6050 a non standart baudrate of exactly 3000 is possible
- Start bits: 1
- Word size: 8
- Stop bits: 2
- Parity: None
Uses only These Serial Pins:
- Pin1 = TX
- Pin2 = RTS
- Pin3 = GND
- Pin4 = RX
- Pin5 = CTS
- Pin6 = NC
The 6050 communication functions by sending numbers in binary. Sending ascii values from the 6023 can freeze it. Which isn't a problem on systems using the Central unit 6020/6021/6022/6023/6223 because they will auto reset.
The Central Unit 6027/6029/6030 will need a manual reset. Behaviour of 6032 is unkown yet.
Sending to a loco that is selected in a control 80f can crash the system.
(6223/6023/6022 will only accept loco adresses 10/20/30/40)
-
Shutdown:
97 -
Start:
96 -
Turnout left(green):
33 X<-- X stands for address1-256- example turnout 5 left:
33 5
- example turnout 5 left:
-
Turnout right(red):
34 X<-- X stands for address1-256- example turnout 7 right:
34 7
- example turnout 7 right:
-
Turnout solenoid off:
32 X<-- X stands for address1-256only needed in older central units- example turnout 75 off:
34 75
- example turnout 75 off:
-
Change loco Direction:
15 X<-- X stands for address1-80- example loco 12 change direction:
15 12
- example loco 12 change direction:
-
Set loco Speed:
X Y<-- X stands for speed1-14, Y stands for address1-80- exampe loco 23 speed 12:
12 23
- exampe loco 23 speed 12:
-
Set loco Speed and Function:
X Y<-- X stands for speed(0-14)+function (+16=on +0=off), Y stands for address1-80can only be done this way. Addresses1-127shoul be supported by the 6027/6028/6030 hardware- exampe loco 31 speed 3 funktion 1: speed(3)+16:
20 31
- exampe loco 31 speed 3 funktion 1: speed(3)+16:
-
Read s88 unit:
X<-- X stands for192+address(1-31(officially))1 unit has 16 contacts. according to märklin 60128 software 63(unofficially)- example reed s88 module 5:
197 - response binary example
0=unset1=set:00110101 1000110
- example reed s88 module 5:
-
Read multiple s88 contacts:
X<-- X stands for128+address(1-31(officially)). according to märklin 60128 software 63(unofficially)- example reed s88 module 1-5:
133 - response binary example
0=unset1=set:"00110101 1000110" *5
- example reed s88 module 1-5:
-
Reset s88 units:
192 or 128 -
Call function F1-4:
X Y<-- X stands for functioncode, Y stands for address1-80, no additiona speed information needed- function codes: //untested
64: all off65: F1 on66: F2 on67: F1-2 on68: F3 on69: F1+F3 on70: F2-3 on71: F1-3 on72: F4 on73: F1+F4 on74: F2+F4 on75: F1+F2+F4 on76: F3-4 on77: F1+F3+F4 on78: F2-4 on79: F1-4 on
- example loco 12 activate function F1-3:
71 12
- function codes: //untested
The 6023 is a newer system that wants ASCII commands it ignores the standart comands unless set into
compatibility mode which also deactivates ASCII comunication after each command a carrage retun(CR) is needed.
It is limmited to 4 s88 modules (64 contacts) and it auto shut offs solenoids after 200 milliseconds which can be changed
- Baud: 2400 //acording to some sources it can handle 19200 Baud couldn't check because of wrong and janky cable type.
- Start bits: 1
- Word size: 8
- Stop bits: 2 -Parity: None
Uses only These Serial Pins:
- Pin1 = TX
- Pin2 = RTS
- Pin3 = GND
- Pin4 = RX
- Pin5 = CTS
- Pin6 = Used but Unknown yet
-
Bin Compatibility mode:
Q (CR) -
Shutdown:
S (CR) -
Start:
G (CR) -
Turnout left(green):
M x G<-- x stands for address1-256- example turnout 5 left:
M 5 G (CR)
- example turnout 5 left:
-
Turnout right(red):
M x R<-- x stands for address1-256- example turnout 7 right:
M 7 R (CR)
- example turnout 7 right:
-
Change loco Direction:
L x D<-- x stands for address1-80- example loco 12 change direction:
L 12 D (CR)
- example loco 12 change direction:
-
Set loco Speed:
L x S y<-- x stands for address1-80, y stands for speed1-14- exampe loco 23 speed 12:
L 23 S 12 (CR)
- exampe loco 23 speed 12:
-
Set loco Speed and Function:
L x S y F z<-- x stands for address1-80, y stands for speed0-14, z stands for function0-1- exampe loco 31 speed 3 funktion 1:
L 31 S 3 F 1 (CR)
- exampe loco 31 speed 3 funktion 1:
-
Read s88 unit:
A x<-- x stands for address1-41 unit has 16 contacts.- example reed s88 module 5:
A 4 (CR)
- example reed s88 module 5:
-
Read one s88 contact:
C x<-- x stands for address1-64.- example reed s88 contact 5:
C 5 (CR)
- example reed s88 contact 5:
The 6023 can be comanded to wait for and report if a specific contact is pressed.
-
Echo mode:
E x<-- x stands for the mode0-2it needs to be activated to get automatic responses.- exampe set echomode 2:
E 2
- exampe set echomode 2:
-
Report a s88 changes automaticly:
W x<-- x stands for address1-64. //untested- exampe auto report contact
17: W 17
- exampe auto report contact
-
wait until contact:
J x W y z<-- x stands for Job number (1-3), y stands for contact, z stans for StateP/N(Positive/Negative) //untested- example Job 1 wait for contact 21 positive:
J 1 W 21 P (CR)
- example Job 1 wait for contact 21 positive:
-
Kill Job:
K x<-- x stands for Job number (1-3) //untested- example Kill Job 3:
K 3 (CR)
- example Kill Job 3:
- 6020: dosnt support
F1-4 - 6021: supports
F1-4 - 6022: dosnt support
F1-4, only Train addresses10,20,30,40 - 6023/6223: dosnt support
F1-4, only Train addresses10,20,30,40, has an integraded Serial Interface, only supports4s88 modules - 6027: dcc support, supports
F1-4, frezzes when to much data is sent, Addresses 1-127 should be supported by the hardware - 6028: dcc support, supports
F1-4, frezzes when to much data is sent, Addresses 1-127 should be supported by the hardware //untested but should be the same as6027 - 6030: dcc support; higher voltage for gauage 1 trains, supports
F1-4, frezzes when to much data is sent Addresses 1-127 should be supported by the hardware //untested but should be the same as6027
Things that dont work: When a Control 80/80f or control unit has a loco address selected
then it will be inpossible to controll the loco with a 6050 interface. It may even crash to 6027.
Addresses over 80 (81-127) are suported on the 6027/6028/6080 but are limited to 99 (control 80f) but can be send vith the 6050/6051 interface
The interface modules are able to switch the Led on the 6040 Keyboard but they
can't recive data when somone uses the 6040 Keybord, Control 80/80f or Control Units externaly.
- 0-15 speed
- 16-31 function
- 32-34 switches
- 35-68 ???
- 64-79 F0-4
- 80-95 ???
- 96-97 Start/Stop
- 98-127 more start/stop?
- 128 reset
- 129-160 S88
- 161-191 even more s88. according to the manual shold stop at 31 but the interface reads up to 61
- 192 reset
- 193-224 S88
- 225+ even more s88. according to the manual shold stop at 31 but the interface reads up to 61
All the Märklin modules are conected with 32pin conectors. They are split into row A and B only each second pin is populated. each side contains the same Signal and power wires mirrored
- A2-A16: GND
- B2-B4: 8V
- B6: INIT
- does something to the to 80f modules (only module that uses it. No activity seen)
- B8: 5V for Memory
- 5v power for Memory and Keyboard modules (NC no existing Control Unit gives power to it)
- B10: Stop
- High=Stop. If pulled down Stop button is pressed
- B12: Go
- High=Go . If pulled down Go button is pressed
- B14: SCL
- I2C clock
- B16: SDA
- I2C data
All the module work in a I2C multi master system toogether. Comunicating directly on the bus allows to remove some limitatiosn of other märklin hardware like controlling the full 127 addresses on the 6027,6029 and 6030. (possibly 255 on 6021 untested). Sending a special resume command. manipulating the functions on a 80f while the address is in use
(can depend on CU version)
- 7F:
- command every module sends to the CU
details coming soon