Introducing DCC++ ---a complete open-source DCC station and interface

Gregg Aug 25, 2015

  1. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Could use a little help. I presume I have missed a step somewhere. I have a Mega2560 and a Pololu MC33926. Arduino IDE 1.6.7 and latest DCC++ code. I set the motor shield type to 1 in config.h. I am using the serial monitor.
    Using the D diagnostics instructions on the github page, the Mega tests out fine. On the Pololu, per the motor shield pin mappings pdf I cut the trace for pin 12 and installed three jumpers (12-7, 2-8, 4-VDD). When testing I don't get any LED's on the M2 side of the shield (M1 side goes on/off as expected). I thought I might have a bad motor shield so I used the Pololu demo sketch to test out the board (I had to install a shunt to reconnect the pin 12 line for this) and M2 and its LEDs work fine with that sketch.
    I have also tried connecting 12-8 and 2-7 - M1 still lights and M2 still does not.
    Thanks,
    Mike
     
    Scott Eric Catalano likes this.
  2. w8one

    w8one TrainBoard Member

    89
    109
    5
    Someone else had a similar problem and in their case the pin 12 trace was not fully cut.
     
    Scott Eric Catalano likes this.
  3. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Hi Mike,

    The parameters in the config.h file for the Pololu assume the use of an Uno instead of a Mega. You'll need to make one small change to the configuration parameters --- please see my previous post #338. I can change Arduino code so that the definitions automatically reflect whether you are compiling for an Uno or a Mega, but I wanted to make sure someone has tested the Pololu with a Mega before making the update. After you've updated the DCCpp_Uno.h file per post #338 on page 17, please let me know if the programming output works as expected. If so, I'll incorporate the changes into the next build.

    -Gregg
     
    Scott Eric Catalano and KC Smith like this.
  4. Pepijn

    Pepijn TrainBoard Member

    18
    23
    4
    Hi everyone,

    I bought a motorshield from aliexpress a couple of months ago and today hooked it up to a Mega2560 and loaded the latest DCC++. I'm happy to report I got a train (H0) moving and was able to turn its lights on and off. The motorshield is this one:
    http://www.aliexpress.com/store/pro...or-drive-for-arduino/1383618_32441482803.html

    I'm not sure I'd recommend it, as it completely lacks any docs. Not even sure if the description on the website is accurate, as the pin occupancy differs from what is stated.

    Right now it's hooked up to a 18V power supply delivering just over 16V to the tracks according to the multimeter.
    There's a jumper on the board that can be removed to disconnect the power from the Arduino to the motorshield. Besides removing the jumper I added a wire from pin 2 to pin 13.
    Only one small software "fix" was needed, as most pins are similar to the ones on the Arduino Motor Shield:
    In DCCpp_Uno.h I changed
    #define SIGNAL_ENABLE_PIN_MAIN 3
    to
    #define SIGNAL_ENABLE_PIN_MAIN 10

    Only thing I haven't figured out is if it does current sensing. Any tips on how to go about to finding this out would be greatly appreciated. I seem to be able to write CV's, but reading CV's always results in value 255. I can hear the little engine respond with short bursts, but the values isn't being picked up.

    Thank you for this great software! Hope to have a layout up and running with this in the near future.
     
    Scott Eric Catalano likes this.
  5. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    I hope you are powering the Arduino and the Motor shield separetly...otherwise you can burnout the Arduino
     
  6. Pepijn

    Pepijn TrainBoard Member

    18
    23
    4
    I am. The Arduino is powered through USB.
     
    Scott Eric Catalano likes this.
  7. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Good! =-)
     
  8. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Thanks Gregg. I made the change and now have both sets of LEDs lighting up and the D diagnostic is working as expected. I have not connected this to any track yet.

    @w8one - I had read that post so I checked with a meter when I made my cut to make sure. I had to install a two-pin header and shunt to patch that cut when I went to test with the Pololu demo program because it requires the connection to be intact. Appreciate the response, though, and all of your work on the wiki pages. One note you may want to include for the Pololu MC33926 - there is an "enable" location on the board where you can install a two-pin header and shunt in place of using a jumper wire between pin 4 and VDD. See 4.a item 3 of their user's guide. I now have my board configured that way.
     
    HVT and Scott Eric Catalano like this.
  9. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Thanks Mike. I'll use this as confirmation that the #define change works correctly with the Arduino Mega and update the code to automatically detect this in the next release.

    -Gregg
     
    Scott Eric Catalano likes this.
  10. KC Smith

    KC Smith TrainBoard Member

    109
    111
    12
    Gregg

    The updated web site looks cleaner and is very informative. There is a disconnect on the Getting Started page Keep up the good work.
    https://sites.google.com/site/dccppsite/home

    P.S. You may want to distinguish between the Official version and Latest version in some way. ie. Developers Latest Versions Base Station 1.2.2 etc.
    Otherwise a non developer (end user) or some one new to the site might inadvertently mix components when placing them in their local servers.

    Cheers
    Kevin
     
    Last edited: Jan 11, 2016
    Scott Eric Catalano likes this.
  11. w8one

    w8one TrainBoard Member

    89
    109
    5
    The sense pins on the l298p chip are 2 and 19 in the picture is looks as they are hooked to ground with pin 1 and 20. Witch means no sense.
     
    Scott Eric Catalano likes this.
  12. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Is there short circuit protection in the Base Station? I've seen one post here that said "short circuit protection was working" but haven't found any post or doc with details.
     
    Scott Eric Catalano likes this.
  13. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Yes, it's built into the code. Provided that the current can be read from the motor shield, the program will turn off the enable pins if it detects too much current. Basically it issues its own <0> command.
     
    Scott Eric Catalano likes this.
  14. tz3p9v

    tz3p9v TrainBoard Member

    12
    18
    16
    Gregg -- Great work!!!

    Got Base Station working using a MEGA AVR ... same but slightly different than MEGA. May want to allow this version when checking hardware.

    Suggestion: when hand issuing the commands, it would be nice to have the responses end with a new line (CR or LF, or both) .. Thought this could be defined in Config.h when setting to Serial. This would result in the next command starting on a clean line. Helpful with working with serial monitor or program like Putty.

    Net step is work on Client program (on PC) to "talk" to the base station. Any existing programs? Would like to work in C# or VB.Net

    Thank again -- much appreciated
    Paul

    PS. Your video description of DCC communication was excellent and was a great help to understand the how DCC works.
     
    Last edited: Jan 11, 2016
    Scott Eric Catalano likes this.
  15. lnxlnx

    lnxlnx TrainBoard Member

    24
    20
    7
    Scott Eric Catalano likes this.
  16. Pepijn

    Pepijn TrainBoard Member

    18
    23
    4
    Thank you for spotting that. Saves me the time looking for the right pins. I had already tried all 6 analogue pins.
    Can anyone recommend a motor shield for H0 that would work DCC++ besides the Pololu? I think I saw one being mentioned earlier in this thread, but I cannot find it anymore having scrolled back 29 pages.
     
    Scott Eric Catalano likes this.
  17. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    I have had good luck with this board that I got on eBay:

    http://www.ebay.com/itm/310787745501?_trksid=p2059210.m2749.l2649&ssPageName=STRK:MEBIDX:IT

    The quality control is not excellent as I had to repair one of the two boards that I received - my best guess is that the issue I had is an isolated problem and not likely to happen too often.

    We ran our HO modular layout at the local Science Center over the weekend and switched from running a Digitrax system to the DCC++ with an Arduino Uno and the eBay board and it worked PERFECTLY for several hours running two long trains - the controller board got warm but never missed a beat - We were very pleased with the system.

    dave
     
    KC Smith and Scott Eric Catalano like this.
  18. Pepijn

    Pepijn TrainBoard Member

    18
    23
    4
    That one seems reasonably priced. But at what voltage did you run the trains?
    The description says the operating voltage is only 5V to 12V.
     
    Scott Eric Catalano likes this.
  19. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    I cut the trace on the bottom of the board that isolates the power on the UNO from that on the motor controller and used a 15 volt DC power supply with the motor board - the UNO got its power from the USB cable that went to the computer. As I said it worked just fine.

    The data sheet for the L298 power chip says it is good to better than 40 volts. The 12 volt limit may be valid if you do not cut that trace.

    dave
     
    KC Smith and Scott Eric Catalano like this.
  20. Pepijn

    Pepijn TrainBoard Member

    18
    23
    4
    Thanks David. I think I'll have a go at it.
     
    Scott Eric Catalano likes this.

Share This Page