PDA

View Full Version : Parallel port directly output DCC?


th1alb
04-17-2008, 05:59 PM
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
04-17-2008, 07:09 PM
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
04-17-2008, 09:41 PM
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
04-17-2008, 10:15 PM
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
04-18-2008, 08:19 PM
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
04-18-2008, 08:34 PM
th1alb;

Here's the NMRA DCC Standards page (http://www.nmra.org/standards/DCC/standards_rps/DCCStds.html). You can download .pdf files with all the specifications here.

th1alb
04-19-2008, 08:07 AM
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
05-12-2008, 06:47 PM
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
01-25-2012, 01:20 PM
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.