Pololu MC33926 motor shield and DCC++

alexisahmc Nov 29, 2016

  1. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Hello everyone,
    Long time model railroader (without a layout right now. Long story). I have some programming experience and plenty of hardware experience, both analog and digital.
    getting ready to start a new layout in N scale and want to deal with all the software, sensors, detectors etc prior to starting construction.
    I am having a tough time making sense of the Arduino Mega with the Pololu motor shield. The motor shield itself, (attached to the Mega with a 15V external P/S) works as it should when I run their demo sketch.
    Now with the DCC++ Base Station Master sketch I cannot get any response from the motor shield.
    I have pin 2 and pin 13 connected together as it is shown on the video related to the Mega.
    Would anyone know if there are any further connections which need to be made for this shield?
    The software has been changed and set for this shield. The serial monitor gives me the correct message. There seems to be some communication with the program. When I send the <1> command I get the proper response <p1>. But that's about it. I get no track voltage or any action with the loco on the test track.
    Other commands return the expected responses, although most are reporting that items do not exist.
    I noticed that when I run the Pololu demo sketch the TX/RX leds on the Mega are going at a good clip and the shield output leds as well. When the DCC++ sketch is uploaded there is absolutely no action on the Mega board. Is this common? I suspect most of you are using the Arduino motor shield. Is there any activity on the Arduino boards when the software is running?
    Any ideas or suggestions will be most appreciated!
    Cheers!
    Alexis
     
    Scott Eric Catalano likes this.
  2. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Hello Alexis,

    I am using the Pololu Motor shield using an Arduino Uno...Gregg and I had to make some changes to pin mappings to make it work with a Uno. My B side goes to the Main Track and my A side goes to the programming track as I had it in reverse order before. Now on the Pololu shield I had to cut and re-trace 2 of the pins on the motor shield to match it up with the Uno. I am not sure about the Mega as I have not tried that. My systems works fine for running trains. I used a VDC Power Supply from my Digitrax DCC system as I needed higher voltage to run HO Scale trains. My setup runs fine and i do NOT use DCC++ to program deecoders as I have decoder programmers already set up to do that.
     
  3. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Thank you Scott for the quick reply.
    I have also an Uno. I you could send me details of what I need to modify to work with the Polulu it will be EXTREMELY appreciated.
    Thanks again
    Alexis
     
    Scott Eric Catalano likes this.
  4. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Don't use the video as your reference. Use the documentation on Github. The videos were done early on and some modifications were made since they were recorded. The PDF on the GitHub site is more up to date. I used a Mega, a Pololu and an Ethernet Shield to build my initial configuration and it worked fine. My issue with it is that the Pololu's short circuit detection is too fast and cuts in before an NCE EB1 or a Digitrax AR-1 can respond. My 'plan B' is to use a regular Arduino motor shield rather than the Pololu and a separate booster using Dave Bodnar's design. Unfortunately I haven't been able to work on this since March so I haven't gotten the booster (or my layout) built yet.
     
    Scott Eric Catalano likes this.
  5. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Noted! Thanks. I will look into it. I am trying to weed through all of this stuff, while I am reading Gregg's code and trying to figure out how it all works. I am determined to use DCC++ for everything including automation, sensors, detectors etc. We'll see how it comes out. For now I have yet to connect something successfully to the track and get a train to move. I am not worried. At some point I will figure it out. Especially since there is so much help and guidance around this forum.
    I have on order an Arduino motor shield as well and I also have an Uno. Although I am not going away from the Mega, as I will need several additional pins. However, there is also the option of a shift register chip which, with some "smart" coding, could make the Uno more versatile. I am just guessing. I haven't really looked into it.
    Thanks for reply,
    Alexis
     
    Scott Eric Catalano likes this.
  6. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Hi Scott,
    How silly (to be mild about it) did not look for the documentation on the Github, which provides the document I so need. Pin mappings for the two motor shields. Well, I'll give it a try again tomorrow and I'll drop you all a note with the results.
    Thanks again,
    Alexis
     
    Scott Eric Catalano likes this.
  7. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Well, thanks to all of you for helping out. I am up and running.
    I don't have a loco, but there is plenty of voltage on the track (14.5V using an 15V P/S). Dcc++ returns the correct responses and everything seems to be OK.
    On to reading the code and trying to figure out the rest.
    I am sure you have not heard the last of me.
    Until then...
    Alexis
     
    Scott Eric Catalano likes this.
  8. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    i would think that if you pick up an inexpensive basic decoder:
    http://www.ebay.com/itm/Digitrax-HO-Scale-DH126D-1-5-AMP-DCC-Decoder-Free-Shipping-/301962214682
    you could install some alligator clips on the decoders track power leads, and wire it up with some LEDs (don't forget the current limit resistors), then you can at least verify everything is OK by turning the LEDs on and off. it would work later as a diagnostic tool, or you can install it into a locomotive once you have some track laid, and get a loco.

    ~Travis
     
    Scott Eric Catalano likes this.
  9. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Hi Travis,
    I have a loco coming this week and I have two 36" pieces of track setup for operating and programming and will proceed with real testing. I am also in the process of acquiring other "stuff" etc. I have plenty of hall effect transistors on hand and will also fashion detectors from those, also to be used for testing. Right now I feel pretty confident that the DCC++ master station is working as it should. My master plan is to make a small layout (2'X4') or something like that, which will help me setup all of the functions that I am planning on having on the real layout, which will be built most likely next fall. Long winter here and plenty of time to get up to speed with DCC++. I used to have an HO layout (6'X12') which was using Digitrax DCC and other Digitrax accessories, but it got dismantled and sold about 6 years ago along with everything related to trains. So, I will be starting from scratch again :)
    Well, enough of this here. This is supposed to be about DCC++. :)
    Thanks again,
     
    Scott Eric Catalano likes this.
  10. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Hi Travis,
    Does that look like a Honda ST1100 on your avatar? I have a 1995 one (Honda red) :)
     
    Scott Eric Catalano likes this.
  11. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    it is a Honda GL1500, 1988. :D

    Unfortunately it is in storage right now due to snow on the ground.

    ~Travis
     
    Scott Eric Catalano likes this.
  12. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Hi Travis,
    Off the "DCC++" subject. I used to live in Portland 72-75. Attended college for a couple of years. Haven't been back since. It's in the bucket list though. My 1100 is also retired for the winter :-(
     
    Scott Eric Catalano likes this.
  13. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    I wasn't even conceived in 75 ;)

    ~Travis
     
    Scott Eric Catalano likes this.
  14. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    well, "I am bit old, but not obsolete" (that's someone else line). I still ride. :)
     
    Scott Eric Catalano likes this.
  15. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    I feel old, got my motorcycle license in 1969 :)
     
    Scott Eric Catalano likes this.
  16. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    On December 19, it will be my 50th anniversary for going to boot camp......I feel old too.......
     
    Scott Eric Catalano likes this.
  17. David Jennex

    David Jennex TrainBoard Member

    15
    16
    6
    Hi All,

    Let's say I was using an Arduino Mega and a Pololu MC33926 motor shield and I wanted both outputs to act as Mains - no Programming track required.
    How would I organize the jumpers?

    David
     
    Scott Eric Catalano likes this.
  18. alexisahmc

    alexisahmc TrainBoard Member

    29
    27
    7
    Not clear what you are trying to accomplish, but in MHO do nothing. Use one or both oh the shield outputs for whatever you want and leave the jumpers as they are
     
    Scott Eric Catalano likes this.
  19. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Could make a second power district out of the second set of outputs
     
  20. David Jennex

    David Jennex TrainBoard Member

    15
    16
    6
    Scott,
    Your suggestion above is the crux of what I want to do.

    Bear in mind that the "Programming" terminals (terminals "B" as Gregg Berman determined them - I understand yours are "A") can not be used for running trains. This means that we can utilize the three amp capacity of terminals "A' only to run our trains and the three amp capacity of terminals "B" is probably only used one hundredth of one percent of the time to program locos - what a waste!

    So, what I need is to change the output of the "B" "programming" terminals into "main" terminal "A" output in other words - both "A's"

    I think I've figured it out.

    Pololu pin seven is connected to the "A" output terminals to the main track. It receives its DCC++ signal from Mega pin twelve.
    Pololu pin eight is connected to the "B" output terminals to the programming track. It receives its DCC++ signal from Mega pin two.

    I believe all I need to do is use a single pole double throw switch to disconnect pin 2 from pin 8 and connect pin 12 to pin 8 and pin 7 at the same time. This would have to be a "break before make" or a "center off" switch if it was to be utilized during power on.

    I'll experiment with this over the next week or so. What do you think?

    David
     
    Scott Eric Catalano likes this.

Share This Page