DCC Controller


The controller:

Simple version 1.  An ATMEL AVR is the heart.  I am using a MEGA8515 clocked at 16MHz.  Communications with the PC run RS232 (I have a USB/Serial converter external to the controller.)  The power is applied to the track with a National Semiconductor LMD18201 motor driver.  I chose this because it is simple to interface and has good power capabilities.

The PC sends the DCC ID and Command to the the AVR.  The AVR uses an internal timer to toggle the Timer Output and LMD18201 Direction pin.  This creates your DCC square wave.  The rectifier connected to the track is the bi-directional return.  When you are in listening time, PIN4 on the AVR goes low; turning OFF (no output, no brake) the driver.  The returning signal from the LOCO is rectified to ensure a positive pulse then fed into the AVR via a buffer for shaping and forming.


The schematics are very basic.  On the power supply side, add the appropriate capacitors.  Add the VCC-Gnd filter capacitors on the chips.  Use opt-isolators if you want to protect the $3 ATMEL chip.  For scalability simple memory mapping will allow a huge track setup.  Add a NAND gate to the direction input of the motor driver.  So all motor drivers still get the same direction input, but using the memory mapped NAND you can invert individual drivers thus segments of track.  I would use memory mapped AND gates to poll through the different track sections for the bi-directional return. 

I have attached the EagleCAD schematics and the AVR C code.  The code is still in the experimental state.





ċ
DCC.h
(0k)
Tim Marks,
Jun 1, 2010, 2:47 PM
ċ
DCCCommandV2.c
(16k)
Tim Marks,
Jun 1, 2010, 2:46 PM
ċ
DCCController.sch
(269k)
Tim Marks,
Jun 1, 2010, 2:47 PM
ċ
DCCControlver1.zip
(28k)
Tim Marks,
Nov 15, 2011, 5:09 PM
Comments