OpenDCC Z1 configuration using Special Options (SO)
-
OpenDCC can be flexibly adjusted to personal user preferences during compilation as well as during runtime.
- Possible adjustments and settings to be considered already during compilation usually are defined as parameters within the config.h. Those parameters comprise, for instance, the internal memory size, command lists and the overall support for specific functions and protocols like Intellibox, Lenz, S88, and DMX. For more details and examples refer to config.h and config.h.
-
Each selected configuration provides for additional customizations which can be set and modified during operation using internal,
persistent variables kept in the commands stations EEPROM. However, modification of those variables usually require a restart of the
OpenDCC command station in order to make effective the changes.
The variables kept in EEPROM can be set and modified using one of the following different ways:- Preset during compilation. The EEPROM contents is defined by config.h and config.c.
- Access using command SO (P50X-ASCII-Mode) or XSOset (0xa3) respectively XSOget (0xa4) in P50X-Binary-Mode.
- Access using Xpressnet-commands 0x23 0x28 and 0x23 0x29 to read and write the command stations' CVs. This is supported by respective menues available on the OpenDCC throttle.
- Access by programming the CVs of a "virtual" loco (V0.14 and higher). This requires to press the green "GO" button during startup of the command station to enter the configuration mode. Once in that mode, all programming commands (DCC bytewise) are routed to the command station, i.e. the internal EEPROM variables. (See also: Configuration using Trainprogrammer using a PC)
List of Special Options (SO)
-
In the following table all default settings of version V0.15 are marked with an '*'.
Defaults can be easily altered and are most likely subject to changes so please make sure to check all settings prior to use.
SO# | SO-Name | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Version | A byte value to be interpreted as decimal, e.g. 0x0E = Version 0.14 | ||||||||||||||||||||||||||||||||
1 | Baud rate | the baud rate default. The values are consistent with the
Lenz interface:
When reading the SO using command XSOget (0xa4) the SO had to be recoded to Intellibox due to reconfiguration of the interface after reading this SO using Traincontroller. In this special case the baud rate must be set according to Intellibox:
| ||||||||||||||||||||||||||||||||
2 | OpenDCC Mode | This CV is used to distinguish different configurations and properties of OpenDCC. (read only)
| ||||||||||||||||||||||||||||||||
3 | Virtual decoder low | together with SO 4 provides a 16-Bit value | ||||||||||||||||||||||||||||||||
4 | Virtual decoder high | 16-Bit value: when accessing a switching decoder having this address the command will not be put on the track as
DCC-command but will be used for initiation of internal transfer of the loco database to Xpressnet.
Preset to: 2040 (equals the most available address) Note: up to version 0.22 this variable was used to trigger the DMX output in case DMX_ENABLED had been compiled in. Access to a decoder with an address larger than the one stored here was used to trigger a DMX-macro rather than put on the track as DCC-command. DMX-macro therefore were virtual decoders available, see also Raumlichtsteuerung. Setting to 0xffff disables the feature completely. Preset to: 899 | ||||||||||||||||||||||||||||||||
5 | Version | A byte value to be interpreted as decimal, e.g. 0x0E = Version 0.14 This is the same value as in CV0 (mirrored) to allow simplification of read-access, if required. | ||||||||||||||||||||||||||||||||
6 | CTS-Usage | 255, CTS is unused - required for railware compatibility. Railware would like to see a value of 20 here, however OpenDCC wants to use CTS for communication rather than to misuse it for status reports. | ||||||||||||||||||||||||||||||||
7 | S88 Mode |
| ||||||||||||||||||||||||||||||||
8 | S88 Autoread | number of bytes that are read automatically by S88. That number must equal the sum of SO 9, SO 10 and SO 11. OpenDCC does not make any use of this (OpenDCC always does autoread), but railware wants to know :-). Max value is 128 bytes. (see also S88_SIZE_MAX in config.h) | ||||||||||||||||||||||||||||||||
9 | S88 modules 1 | number of bytes on S88-line 1 (X10 respective X22, "left", seen from front).
Usual modules have 2 bytes. In case there are 5 modules (16 Bit each) connected, a value of 10 is expected here. This CV can be read by X88PGet (0x9C-0x01) and can be written by X88PSet (0x9D-0x01). default: 2 | ||||||||||||||||||||||||||||||||
10 | S88 modules 2 | number of bytes on S88-line 1 (X8 respective X23, "middle").
Usual modules have 2 bytes. In case there are 5 modules (16 Bit each) connected, a value of 10 is expected here. This CV can be read by X88PGet (0x9C-0x01) and can be written by X88PSet (0x9D-0x01). default: 2 | ||||||||||||||||||||||||||||||||
11 | S88 modules 3 | number of bytes on S88-line 1 (X9 respective X24, "right", seen from front).
Usual modules have 2 bytes. In case there are 5 modules (16 Bit each) connected, a value of 10 is expected here. This CV can be read by X88PGet (0x9C-0x01) and can be written by X88PSet (0x9D-0x01). default: 2 | ||||||||||||||||||||||||||||||||
12 | Turnout command inversion |
| ||||||||||||||||||||||||||||||||
13 | Turnout command repetition | Number of times each turnout command is repeated on the main track. Preset: 2 | ||||||||||||||||||||||||||||||||
14 | Turnout cycle time | After this amount of time (in steps of 50ms) the turnout coils will be shut off. OpenDCC does never shut off coils (this is up to the decoders). Shut off commands from the host will be forwarded and might be used to sensor turnout position. This SO is used by railware, that is the reason why it is there. Preset : 100 | ||||||||||||||||||||||||||||||||
15 | Power-on status | Denotes the protocol in Intellibox mode:
| ||||||||||||||||||||||||||||||||
16 | Offset for turnout sensoring | In case turnout sensoring is enabled, S88 event are generated for turnouts not switched correctly. The events
consider the offset defined here before writing the S88 buffer. Offset is in bytes. Example: Turnout 10 not switched, Offset be 6. => Sensor bit 58 is set (58 = 10 + 6*8). Note that the S88-buffer holds up to 1024 bits, therefore not all possible turnout addresses might be available for feedback. Preset : 0 | ||||||||||||||||||||||||||||||||
17 | Turnout sensoring mode | This SO defines how turnout sensoring is reported:
| ||||||||||||||||||||||||||||||||
18 | Extended Resets | This SO defines if and by what account the number of reset packages is increased prior to a programming command:
| ||||||||||||||||||||||||||||||||
19 | Extended Program Commands | This SO defines if and by what account the number of programming packages is increased:
| ||||||||||||||||||||||||||||||||
20 | PoM (Programming on main) repetition | This SO defines how often a PoM-command is repeated. Preset : 3 (NMRA requires 2) | ||||||||||||||||||||||||||||||||
21 | Speed repetition | This SO defines how often a Speed-command is repeated.
Preset : 3.
Denotes immediate repetitions to be sent. There is implemented on top a cyclic refresh of all locos in case no new commands have been sent to them. In case too many locos are queued, the loco with the smallest repetition counter remaining is ignored. This allow for dynamic adaption of OpendDCC in case of heavy traffic. | ||||||||||||||||||||||||||||||||
22 | Function repetition | This SO defines how often a Function-command is repeated.
Preset : 0.
Denotes immediate repetitions to be sent. There is implemented on top a cyclic refresh of all locos in case no new commands have been sent to them. | ||||||||||||||||||||||||||||||||
24 | Preset DCC Format | This SO defines the format used to address locos.
It is recommended to use 28 speed steps - 128 speed steps cause less performance and are sometimes not considered by the applications, for instance, TC makes use of 50 speed steps, only. | ||||||||||||||||||||||||||||||||
25 | Preset BiDi (railcom) | This SO defines whether OpenDCC generates the cutout for NMRA-BiDi (RailCom™)
| ||||||||||||||||||||||||||||||||
26 | Preset Fast Clock | This SO defines if and with what acceleration factor a modelrail clock is generated by OpenDCC (DCC FAST CLOCK).
The time is generated as DCC message or Xpressnet message. Those messages are proprietary extensions of the standard and have been
sent in for comments already.
Preset : 8 | ||||||||||||||||||||||||||||||||
29 | Xpressnet Feedback Mapping | This SO defines how turnouts and sensors are handled when read by Xpressnet. Due to protocol restrictions
a distinction is required.
Note: Command station only assigns addresses and status bits used by the commands according to the settings above. The commands themselves are not affected. In case turnout 257 is switched in mixed-mode, the respective command is forwarded and most likely interferes with the addresses of other sensors. | ||||||||||||||||||||||||||||||||
30 | Timing S88 | This SO defines the length of pulses on S88-bus.
The unit is 10µs; when reading the S88-bus a pulse is generated with the
High and Low time defined here. Default 2 translates to 20µs High and 20µs Low.
Background: Some modules are implemented using a processor and might not be capable to support fast reading. For instance, a value of 2 turned out to be too fast for module of railway-lauf.de. For details see also S88-N For performance reasons, the timing should not be set too generously. They are implemented by busy-waiting and therefore impact OpenDCC throughput. | ||||||||||||||||||||||||||||||||
31 | S88 turnout-sensors | This SO defines the number of bytes on virtual S88 line turnout sensors.
A set of 8 sensors (represented by a bit each) makes up a byte, so the highest available turnout address divided by 8 is to be entered here.
Note that the S88 buffer has a limited capacity of 1024 bits so not all possible turnout addressed might be used for sensoring. This option also may be read by command X88PGet (0x9C-0x04) and written by command X88PSet (0x9D-0x04). Preset : 0 General statements on S88 feedback bits: S88 feedback bits in OpenDCC may origin from 5 source: 3 real S8 hardware lines, the virtual line for turnout sensoring and external messages from xpressnet occupancy devices.
| ||||||||||||||||||||||||||||||||
32 | Total amount of feedback bits | given in bytes, the S88 buffer has a limited capacity of 1024 bits, therefore this value has
a valid range from 0..128. default: 0 Notes: If there are no sources for feedback bytes outside the command station, then the internally used total amount is calculated from the sum of s88 hardware and turnout feedback. In this case, nothing needs to be set here! But if there are external sources for feedback bits (like an xpressnet occupancy detector), then the command station must be instructed to reserve feedback bits for these external messages. Use this SO to define the overall range of feedback bits. (contained in V0.23.6 or later, only XP version) | ||||||||||||||||||||||||||||||||
33 | I2C available | OpenDDC does not honor connected I2C-Device (for instance Maerklin Keyboard), so a respective request from railware will be always answered with a value of 0. | ||||||||||||||||||||||||||||||||
34 | Switchoff time (shortcut) main | This SO defines the time OpenDCC waits after detection of a short on the main before it shuts down power.
Unit is 5ms; Preset : 6 (calculates to 30ms). | ||||||||||||||||||||||||||||||||
35 | Switchoff time (shortcut) programming | This SO defines the time OpenDCC waits after detection of a short on the programming track before it shuts down power.
Unit is 5ms; Preset : 8 (calculates to 40ms). | ||||||||||||||||||||||||||||||||
36 | External Shutdown enabled | This SO defines whether OpenDCC may be shutdown externally using Ctrl-In.
| ||||||||||||||||||||||||||||||||
37 | External Shutdown downtime | This SO defines the interval the command station ignores external shutdown requests after startup. In case the OpenDCC switched status from OFF to ON, it might be necessary to wait for some moments until an external shutdown has been reset. If not waiting, a previously issued shutdown request, e.g. issued by a shutdown booster, may still be active and result in an immediate shutdown. The command station therefore should ignore shutdown request after start for a defined amount of time. Unit: 5ms , Preset : 6 (calculates to 30ms of downtime) (available since V01.17 / XP: V0.21) | ||||||||||||||||||||||||||||||||
38 | Power Up Mode | If = 0, OpenDCC will power-up with track output disabled. If = 1, OpenDCC Z1 will enable
track output at power up. (available im FW 0.23.11 or later)
Preset : 0 | ||||||||||||||||||||||||||||||||
39 | Serial number | This SO may be used to define a serial number, so the command station can be uniquely identified. No further
use. Preset : 1 |
Loco decoder format
-
Usually, PC applications request information from the command station on how to address the loco. OpenDCC reports back all
locos using the format as defined by SO 24 (see table above). Exceptions can be defined for each loco using XLokCfgSet or by setting CV40+ (see additional tables below).
It is recommended to use 28 speed steps - 128 speed steps cause less performance and are sometimes not considered by the applications, for instance, TC makes use of 50 speed steps, only.
Loco parameters OpenDCC (Atmega32) | ||||||||
---|---|---|---|---|---|---|---|---|
SO# | SO-Name | Description | ||||||
40 | Alternate loco format (low) loco #1 |
Together with SO 41 forms a 16 bit value | ||||||
41 | Alternate loco format (high) loco #1 |
Together with SO 40 forms a 16 bit value, that get interpreted as follows:
| ||||||
42-43 | next loco | |||||||
[...] | 64 SO pairs in total |
The loco database on OpenDCC including Xpressnet also contains a loco name and a Picture ID defining a loco picture associated with the loco.
Loco parameters OpenDCC_XP (Atmega644p) | ||||||||
---|---|---|---|---|---|---|---|---|
SO# | SO-Name | Description | ||||||
40 | Alternate loco format (low) loco #1 |
Together with SO 41 forms a 16 bit value | ||||||
41 | Alternate loco format (high) loco #1 |
Together with SO 40 forms a 16 bit value, that get interpreted as follows:
| ||||||
42-43 | Pict-ID | ID of picture associated with loco; SO 42 keeps LowByte, CV 43 HighByte (available since V0.22) | ||||||
44-53 | Loco name | 8-bit ASCII value | ||||||
54-67 | next loco | |||||||
[...] | 64 loco records in total |
Important Compiler-Options
- #define PARSER
INTELLIBOX or LENZ: defines Host-protocol, Intellibox is default. - #define SHORT_TURNOFF_TIME
15ms, time until short-cut power-off is activated. Works in addition to current limitation. - #define DMX_ENABLED
0: no DMX (default), 1: include code for DMX - #define STORE_TURNOUT_POSITIONS
0: turnout positions are not saved
1: turnout positions are saved (default). - #define TURNOUT_FEEDBACK_ENABLED
0: standard S88-operation (default)
1: additional code, allowing for turnout sensoring (max. 1024 is activated) - #define TURNOUT_FEEDBACK_ACTIVATED
0: turnout sensoring not activated.
1: turnout sensoring activated. - #define DCC_DEFAULT_FORMAT
DCC14
DCC28(default)
DCC128
when addressing a loco this format is to be used - #define DCC_FAST_CLOCK
0: 'normal' OpenDCC
1: DCC Fast Clock support - #define XPRESSNET_ENABLED
0: no Xpressnet code
1: Xpressnet extension, includes Handling of both Interfaces (PC and Xpressnet) in parallel. - #define LOCO_DATABASE
NAMED: Database with address, loco name and speed steps. LOK_NAME_LENGTH denotes number of characters.
UNNAMED: Database with address and speed steps. - #define LOCO_DATABASE_XMT
0: Transmission of Loco Database using LOCXMT command.
TRAINCTRLR: Transmission of Loco Database also using turnout command address 2040 (virtual decoder).