OpenDecoder - FAQ and Change Log

FAQ - Frequently Asked Questions

    From time to time the same questions are asked over and over again. These questions and the answers to them will be listed in this section.

  • The led of the decoder flashes .. what does that mean?
    The LED is used to display an internal state of the decoder. Fast pulses and pauses are used to code the message. The following flash codes exist:
     1  ----x----x---- Switch 1 was not thrown.
     2  ----x-x----x-x---- Switch 2 was not thrown.
     3  ----x-x-x----x-x-x--- Switch 3 was not thrown.
     4  ----x-x-x-x----x-x-x-x--- Switch 4 was not thrown.
     5  ----x-x-x-x-x----x-x-x-x-x--- An address isn't yet programmed. This is the default state when the firmware was loaded, this also applies when the decoder was reset.
     6  ----x-x-x-x-x-x---- Wrong mode, the selected mode is not supported by the firmware that was loaded into the decoder. (For example when DMX was selected for a ServoDecoder.)
     X  -|-|-|-|-xxxxx Very fast blinking: internal values are copied during a preset or a reset command. Do NOT remove power from the decoder until copying is completed.
  • I set the address with a CV but the decoder doesn't respond.
    There is a difference between the address of the decoder and the address of a switch. If the decoder is programmed using the push-button method then the central unit will send the address of the switch that is thrown. When the decoder is programmed using CV's (CV513 and CV521) the decoder address will be set.
    This difference (which results from the DCC standard) is explained at Switchdecoder.
    A CV calculator that does the low-level calculation is available at CV
  • The LED keeps flashing (5X) although I set the adress using CV513?
    This is caused by an 'hidden' bit in CV521; CV521 is the 2nd part of the address, but not all bits are used for the address. One of these unused bits is set to '1' when the decoder is not programmed yet. If this bit is detected, the decoder will flash (5x) to indicate that an address has not yet been set. The decoder will stop flashing when the address is written completely (either by the push-button method or by reprogramming CV513 and CV521).
  • I don't see the point with that digital address. Please explain what is what?
    The DCC standard can handle up to 511 function decoders and every decoder can have up to 8 outputs. Each of these outputs can be active or inactive. So far for the theory.

    Normally two outputs are paired together, for example to throw a switch. It is nescessary that these output turn off each other, otherwise the switch will run into problems. To avoid an burned switch drive, a decoder normally deactivates an output after a certain time.

    This has two consequences: Many command stations (and PC control programs) bind these two outputs to a new address (turnout address). So this couple is no longer addressed as deocder and a subgroup, but directly through the 'turnout (switch)' address. There are 2046 possible addresses. Because the decoder turns off independently the shutdown command is not handled carefully -- e.g. hte IB doesn't send the shutdown command at all.

    So what to do at the decoder side: If you want to turn on/off a single output, you can't rely on the switch off command from the master. Therefore on/off is typically implemented with two turn on commands on adjacent addresses (like a turnout).
    This enables a decoder to be compatible with any command station.
  • I use 4N25 as optocouplers, nothing is working.
    The 4N25 is really slow and needs a lot of current to turn off again. Please use a smaller pullup (about 1k).
  • Are there preprogrammed processors for OpenDecoder2 and 3?
    Unfortunately no, at least not with me - I can only program soldered chips and unfortunately I cannot do this for others.
  • The decoder is so complex, Is there a way to configure it in a simple manner?
    In general the predefined setting are sensible. The settings are loadable just with the simple push-button programming and sending an according turnout command. If a special setup is required, one of the following programs (with more or less sophisticated gui) may be used for the configuration: Unsuitable is DecoderProgrammer from Henning Voosen, This program is not designed for complex accessory decoders.
  • My servos move only in a range of 0-45°. What could be wrong?
    This is due to the servos. Unfortunately, some manufacturers do not obey the standard range 1ms to 2ms. From version 0.9 on there is a CV-bit in the firmware: 'extended range' - this extend the range of the control pulses to 0.5ms ... 2.5ms.
  • I'm using only DCC alone, no extra power supply. How should I do the wiring?
    Just add a bridge between power and DCC (this could be done as solder bridge on OpenDecoder2). I also recommend to reduce the capacity of the main condenser the reduce the inrush current.
  • The readout of the decoder with the Intellibox takes a long time!
    Well, that is up to the IB. The IB scans at each CV all possible data words (up to 256). And this takes some time when reading many CVs.
    My command station implements a more intelligent approach: First of all, I'll do a test on the ability of the decoders on bit programming. If yes, the readout is performed with only 8 queries for a complete CV. More over, my command station remembers this ability for about 0.5s, so the next read command needn't test the bit programming.
  • PoM programing does work (with TwinCenter)!
    The TwinCenter uses a depracted version of the PoM command (see RP921, Appendix A).
  • I want to use the code or parts of it for my private project, what are the rules?
    Open decoder is not freeware, but is subject to a license (gnu). This allows private use free of charge. For commercial use and and further development please obey the license conditions. I may give licences to commercial providers, eg OpenDecoder3 is available from Tams electronics .
    You will find source code is either here or on sourceforge.net .
  • I loaded the eagle file, but there are lines in printout, causing short circuit!
    This is a peculiarity of eagle. copper planes are only stored as outline in the file and must be recalculated after opening the file. This is done with the ratsnest command.
  • These processors are interesting, how does it all work?
    First, you need the appropriate programs (all free of charge). For getting started it is recommended to do simple project like this booster controller . Just load and compile it.
  • I would like to translate on my own. So what is now what source?
    The software for the OpenDecoder1 is always contained in one file, each decoder has its own file. (Reason: thus the compiler is able to do the best optimization and the the result code could fit even in a small chip like a ATtiny2313)
    For OpenDecoder2 and -3 the software is split up into modules, which are all included in a project. The generated variant is chosen by compile switches in config.h . Simply set the according variable (eg SERVO_ENABLED) to TRUE. Unfortunately, not all software mudules simultaneously fit in the Atmega8515, so it is necessary to select either standard decoder , servo decoder or DMX decoder .
    A speciality is Signaldecoder2 : Unfortunately, there was a fundamental change of interrupts. So this software is a separate project.
  • After programming the fuses the processor is no longer recognized.
    Caution If the Atmel is fused for external clock, and if there is no clock source or only a quartz connected to the chip: the chip will not react! Solve this by applying a signal with frequency of about 100kHz to 10MHz to XTAL1. The processor is recognized again and you can reprogram the fuses.
  • It's a pity, but SMD is too small for soldering.
    Klaus Kemkes did a reconstruction of OpenDecoder2 (except for feedback) with DIL modules and single sided layout. circuit description of Hardware2 / V2.1 / DIL.
    Tams electronics will offer OpenDecoder3 (either servo or DMX).
  • I soldered the processor with wrong orientation, how can I unsolder it?
    If you do not have professional tools, you may use the following trick: Insert a thin coated wire under the pins of one side and fix down one end of this wire. Starting at the other end of the wire gently pull the wire to the outside, while simultaneously heating the pins. Thus, a complete side of the device can be opened like a zipper. The device and the board takes up no damage.
  • How can I operate switches with motor drives?
    This can be done either with a downstream relay (bi-stable) or with a transistor stage . Christian Wichmann has created a decoder layout for this.
  • My roco turnout drives sometimes do not throw, why?
    Roco turnout drives are not really well known for their reliability. Moreover, their current requirement is at the upper limit of the ULN2803 driver. In addition, they show a large variation in the required voltage necessary for throwing - my measurements show results from 7V to 15V .
    Taps:
     - doubling of the ULN2803 (just solder a second chip piggyback) increases output current.
     - increase the fuse from 0.8A to 1A.
     - Supply the decoder with 16V AC or 18-20V DC.
  • Manual adjustment doesn't seem to work correct - only small steps occur from time to time, why?
    Manual adjustment moves the servo one step (CV579). And here get the trouble: IB and roco mouse 'bomb' a lot of turnout command when a key is pressed. OpenDCC generates only 2 to 3 - all above is waste of bandwidth. If the increment in CV579 is large, the servo will move too fast with IB, if it is too small, adjustment with OpenDCC takes some time and repeatingly pressing the turnout button.
  • I built the servo decoder, but it crashes!
    This is a problem in the power supply and depends on the used servo. The inrush current of the servos may be so large, that the 5V supply of the atmel drops and forces a reset of the controller. Possible counter measures:
    • Separate power supplay for the servos
    • Lower brownout voltage of the AVR, 2,7V should work.
    • Buffering caps across the power supply of the servo
  • How can I actively participate in the project?
    You're welcome. Help with programming, testing, and translation is always appreciated. There is a (registration required) Yahoo Group, where you can learn more: http://groups.yahoo.com/group/opendcc/


