OpenDCC OpenDecoder - a DIY DCC accessory decoder

Overview

    In parallel to the open source project command station You will find here some do-it-yourself DCC decoders.
    These decoders are based on Atmel AVR. There are three different versions. A more simplified version built with ATtiny2313 (version 1), a more sophisticated board with ATmega8515 (version 2) and a high performance board with ATmega162, equipped for DCC-BiDi (version 3). All versions are programmed with C, but differ of course in memory size of the chip and thus also in the varity of the implemented function.

    A special advandtage of these decoder and the programming in C is the possibility to easily create a full customed decoder for special applications. We use these decoders in a large number on our club layout.
    Platine OpenDecoder
    Decoder Version 1 Decoder Version 2

Hardware

    There are four different main hardware platforms:
  • Hardware 1:
    This simple hardware platform is based on Attiny2313 (2k Flash) and dimensions 50*80mm (one sided layout). There are large screw clamps, a programming tracer, a LED, one extra jumper and separated supply on the board. The DCC input is done with an opto coupler. All components are through hole parts.

    Depending on the used software different decoders can be realized:
    TypeApplication
    Turnout and Switch Decoder control of turnouts or wing signals
    programmable pulse durations
    switch of simple light signals
    control of a traffic light
    Signal Decoder control of light signals, up to 7 aspects
    including dimming and intermediate dark phase
    crossing light with additional control for Faller Car
    traffic light with control of stopping magnet for Faller Car
    Ligth Decoder Up to 8 street or building illuminations
    simulation of neon tubes
    random processing for day-night processing
    NatriumDecoder Street lights
    with simulation of sodium vapor lamps, including a randomly defective bulb
    Effects Decoder Road working flasher, running light
    light column for advertisment and fun park, including smooth transitions
    Motor Decoder special decoder for controlling a river boat
    with pwm and local tracers for operation
    Watchdog Decoder Settable time until shutdown of the model railway in case of a failure of the computer or the central station.

    A special version with dimensions 18 * 200mm can be used as signal bridge in a hidden yard. This version has onboard LEDs in red and green for four light signals.


  • Hardware 2:
    This decoder is based on ATmega8515 (8k Flash, 512 bytes RAM and 512 bytes EEPROM). This board uses partly SMD, but still with fairly large components thus allowing for manual soldering.

    The board again has the dimensions 80*50mm (two sided layout), large screw clamps and same mounting holes like platfrom 1. There are 8 (main-)output or 8 inputs. An acknowledge pulse can be fed back on the DCC side. The interface to DCC is completely opto coupled and depending on solder jumper the board is supplied from DCC or from a separate power source.
    There are two connectors for servos and alternatively a DMX interface can be fitted (both TX and RX). Motor control is possible with an add-on card.
    Additionally, there is also a version of hardware2 without SMD and a stripped down version only for servo control.
    The decoder is fully programmable through CVs, thus can be operated as NRMA compatible accessory decoder. (but needn't :-).

    There is following software for decoder 2:
    TypeApplication
    Dual Servo Decoder movement of any accessory parts on the model railway
    i.e. flags, barriers, whips, goals
    freely defined curves for time and location resulting in realistic movements.
    Special precautions were made to achieve a servo movement with no ripple. Two servos can be connected.
    Multiposition Servo Decoder movement of any accessory parts on the model railway
    up to 8 different target positions, no intremediate stop, smooth operation (either linear or with soft acceleration and brake). Manual operation is also possible.
    Turnout Decoder with Feedback Control of turnouts and surveillance of the real position
    feedback of non-functional turnout to the central station and/or forcing an emergency brake. programmable pulse duration, control of flags.
    DMX Decoder versatile decoder for room lights with DCC to DMX Interface
    and flexible macro programming, similar to the
    room light control in the central station.
    Comes togehter with a watchdog controller.
    Roundabout-Decoder flexible decoder combining motor control and light control, specially for roundabouts and entertainment parks.
    different running lights, motor control with PWM
    Semaphore and light decoder freely programmable semaphores with up to 16 aspects;
    traffic lights, rail crossing, blinking;
    light effects like light column, running light, nightrider, flashing, double flashing
  • Hardware 3:
    This decoder is based on ATmega162 (8k Flash, 1024 bytes RAM and 512 bytes EEPROM). This board uses mostly SMD, but still with fairly large components thus allowing for manual soldering. It will be available of the shelf.

    The board has the dimensions 73*82mm (two sided layout), large screw clamps on one side and selectable DMX Easynet or XpressNet on the other side. Loconet will be possible after getting the license issues solved. There are 2 servo outputs, 4 relais outputs and 4 inputs. An acknowledge pulse and/or NMRA BiDi can be fed back on the DCC side. The interface to DCC is completely opto coupled and depending on solder jumper the board is supplied from DCC or from a separate power source.
    The decoder is fully programmable through CVs, thus can be operated as NRMA compatible accessory decoder. (but needn't :-). BiDi (RailCom) will be avaiable.
    From 2008-02 this decoder is commercially available. Tams offers two versions: SD-22 (Servodecoder) und DMX-1 (DMX-Decoder).

    There is following software for decoder 3:
    TypeApplication
    Dual Servo Decoder movement of any accessory parts on the model railway
    i.e. flags, barriers, whips, goals
    freely defined curves for time and location resulting in realistic movements.
    Special precautions were made to achieve a servo movement with no ripple.
    Including four relais for polarisation of the frog of a switch.
    Multiposition Servo Decoder Smooth operation of one servo with up to 8 direct addressable target positions. i.e. for a segmented turntable
    DMX Decoder (planned) versatile decoder for room lights with DCC to DMX Interface
    and flexible macro programming, similar to the
    room light control in the central station.
    Comes togehter with a watchdog controller.
    Relais Decoder Individual control of four Relais
  • AniMat:
    This unit is also usable as decoder and is based on AT90can128 (128k Flash, 4096 bytes RAM and 4096 bytes EEPROM). This board uses SMD with small components and requires some experience with soldering.

    The board has the dimensions 80x50mm (two sided layout). It comes with 2 servo outputs, 8 general purpose outputs and inputs. Two H-brigdes are for motor control. Sound could be played with an microSD card and a mp3-chip plus audio power amplifier. An acknowledge pulse and/or NMRA BiDi can be fed back on the DCC side. The interface to DCC is not opto coupled and depending on solder jumper the board is supplied from DCC or from a separate power source.

Software:

  • Turnout and Switch Decoder:
    (for hardware V.1)
    This implements a conventional decoder with four outputs for either turnouts or light signals. The pulse duration is programmable: 0.25s, 0.5s 1s and 2s can be selected. Addtionally there are modes for signals with 2, 3 or 4 aspects and a traffic light.

    the download contains precompiled versions for 10MHz and 8MHz CPUs.
  • Turnout and Switch Decoder:
    (for hardware V.2)
    This software has the same functionality like the decoder above (execption: no signals with more then two aspects), but adds CV programming and all NRMA commands. The real position of a turnout is detected, defective turnouts are displayed.
  • Signal Decoder:
    (for hardware V.1)
    This software acts as special decoder for light signals. Nearly every type of signal can be controlled (with two or more aspects). Currently implemented are signals of the DB with correct dimming and a short dark phase between aspects.
    You will find a good overview on different aspects at www.stellwerke.de
    If main signal and announcing signal are mounted on the same place, the announcing singal must kept dark, if the main signal is showing stop (Hp00) or intra station traffic (Sh1).
  • Light Decoder:
    (for hardware V.1)
    This software implements a special decoder for light control. Each output can be controlled either individually or as a group with random delays for turning on or off. An application is the lighting of lamps during dawn. This intended to be used together with the room light control of OpenDCC. Another mode simulated the turning-on of complete street, including the typical starting sequence (flickering) of fluorescent lights.
  • Effects Decoder:
    (for hardware V.1)
    This software implements a special decoder for light effects, mainly running lights and light columns. All modes use a flexible timing engine, which implement the dimming between different outputs with a predefined curve. A typical application are running flash lights like used on road construction sites.
  • DMX-Decoder:
    (for hardware V.2)
    Decoder for room lights with DCC to DMX Interface and flexible macro programming, similar to the room light control in the central station. Additional inputs for manual control and watchdog.
  • Watchdog Decoder:
    (for hardware V.1)
    This software implements a special decoder for surveillance of computer control of the model railway.

    After power up the supply of the track is turned on. If a dedicated accessory commands is sent to this decoder, the power will remains active for another two seconds. If this command is repeated, the active time will be prolongated for another 2s. If the command is not sent for more then 2 s (i.e. because of a failure of the pc or the contral station), power is turned off and kept off.
    Together with Railware or Traincontroller the correct operation of the pc and the central station can be controlled. Additionally a external trigger input can be used to connect a standalone emergency stop, which act redundant to the regulary computer control.
    If a emergency stop is issued, the following things will happen:
      track power is turned off
      a message is sent to the pc
      an alarm (either blinking light or honk) is turned on for a short time.
  • Motor Decoder:
    (for hardware V.1)
    This is an example special decoder for a dedicated problem. A river boat has to be moved between to endpoints. The motor is driven by a high frequency PWM and smoothly accelerated. Light barriers and tracers are used for detecting the current position and manual control.
    Motordecoder Programm V0.2
    Besides the examples above it is not difficult to construct an own decoder for special requirements. OpenDecoder ist written in C and clearly divided in DCC receiver, decoding and action code. basic funtionality for dimming and blinking may be used as well.

    In the mean time I got some reports about modified usage of the decoder: inverted outputs, relay switch outputs, with H bridges driving motors and as accessory decoder with 8 outputs.

    gcc (WinAVR) was used as development platform. The required tools are open source and may be used free of charge. Here you will find information on getting started. And this page gives some explanation on the software.

Copyright:

    The software is released under gnu public license. If somebody is designing a new decoder, I would like to publish it here.

    If You do only a copy of the designs I consider it fair that You help the project - You may perhaps translate some documentation or give a donation for the costs. Contact me at () or use paypal.

Documents / Links