Decoder Programmer (DECPROG)

Hardware Version 4 released May 2004

October 2004 -new software for Windows NT/2000/XP now available

A low cost, easy to build, substitute for the Digitrax® PR1

copyright Bob Backway 2004


While most Command Stations on the market can program decoders I don't like the idea of having to interrupt railway operation in order to program or reprogram a DCC decoder. This would be particularly annoying if somebody arrived in the middle of an operating session only to find they have an address clash.With a seperate programmer any maintenance can be done away from the layout at leisure. I also find the software that is available free of charge for this programmer is far easier to use than a sequence of button combinations on a command station.This circuit has two main differences when compared to Wayne Rodericks pioneering effort. First it has its own dual rail power supply. For the small extra cost the circuit will work with all PC's including those with 0-5 Volt "almost" RS 232 serial ports. It will also not load a serial port unduly with the associated risk. The second difference is it's all done with one chip, a quad FET Operational Amplifier, allowing easy construction. This is a beginners Veroboard project. Idle detection is provided to shut down the output when no signal is being sent from the PC. This prevents decoders that have DC mode activated from driving their loco off the end of the programming track!

Version 3 has modifications by Patrick Froucht from France refining the loco detection circuitry. The modification adds an extra resistor and changes the value of another, both connected to pin 9 of U1.

Version 4 has modifications by Josef Fritsch from Denmark adding a power indicating LED and a piezzo speaker to the acknowledgement circuitry.

This circuit is provided for individual use only. Commercial production of this circuit may only be undertaken under licence from ADCC.

If you do not wish to build your own DecProg it is now being produced under licence by:

Click to purchase a DecProg

Parts List

1 x TL074 OR LF347 Quad Low Noise JFET operational amplifier
1 x 14 pin solder IC socket
1 x BC337 Transistor
2 x BC327 Transistor
2 x 1N4004 1 Amp power diodes
3 x 1N4148 small signal diodes
1 x Red LED
1 x Green LED
5 x 1Mohm resistors (brown, black, green)
1 x 220K resistors (red, red, yellow)
1 x 100K resistor (brown,black,yellow)
3 x 10K resistors (brown, black, orange)
1 x 1K5 resistor (brown, green, red)
2 x 1K resistors (brown, black, red)
2 x 120 ohm resistors (brown, red, brown)
1 OR 2* x 15 ohm 1 Watt resistor (brown, green, black)
2 x 1000uF 16VW electrolytic capacitors
2 x 0.01uF capacitors (marked 103)
1 x 0.015uF capacitors (marked 153)
1 x 100pF capacitors (marked 101)
1 x 1A AC plugpack power supply with an output voltage of at least 9 Volts AC but preferably 12 Volts AC
1 x Piece of 0.1" spacing veroboard OR make your own PCB with the artwork provided below
3 x 2 terminal PCB mounting terminal block
1 x 9pin female "D" connector OR 1 x 25pin female "D" connector (see construction section)
1 x 12Volt 18Watt automotive globe
1 x Male to female 25 pin "D" serial cable
A few bits of insulated and uninsulated wire
* a 15 ohm resistor is also used as a motor load if you wish to program a decoder prior to installation.

For Version 4 add:

1 x Piezo Speaker
1 x 1K resistor (brown, black, red)
1 x Green LED

Printed Circuit Board Artwork

Peter Heeno, from Denmark, has kindly provided the following artwork for those who wish to construct the project on a PCB rather than Veroboard. The files require Adobe Acrobat's reader which is freely available from their site. The printed circuit board can be easily modified for version 3 - just make the changes as per the new circuit to the resistors at pin 9 of U1.

Click here for the PCB component layout.

Click here for the PCB component side artwork.

Click here for the PCB solder side artwork.


Described below is construction using Veroboard. If you have built a PCB using Peter Heeno's artwork use his component layout and skip to the next paragraph. Please note that the component layout drawings are shown from the component side, not the copper track side. The copper tracks are shown dotted as they are on the underside of the board. Take care drilling out the copper tracks under the board as marked by the red crosses. It pays for beginners to mount and solder one component at a time counting holes as a grid reference to component location.

If you make a location mistake use Soderwick to soak up the solder and make for easy removal. I use a socket for IC's and normally place these first, then the lower profile components such as resistors and progressively work up to the larger components. This allows access into small spaces and places less stress on the larger components.

Click here for the Veroboard layout for Version 3.

Click here for original board picture

Click here for overall picture

If your older PC has a 25 pin serial port connector use the following conversion table to mark up the circuit diagram:

Purpose Tx Rx RTS CTS DSR Gnd CD DTR
9 pin 3 2 7 8 6 5 1 4
25 pin 2 3 4 5 6 7 8 20


Waveforms at various points are shown on the circuit for those lucky enough to have access to an Oscilloscope (CRO).

Before inserting the TL074 into its socket and applying power check clearance between tracks for shorts. Then apply power and measure voltages at the following TL074 IC pins when referenced to ground which is pin 7 of the "D" connector. On Pin 4 of the TL074 socket you should measure +13.5V, pin 11 -13.5V, pin 6 1-2V, pin 2 0.6V, pins 1,3,5,7,8,9,10,12,13,14 should be 0V. If the voltages test out OK power down, plug in TL074 and power up again. If no smoke escapes connect the unit to your computer and run one of the programs referenced below.

With the software running either package will indicate the presence of the programmer on plugging the serial cable in. Ensure you have the correct settings for the PC communications port. Both packages output loco detection bursts when idle. Placing a 1K0 resistor across the programming track should cause the green LED to flash and satisfy the loco present indicators on the screen.