-- more to come

Change Log and Release Notes

    Here is the change history. Open decoder is a non-commercial project (I do this in my spare time) - so I ask for leniency, if not everything is tested completely and perhaps one or the other bug is contained. But I hope for support with testing and constructive criticism is welcome. Thank you all those who contributed to the project so far.
  • OpenDecoder V0.13, 29.06.2011
    • Bugfix in multi position servo, last position was not stored correctly.
  • OpenDecoder V0.11, 05.05.2009
    • The delay time (servo decoder) introduced in V0.10 led to CV-reading problems when there is no external power supply. Due to the delay, it takes too long after a power-up until DCC commands are recognized. Now the DCC is already activated during this delay, however, switch command are not yet evaluated, only programming commands.
    • A different power up sequence could be selected with CV555, bit 6. This different sequence could reduce power movements of some servos.
  • OpenDecoder V0.10, 13.01.2009
    • special init sequence for servo, this gives small or nearly zero unintented movement on most servos.
    • delayed power up of servo motors (only if switches on board are fitted).
    • LED will light dimmed during delay.
  • SignalDecoder V0.4, 13.01.2009
    • minor bugfix in addressing together with running lights
  • OpenDecoder V0.9, 01.10.2008
    • new: support for hardware 2.5 (Servo only)
  • SignalDecoder V0.2, 28.05.2008
    • added: write to CV8 resets the decoder
    • added: internal states are saved to eeprom 3s after the last DCC command.
      The decoder restore the last output status after power up; this does not apply to internal states like blinking ..
  • all decoders, 08.02.2008
      Change in preamble detection: the old crteria (> 10 'one' bits) for the preamble was changed to >= 10. This is the minimum number in the NMRA recommondations.
  • OpenDecoder3, DMX-2, 26.01.2008
      DMX decoder update: now 72 virtual decoder, but 18 entries per macro.
  • OpenDecoder2, V0.6, 09.01.2008
      - copying the extensions of OpenDecoder3 for DMX (to the extent possible). A write access to CV8 makes decoder reset. This immediately returns an ACK, the copying of all CVs follows immediately.
      - 09.01.2008: When reading turnout feedback, first the read line is discharged to clear any unwanted spurious signals.
  • OpenDecoder3, DMX-1, 09.11.2007
      Extension of DMX decoder with virtual channels for relay control. Each DMX channel (24-27) controls one relay. Furthermore, there is the possibility to load predefined scenarios. Also new: Thunderstorms simulation.
  • OpenDecoder3, DMX-1, 02.11.2007
      Extension of DMX decoder with CVs for initial state. The commands 'all on' / 'all off' now stop every everything '/' everything 'is now Also any ongoing macro application is aborted.
      A write access to CV8 makes decoder reset. There is an ACK returned.
  • SignalDecoder1 V0.9, 24.10.2007
      Duplicate address detection removed (bugfix), no functional changes
  • OpenDecoder2 V0.05, 19.09.2007
      CV mapping error in DMX, no functional changes

Planned extensions

  • Stepper motor decoder
  • Load regulated motor decoder

Intellibox is a registered trademark of the company Uhlenbrock