Programming

Basic programming

The decoder address and switch activation time can easily be programmed by pushing the button on the PCB. After the button is pushed, the decoder waits till it hears a valid switch command. The decoder will store the switch address included in this command in EEPROM, restart, and use this address as its new decoder address. Note that decoder base addresses for switches always start with 0, 4, 8, 12, 16, ...(in case SkipEven is set: 0, 8, 16, 24, 32, ...).

If, after the button is pushed, the address included in the next switch command is equal to one of the base addresses mentioned above, the activation time for the switches will be 200 ms. If the address included in the switch command is one higher than a base address, the activation time will be 500 ms; if it is 2 higher the activation time will be 1 second and in case of 3 higher it will be 2 seconds.

Configuration Variables

The decoder can also be programmed using Configuration Variables (CVs). The table below shows the various CVs that are implemented. Most CVs are identical to those of the OpenDecoder switch decoder, except for the following:

  • LenzCor is included to correct "errors" made by LENZ LZV100 master stations.
  • It seems the Lenz LZV100 does not send correct addresses. In general, LENZ starts with 1, instead of 0. More problematic is that, if the received address is exactly 0, 64, 128 or 192, the address is 64 to low. To compensate this, a special LENZ compensation CV was added. Usage of this compensation is needed in case the decoder uses more than one (consecutive) address (such as the case if we skip even addresses), or provides RS-bus feedback.
  • This correction is not needed if the decoder is used in the traditional way (controlling four switches via four subsequent addresses, no RS-bus feedback).
  • SkipEven allows to "skip even addresses". The motivation is that the RS-Bus, like several other feedback buses (including XPressnet) has fundamental problems if the position of multiple switches is signaled via a single message. If SkipEven is set, the switch addresses of the decoder are 1, 3, 5 and 7 instead of 1, 2, 3, 4. Note that usage of SkipEven reduces the maximum number of switches that can be used with 50%.
  • RSRetry determines the number of times the same RS-feedback nibble will be retransmitted (forward error correction). If the value is 0, no retransmission takes place.
  • CV546 (global feedback mode) has an additional value, indicating that feedback will take place via the RS-bus.

Remote programming

For the near future the idea is to develop a computer (MAC-OSX) program to ease programming of the various decoders. That program will use the Lenz LI-USB-Ethernet (Lenz part number 23151) interface. Once that program is available, information will be posted here.