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

Gregg Aug 25, 2015

  1. v64

    v64 TrainBoard Member

    21
    19
    3
    Thank-you - I have just found a comment in the DCC++ code which states that DCC++ does not support ethernet on a UNO. - so maybe my question should have been about combining a pololu + mega + ethernet
     
    Scott Eric Catalano likes this.
  2. Federico Carminati

    Federico Carminati New Member

    1
    1
    4
    Dear All,
    this is my first post, so sorry if this is a solved question, a stupid question or both. Anybody tried to "miniaturize" the arduino + motor shield setup? Arduino nano and corresponding motor shield for instance? Thanks!
     
    Scott Eric Catalano likes this.
  3. William E Van Buskirk

    William E Van Buskirk TrainBoard Member

    40
    22
    3
    Hi all! just finished reading this thread, WOW. Thanks Gregg and All the contributors (looking at UK Steve and a few others). Always liked trains but never could commit to a lay out. Seems like I got hooked a bit after reading Geoff' Blog and that lead to DCC++, and that lead here. So registered ;)
    Know my way around embedded uCs so jumped in head first. laid out a panel of Geoff's 17 function decoder and got 10 boards back from the PCB fab \o/ Have parts on order so just waiting for the fun to begin :p Don't even have a loco (yet) ;)
    Bill
     
  4. danners430

    danners430 New Member

    4
    4
    1
    Hey folks, sorry if this has been asked before, but i can't seem to find the answer :)

    I'm looking to "hack" DCC++ in a certain way, by using JMRI with DCC++ to communicate over serial with a PICAXE chip. The reason for this is that the picaxe chip is interfaced with the rest of my layout in terms of point control, signal control etc. over i2c, and interfaces with other, picaxe specific components. That, and i have loads of the chips spare, and they use less space than an arduino :)

    My question in, what sort of format do the serial commands to/from JMRI with DCC++ have? The picaxe system has full serial support, I just need to program it how to respond to commands, and what to send back to JMRI when an input is received (track sensors etc.)

    Cheers in advance!

    Edit:

    Just looked through the SerialCommand.cpp file again, but it lists the serial commands in an odd way - is it using AHCI over serial, or how? PICAXE goes right down to bit level when receiving serial code, but can translate AHCI natively, I just need to know what to expect
     
    Last edited: Nov 13, 2017
    Scott Eric Catalano likes this.
  5. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Scott Eric Catalano likes this.
  6. danners430

    danners430 New Member

    4
    4
    1
    Scott Eric Catalano likes this.
  7. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    I don't know about AHCI, but as far as I'm aware the data is the standard Arduino default of 8 data bits, no parity, one stop bit ASCII.
     
    Scott Eric Catalano likes this.
  8. danners430

    danners430 New Member

    4
    4
    1
    Cheers for that Jim. You have permission to call me a numpty... ASCII was what i meant all along... AHCI is a storage format!!! 8 bits, no parity ASCII is exactly what PICAXE likes, so I'll be able to design a bootstrap code for it. I'll maybe post an explanation here for folks, as the picaxe system is generally more flexible that Arduino in terms of expandability (and cheaper...)
     
    Scott Eric Catalano likes this.
  9. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Phew! - I thought you were going to try and use some sort of fancy SATA storage serial protocol!
     
    Scott Eric Catalano likes this.
  10. danners430

    danners430 New Member

    4
    4
    1
    Lol, no - just Monday Syndrome...
     
    Scott Eric Catalano likes this.
  11. DaPenguin

    DaPenguin New Member

    5
    5
    6
    My latest info says that the answer is no.

    As currently configured the TV transmitter requires full bipolar input and so requires a motor shield or additional parts.

     
    Scott Eric Catalano likes this.
  12. DaPenguin

    DaPenguin New Member

    5
    5
    6
    I hope to do some experimenting on this. Need an mega etc.
    Any idea haw I would get the full bipolar signal without a motor shield?
    TCC:}


     
    Scott Eric Catalano likes this.
  13. Greg Privette

    Greg Privette TrainBoard Member

    12
    11
    8
    After several months of controller/baseStation upgrades for my 3rd "under construction" layout, I finally needed to program the address (CV 1) of a new loco. I find it doesn't work and the LED by the motor shield "-" pin for the Programming Track output is not lit. So I load my initially pulled Arduino code from github and run diagnostics. The <1> and <0> tests worked fine but when I got to the <D> command I did not get "Diagnostic...." text echoed on my serial monitor. My code started from the "Development" branch to leverage Gregg's RGB strip code - I'm guessing this doesn't have the diagnostic code (?). I did see that the instructions said use the latest code. I'm guessing that's the "Latest commit 3c90408 on Jan 31, 2016" code(?). Guess I will try that tonight. Everything has worked on the Ops track - but have always used a single decoder in the default address 3 configuration.

    Also... I've programmed in my turnouts/routes and updated the track plan schematic on the Processing controller code but can't "throw" a turnout on the screen. I thought I hadn't updated code somewhere but then re-loaded the initial controller code and can't throw Gregg's turnouts either. Looks like many of Gregg's turnouts don't leverage sensors so can't believe I'm missing feedback code somewhere. Will this suddenly work when I install turnouts and Smail motors? I'm planning to purchase "Circuitron 800-6206 "Smail" Slow Motion Actuator with Integrated Logic (DCC Decoder Equipped)".
    Thanks!
    Greg
     
    Scott Eric Catalano likes this.
  14. Greg Privette

    Greg Privette TrainBoard Member

    12
    11
    8
    Following up on my post yesterday...
    I loaded the "Latest Commit" code referenced above onto my Mega and did get the expected Mega results on the <D> command - for the Arduino Motor Shield, however, the <D> causes the Ops track LEDs alternate as expected but for the Programming track, the plus is always on and the minus is always off. Gregg's post at https://github.com/DccPlusPlus/BaseStation/wiki/Diagnostics---D---Command indicates this means "If it does not [blink], that indicates that problem is in mapping the DCC signal generation pin [pin 2 for Mega PROG] (which we know is working from the above tests), to the Direction pin on the Motor Shield [pin 13 for Arduino Motor Shield B (PROG)]". So I move the jumper from between pins 13 and 4 to between pins 13 and 2 - and then I get the alternating pattern on all 4 pins as expected!

    So then I load my code back into the Arduino and lo and behold, with the only Mega jumper from pins 2 to 13 instead of 4 to 13 (per Gregg's initial video instruction), everything works as expected. Yay - I'm reading CVs on the programming track!

    PS - following up on my other "can't throw a turnout" issue from yesterday's post... I found Gregg's comments atop the accessories.cpp source file and sending the <T *> commands enabled me to "throw" turnouts on the displayed track schematic (this also works in emulator mode). Now if I could only get some turnouts and switch motors in the mail!
     
    Scott Eric Catalano likes this.
  15. Curn

    Curn TrainBoard Member

    751
    497
    31
    Scott Eric Catalano likes this.
  16. Trains In The Attic

    Trains In The Attic New Member

    3
    3
    5
    Hi,
    can anyone tell me if I can run more than one mega or uno on a layout so as to get more sensor pins please.
     
    Scott Eric Catalano likes this.
  17. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Thanks again for a fast answer, this comment is not so fast... Have been doing other things, but now I'm back with shortcut verification.
    I Finally found the current monitor setting in "Currentmonitor.h", but then found a new question: it is set at 300, indicating what ? Is it a multiplier for the actual current, if so at what scale ? Since I didn't know about it I obviously never changed it; what I want is instant shutdown when a shutdown occurs; the program seems to do that, but maybe my settings are wrong then ?
    If someone has more information about this is it is most welcome !
    Btw this program IS awesome, you just have to learn about it seems.
    Peter in Sweden
     
    Scott Eric Catalano likes this.
  18. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    It’s a standard Arduino analog in which scale from 0 to 1023. Your motor shield feeds back the proper signal to this pin to let you know basically the percentage of current it’s at. 300 is very conservative meaning basically 30% of it max. Using something like 600 or even 900 works fine. If you are using a high power motor shield just realize that you could draw some major current before you shut down at 900 or higher.
     
    Scott Eric Catalano likes this.
  19. Shaydriver

    Shaydriver TrainBoard Member

    18
    14
    5
    Ok, thanks, that explains that, but where is then the shut down trigger level ? 30% would indicate some 600 mA, more than enough for my first tests (one loco); however in my opinion a shortcut should trigger shut down immediately, no matter what setting !? My base station just "ducks": the power LED's go slighty dim, the driver chip gets hot, and when removing the short it's seemingly back to normal. I would rather have it shut down track power, and stay shut until manually restored (yes I have a Digitrax too....)
    Reading the code in Currentmonitor.cpp it says "digitalWrite(SIGNAL_ENABLE_PIN_PROG,LOW);" if sensed current is higher than the set value, if I get it right. Will that not do the same as sending a serial <0> for shutdown ?
    Perhaps I'm beginning to understand parts of this, but must be missing something if this is to work as planned.
    Luckily there are forums, so please clarify this a bit more.
    Peter
     
    Scott Eric Catalano likes this.
  20. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Peter,

    It sounds like your current overload isn't working correctly?

    My understanding of the setup is as follows;

    The standard Motor shield current sense pin gives out 1.65V at 1 Amp current drawn.

    The arduino ADC pin gives a reading of 1023/5 per volt (approx 205 for 1 volt)

    Working it all out - 1 amp drawn would give a reading of 339 (205x1.65)

    Setting the Max current to 300 would therefore be around 885mA (300/339)

    Another way of looking at it is that each count represents 2.95 mA

    So the default setting of 300 gives a cut out at 300x2.95mA =885mA,

    and a setting of 500 would be 1.475 Amps.

    Edit:. Meant to say, when the max current is exceeded, the power should switch off, and requires a <1> to switch it back on. Mine does this and its very quick ( a fraction of a second) if I put a short on th track. I have a max current setting of 400, because I found 300 a bit too sensitive with my 2 locos.
     
    Last edited: Jan 11, 2018
    Scott Eric Catalano likes this.

Share This Page