# Parallel port directly output DCC?



## th1alb (Apr 17, 2008)

The DCC-MB project still requires a quite complicated board to generate DCC.

Wouldn't a parallel port be fast enough to generate DCC compatible signals by itself?

Then a much simpler booster design could be used, ultimately creating the cheapest command station, provided the software is competent.


----------



## Lownen (Mar 28, 2008)

th1alb;

Welcome!

First, DCC is a serial protocol, not a parallel one. But serial port chips are designed to operate at a constant baud rate. DCC is not a simple square wave like most digital signals. DCC is a +/- signal whose amplitude (voltage) depends on the scale of the locomotives being driven. Most starter sets are +/-14v for HO and N scale, though in actuality this is on the high side for N scale.

The signal is +/- so that it will be the same, except for phase, regardless of the way that the locomotive is facing on the rails. For this reason DCC cannot use a "high" for one and a "low" for zero; reversing the loco on the rails would change ones to zeros and vice versa. Instead DCC uses varying pulse widths to represent ones and zeros. Narrow pulses are ones and wide pulses are zeros.

I have never heard of any Digital Signal Processor (DSP) chip designed to be programmable to handle this type of signal. I may very well be wrong, but I believe it is unique to DCC applications.


----------



## th1alb (Apr 17, 2008)

thanks lownen,

i looked into it myself further by reading some of the standards. i now understand that timing is very critical and perhaps the serial or parallel port cant supply that. What I thought was that I can through software turn a certain pin on a port off or on, and by that i mean +/- 11V or something in that area.

I guess the first objective would be to program a decoder. That way you barely need any current and perhaps what ever port you are using is sufficient.

My next try would be a sound card. I'm sure it can produce a signal that would resonate with dcc.


----------



## Lownen (Mar 28, 2008)

th1alb said:


> My next try would be a sound card. I'm sure it can produce a signal that would resonate with dcc.


Remember, you're trying to create a square wave. You might succeed by over-driving a sound card so that you get a clipped signal, but it sounds kind of awkward to me. And remember, frequency doesn't actually vary... it is pulse width. Maybe it's more accurate to say that frequency varies on a pulse by pulse basis. I'm not sure if you can alter a sound card's output on a pulse by pulse basis. Let me know if you figure out a way. A $10 sound card is an interesting alternative to a $150 starter unit.


----------



## th1alb (Apr 17, 2008)

Thats what I'd say. Even if it is a week signal, I'm sure a booster would be easy to build.

Still not forgetting about the possibility that i can invert a pin on a computer port quick enough (what is it, about 50 microseconds for the "1" bit?).

I'll have to look into it...


----------



## Lownen (Mar 28, 2008)

th1alb;

Here's the NMRA DCC Standards page. You can download .pdf files with all the specifications here.


----------



## th1alb (Apr 17, 2008)

Digital Command Station components shall transmit "1" bits with the first and last parts each having a duration of between 55 and 61 microseconds.

Let's go with 61 microseconds and multiply by two in order to get the duration of a complete electrical cycle of this signal.

Take 1000000 microseconds that are in one second and devide by (61 * 2) to get the required frequency of roughly 8197 Herz.

If I used 55 microseconds instead of 61, my required frequency could reach 9090 Herz.

In my calculations I am using the "1" bit because it has the shortest period.

I'm still researching what frequency I can run with either a parallel or serial port. From what I found so far however, 10kHz should be no problem when using a real time operating system. I have also read references of 330kHz.


----------



## th1alb (Apr 17, 2008)

Just want to add the following link:
http://homepages.paradise.net.nz/~rdmurg/dcc/boostr-2.htm

It appears this is what I had been looking for, a booster directly hooked up to the PC. However I already ordered half the parts of DCC-MB's controler circuit.


----------



## star2doc (Jan 25, 2012)

Even though a sound card would not output a square wave, it should be possible to simply over amplify and clip the wave form so it becomes a square wave. As to the problem of changing the frequency on each pulse, why not have the computer generate the wave form for the sound card to play? A wav file could be generated in advance with the proper frequency variations. Then the sound card would simply play this wav file in an endless loop. An op amp with positive feedback driving a transistor output stage would work as a booster.


----------

