Connecting a Computer to Your DCC System

== Benefits of Using a Computer ==
You do not need to use a computer with your Digital Command Control system, this article explains the benefits of harnessing a computer and related software to enhance your enjoyment of DCC. 
There are many benefits of connecting your computer to your DCC system. Perhaps the most noticeable benefit is for programming multifunction and accessory decoders. Using software, such as the free JMRI software suite, you can quickly and easily program decoders without learning all the complicated configuration variables of your decoder.
You can also perform automation of your layout, control signals automatically, as well as a display of your layout with train locations.
Of course, this does involve more wiring and more costs. For example, you will need to connect your DCC to your computer (see below). You will also need to setup up block detection so that your computer will know where trains are. If you are using a DCC system with transponding, some software applications can not only tell that a block is occupied, but with what rolling stock.
== Connecting your Computer ==
----
You will need to connect your DCC system to your computer through a computer interface. Your computer could have any number of interfaces. You will need to follow your system's documentation on throttle bus wiring to select the appropriate interface device. 
=== USB Interface ===
----
 Many modern DCC systems and related devices have a USB interface. This is usually a trouble free-connection to your computer, but it's possible that an older computer might have issues with a very modern DCC device. The cable to connect the two is often the common USB-A to USB-B cable, sometimes called a printer cable.
=== Serial / RS-232 Interface ===
----
An older (but still in widespread use) interface is a "serial port" or RS-232.
This interface normally comes in a male DB-9 (9-pin) connector, older computers may have a 25 pin DB-25 interface. The 25-pin interface actually makes two serial ports possible, but you typically use only one. The DB-9 is a cost reduced version with the minimum required connections. 
Microsoft operating systems label their serial interfaces as COM (communication) ports (as they were initially developed for a communications interface to a phone modem.) Other operating systems such as those based on Unix (Linux and MacOS) use TTY (for teletypewriter) to identify their serial ports
Many business, industrial or professional computers still have serial ports using DB-9 or DB-25 connections for legacy purposes, but it is rare on a newer consumer or business-oriented computers. 
=== USB to Serial Bridges ===
----
This device, which may be a small dongle or a "lumpy cable", has a USB interface on one end, and (usually) a 9-pin serial connector on the other. This allows a computer without a DB-9 serial port to connect to a DCC device that has a 9 pin serial port. The signals are converted to the correct format for communication between the computer's USB port and the serial interface on the DCC device. There are issues surrounding older versions of MS Windows and USB, so some research may be needed prior to moving toward interfacing a computer to your DCC system.
 Not all USB to Serial adapters are created equal. Some may not work correctly with the USB device or the serial port. In some cases, the extra signalling lines of an older serial port may require a null modem cable which provides the required flow control signals. This is because the serial device expects the faster hardware based RTS/CTS and DSR/DTR (Ready to Send/Clear to Send, Data Set Ready/Data Terminal Ready) signals, not the software based XOn/XOff instructions. 
The best USB to Serial converters are based around the FTDI Chipset. ESU and RR-CirKits offer adapters which will work.
=== How to Proceed ===
----
Most computers with a USB or serial port will be adequate. JMRI software is available for Apple's OS X/MacOS, Linux and Microsoft's Windows operating systems. 
ESU offers a 1.8m USB connection cable, and warns that older ESU USB adapters may not work with Windows 7. It has both D-sub and USB connectors. It is USB 2.0.
RR-CirKits offers a similar product with an adapter for 25 pin D connectors, should you need it.
==== Mac OS Big Sur ====
Apple has made internal changes to the MacOS Big Sur which have rendered many USB to Serial bridges useless by deprecating their drivers. If you are contemplating upgrading to a newer version of the Mac OS, verify that the interface you are using is supported. Many third party drivers have not been updated. Some may never be.
This situation should improve during 2021 as vendors release updated drivers compatible with Big Sur.
===Computer Interfaces===
Consult the Computer Interface List for available devices compatible with your DCC system.
==== Multifunction Decoder Programmers ====
There are a number of specialized devices available that allow easier programming and updating of multifunction decoders. Some also offer the ability to load and manipulate the sound files, or update the decoder's firmware. They are standalone devices which do not require a command station or booster to function.
The LokProgrammer from ESU is an example of a programmer for ESU's decoders. As the more recent LokSound decoders can have in excess of 100,000 CVs to adjust, the Lokprogammer with its software can do this quickly and effortlessly.
Several other manufacturers, such as QSI, also offer devices to program their decoders.
===Troubleshooting an Interface Device===
A typical complaint is that the computer cannot find the interface to your DCC system.
 
Frequently the culprit is an old device lurking in your operating system that is confusing your new device driver. To clean up old device drivers, search the web for, "removing old device drivers from <your OS>", and follow those directions. 
It is possible a vendor supplied software tool for configuration has installed itself as a background service. It will capture the communications port and prevent other software from using it.This is a known issue with software from Lenz.
====Java====
If Java based software such as JMRI will not start, check the version of Java is the correct one.
This is done using the command line, the command is java -version. It will return the version of Java installed.
Also, when updating Java, it may be necessary to remove the previous version before updating. Multiple installations of Java can cause problems. Instructions for removal of Java can be found on the web.
==== NCE USB Issues ====
Many use an ESU cable built around the FTDI chipset with their NCE Power Pro. The UN8-BE from RR-CirKits is similar.
=== Counterfeit Devices ===
==== USB Bridges ====
 Sometimes a USB to Serial interface does not work. One reason is that the USB interface IC (USB Bridge) in the adapter is a counterfeit. The most commonly counterfeited USB Bridge is the one developed by Future Technology Devices International. FTDI did update their drivers, and those drivers will not work with an IC not made by FTDI. In many cases the drivers for MS Windows 10 do not work with counterfeits. 
If your generic USB bridge cable doesn't work, the most like reason is the driver from FTDI has disabled it. Contact your device's manufacturer for guidance.
==Notes==
Some material comes from the JMRI website. If you are interested in using the JMRI suite of tools, visit their Website to see what you need.
=== USB Device Drivers for Windows ===
Many JMRI users report issues with Microsoft's Windows 11 and drivers. See this website for various drivers:
* OEM Drivers
==See also==
* DCC Software - Software which talks to DCC layouts
* Computer Interface List - Lists all of the computer interface types
* You may also be interested in the page on Binary, the numbering system computers use.
Category:Software
Category:Hardware
Category:Automation
Category:Introductory guides
Category:Computers and DCC