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
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!
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 Don't even have a loco (yet) Bill
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
Hi. This page gives the full details of the format of DCC++ serial Commands and their returned packets: https://github.com/DccPlusPlus/BaseStation/wiki/Commands-for-DCCpp-BaseStation HTH Jim
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.
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...)
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.
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:}
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
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!
Yes, the YouTube videos are older and have incorrect jumpers for the mega boards. The 4 pin was needed for ethernet shields, so the pin configuration was changed. The instructions on the DCC++ GitHub are correct. Glad you got it working. Here is a link to the correct instructions in case anyone else runs into the same problem. https://github.com/DccPlusPlus/Documentation/blob/master/Motor Shield Pin Mappings.pdf Matt
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.
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
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.
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
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.