Short the track for a second or so and both LED's will light indicating Acknowledgement detection. If all apears well try a decoder by connecting its red and black leads to the track and with a 15R resistor attached to the grey and orange motor leads. Loco present should show and by doing a read both LEDS will flash as the reading progresses. The values read on the screen should be as expected. The two programs have slightly different flash patterns.

Have a go at programming. Each package has its own little quirks, you'll eventually prefer and defend one to the death :)

Circuit Description

Click here for circuit for version 3
Click here for circuit for version 4

While browsing my DCC Sources I came across Lars Lundgren and the TMW groups Mini Booster. This gave me the inspiration for a simple programmer and I thank them for their good work. A FET opamp powered by a dual power supply allows input and output pins to swing between either rail. This enables direct RS232 input connection, simpler connection to transistor drivers, capacitorless AC connection, simpler biasing and an RS232 compatible output.

The circuit is powered by a 500mA AC plug pack in the range from 9 to 12 Volts. The AC current is rectified by two power diodes and smoothed by two electrolytic capacitors referenced to ground thus providing dual +/- power rails of 12 to 15 Volts depending on the plugpack.

Both software packages check for the presence of the programmer. This detection is satisfied by looping the serial port RTS signal to the CTS return pin and looping the DSR signal back into the DTR pin.

Data transmitted from the PC is presented to pin 5 of U1b. This data is referenced against a voltage of around two volts present at pin 6 established by 1M and 220K resistors. The output, pin 7, will swing from one power rail voltage to the other in unison with the input RS232 signal. Using a two volt reference causes the output to swing even if the input RS232 is only swinging between zero and five volts rather than the standard which stipulates voltages between +/-3V and +/-12V. An idle detection circuit monitors the output of pin 7. If this point remains at -12 Volts for a period greater than a DCC "ones" positive cycle the 0.015uF capacitor will charge via the 100K resistor to a voltage sufficient to turn on the second BC327. This transistor will then ground the base of both output transistors via a diode thus shutting it down. With both tracks close to ground a loco with DC mode enabled has no DC to run. The first positive pulse of a DCC signal output by pin 7 will remove the idle shutdown.

The FET op amp output directly drives the output transistors without the need of bias resistors. The signal is then fed to the decoder, or the decoder equiped loco, via a 12V 18W auto globe which provides some short circuit protection.

The return from the programming track is presented to a 15 ohm 1W resistor connected to ground. Current passing through the decoder must also pass through this resistor. Two circuits measure the voltage across this resistor created by the decoder current.

Op amps U1c and U1d form the loco detect circuit. U1c will provide output pulses if a small voltage is present across the 15 ohm resistor due to the current through the decoder caused by the loco detect pulse bursts sent by the software during non programming periods. These pulses are integrated and delayed by the 1M resistor and 0.01 capacitor between U1c and U1d. Being referenced to ground, U1d buffers the integrated signal and outputs an RS232 compatible signal via a 120 ohm resistor to the PC's serial receive pin 3.

U1a forms the acknowledgment detector. The opamp is provided with a 600 millivolt reference via a 10K resistor and a forward biased diode. Any voltage present at pin 3 above a 600mV threshold caused by an acknowledgement short circuit pulse increasing the voltage accross the 15 ohm resistor will force the output of U1a to swing from -12 to + 12 Volts for the same period and provide an RS232 compatible acknowledement signal via the CD line to the PC serial port.


Software for the PR1 and DecProg is available from the following sites. May we all take the opportunity to thank these gentlemen for their contribution to DCC by providing this software in the public domain.

Thomas Borrmann has written ProLok for Windows NT/2000/XP
Click here for installation information including installation of the English or Dutch language version

John Kabat has written DOS software, PR1DOS

Hans Tanner has written MSWindows software

The following decoders have been programmed by DECPROG

Make Model Success Thankyou
Arnold 81200 and 81210 Yes Ernst L
CT-Elektronik SL51-2 Yes - ProLok Adriano T
Digitrax DH 84 Yes Piet L
" DH 120 Yes Dave P/Gerry H
" DH 121 Yes Dave P/Gerry H
" DH 140 Yes Bob B
" DN 93 Yes Bob B
" DN148K Yes David H
" DZ 120 Yes Dave P
EasyDCC AD4 Yes Dave P
ESU LokPilot (50600) Yes Peter K
"  LokPilot 56000 Yes Ernst L
"  Lokpilot V 3.0 Yes Franz K
Kuehn No25 Yes - Prolok Frans S
" T125 Yes - Prolok Paul L
" T145 Yes - Prolok Paul L
Lenz 0521 Yes - Prolok Frans S
" LE077XF Yes Peter H, Piet L
" LE080 Yes Piet L
" LE100 Yes Bob B
" LE103KDUS Yes Gerry H
" LE103XF Yes Dave P/Gerry H
" LE230 Yes Frank v T
" LE1014 Yes Russ M
" LE1025 Yes Russ M
LGB LGB MTS 55020 Yes Frank v T
MERG (DIY) Decod 10 Yes Piet L
MRC AD-305 and AD-315 Yes Paul O
North Coast Engineering D102-EU Yes Ross P
" D102-US Yes Gerry H
" SW-9/12 Yes Ross P
QSI Broadway Limited Yes - except for CV1 Paul O
Roco 10742 Yes Peter H
TCS A1X Yes Aaron M
" M1 Yes Aaron M
" MC2 Yes Aaron M
" T1 and T141 Yes Paul O
" T3X Yes Aaron M
Zimo MX61 Yes Dave P
" MX62 Yes - Prolok Frans S
" MX64 Yes Piet L

Click Here and let me know what makes and models of decoders you've had success programming (or otherwise) so that the above list may expand.

Click here for a view of the protype!

Back to DCC Articles Menu
Back to ADCC home page

© ADCC 2004
18 November 2008