Hello alltogether, recently I ordered a bunch of D&H 10 C decoders to assemble them into a herd of locos. As I purchased a decoder tester recently, I hooked the first up to it and tried to read the adress - nothing, not a blip. Tried the next, the next after the next and so on, no reaction. I could operate them with regular main track signals, but programming was impossible. Even worse, formerly purchased DH10C performed completely normal. I guessed that Doehler&Haass has changed some firmware code. The initial feedback there was "well - a homebrew solution for the DCC controller... the error could be anything" :-( After a deepdive into the base station C++ code, long nights in front of the oscilloscope, and absorbing the NMRA standards in full, I have figured out what it was. I can imagine that others might run into the same snag, so I want to share this here with you. The culprit is the packet sequence that is used to trigger programming, e.g. in RegisterList::readCV in PacketRegister.cpp loadPacket(0,resetPacket,2,3); // NMRA recommends starting with 3 reset packets loadPacket(0,bRead,3,5); // NMRA recommends 5 verfy packets loadPacket(0,resetPacket,2,1); // forces code to wait until all repeats of bRead are completed (and decoder begins to respond) This is the original code from the BaseStation. The DH10C does not perform the acknowledgement because of the last resetPacket that is used to wait until all bRead Packets have been digested. I changed the resetPacket to another bRead Packet and all works fine. loadPacket(0,resetPacket,2,3); // NMRA recommends starting with 3 reset packets loadPacket(0,bRead,3,5); // NMRA recommends 5 verify packets loadPacket(0,bRead,3,1); // forces code to wait until all repeats of bRead are completed (and decoder begins to respond) Similar changes are necessary in the routines for WriteCVByte and WriteCVBit. So essentially this post is question and answer in one, but I hope it helps . Happy model railroading, Thomas.
Hello Thomas, thank you very much for your Work. Your changes also helped me with a D&H DH12A. In RegisterList::readCV i had two Places to change. Regards, Albert
I Have tried this fix on the basic DCC++ code for just reading all decoders. I have had some problems with a few Digitrac decoders. However is complies with an error. I get an error on this change. It reports: bRead' was not declared in this scope void RegisterList::writeCVBit(char *s) volatile{ byte bWrite[4]; int bNum,bValue; int c,d,base; int cv, callBack, callBackSub; if(sscanf(s,"%d %d %d %d %d",&cv,&bNum,&bValue,&callBack,&callBackSub)!=5) // cv = 1-1024 return; cv--; // actual CV addresses are cv-1 (0-1023) bValue=bValue%2; bNum=bNum%8; bWrite[0]=0x78+(highByte(cv)&0x03); // any CV>1023 will become modulus(1024) due to bit-mask of 0x03 bWrite[1]=lowByte(cv); bWrite[2]=0xF0+bValue*8+bNum; loadPacket(0,resetPacket,2,1); loadPacket(0,bWrite,3,4); loadPacket(0,resetPacket,2,1); loadPacket(0,idlePacket,2,10); c=0; d=0; base=0; for(int j=0;j<ACK_BASE_COUNT;j++) base+=analogRead(CURRENT_MONITOR_PIN_PROG); base/=ACK_BASE_COUNT; bitClear(bWrite[2],4); // change instruction code from Write Bit to Verify Bit loadPacket(0,resetPacket,2,3); // NMRA recommends starting with 3 reset packets loadPacket(0,bWrite,3,5); // NMRA recommends 5 verfy packets loadPacket(0,bRead,3,1); // forces code to wait until all repeats of bRead are completed (and decoder begins to respond) for(int j=0;j<ACK_SAMPLE_COUNT;j++){ c=(analogRead(CURRENT_MONITOR_PIN_PROG)-base)*ACK_SAMPLE_SMOOTHING+c*(1.0-ACK_SAMPLE_SMOOTHING); if(c>ACK_SAMPLE_THRESHOLD) d=1; } if(d==0) // verify unsuccessful bValue=-1; INTERFACE.print("<r"); INTERFACE.print(callBack); INTERFACE.print("|"); INTERFACE.print(callBackSub); INTERFACE.print("|"); INTERFACE.print(cv+1); INTERFACE.print(" "); INTERFACE.print(bNum); INTERFACE.print(" "); INTERFACE.print(bValue); INTERFACE.print(">"); } // RegisterList::writeCVBit()
Hello Dennis, in the Routines of RegisterList::writeCVBit and RegisterList::writeCVByte you should use bWrite like in the Line above. So it should look like: loadPacket(0,bWrite,3,1); // forces code to wait until all repeats of bRead are completed (and decoder begins to respond) To read and write "TAMS" and "Minitrix" Decoders also works like bevore the Changees. Regards, Albert
Hi Dennis I have the same problem with D&H 05 C decoders (2 year old 10-C work just fine). With Base Station-1.2.1 the loks work fine on the main trak, but on the program trak, there is no response, no reading and no writing. I have made the above adjustments, now i can read the CV's but i still cannot write. My setup: rocrail, dcc++, 15 volt Any ideas? Regards Felix
i am not quite sure, i made 4 changes alltogether. Two in the "readCV" section from resetPacket,2,1 to bRead,3,1 and one each in the "WriteCVByte" and "WriteCVBit" sections from resetPacket,2,1 to bWrite,3,1. Is there more to change?
Hi I got additional help from D&H. One of their customers had the sam issue with the DH05C. He resolved it with the help of Thomas an was kind enough to send me the edited files PacketRegister.cpp and PacketRegister.h . Now all is fine. Regards Felix
Hello Felix, can you please provide these files? I'am stuck at the same problem, with D&H05C :-( Or did you just replace the bRead and resetPacket as mentioned by thomas in opening post.
I have about a dozen DCC locos with decoders from ESU, Soundtraxx Sound Value, Bachmann and MRC and for the most part reading and writing CVs with DCC++ has worked well. A while back I bought a Lionel HO Polar Express as a cool thing for the grand kids and for whatever reason I could not read CVs with DCC++ but a friends NCE Power Cab would read and write so I set it up that way. The stock Lionel decoder actually performed rather poorly, in my view, and eventually malfunctioned losing Bluetooth and sound. I tried everything to reset it with no improvement. Finally I bought a replacement Soundtraxx Tsunami 2 steam decoder and popped it in. Wow, what a huge improvement over any of my other decoders. So, after install I ran it around the track using the default address 3 pushing all of the function keys and having a good time. After a bit I put it on the programming track and DCC++ would not read any CVs. Checked all connections etc. but no reads. Finally I swapped it for another loco with an ESU decoder and it read CVs fine. Put the Tsunami loco back on the programming track and nothing. I then recalled this thread. I loaded up the new files uploaded to the Uno powered up the programming track and holy smokes DCC++ is reading and writing the Tsunami CVs like a champ. Works perfectly! Many thanks for figuring this out and making the files available. Best regards,
I had the same problem with my DH10C decoder, and this post helped me a lot! Thank you very, very much for sharing it, Thomas, and thanks also to Felix for the files!
Hi altogether, I am glad that my post has found so much resonance and was helpful to quite a few people. Thanks so much for your feedback, that proves to me it was worth the time. And thanks to everyone that has developed this further. Thomas P.S. Roby: a nice welcome to this forum, and I find it very nice that your very first message here goes out with this positive message about this topic, that made my day!
Hi all, At first: Thomas, thanks for pointing this out!! Unfortunatly, I (still) have the same problem... Windows 7, Arduino Uno, Arduino (Deek) Motorshield. Loc: Minitrix 6408 (NScale) with a D&H DH10C-3 decoder. I have changed the 2 files as mentioned above, but still get the 308 error, and I am kind of stuck now... But (at least I think I have) I have power on the rail, as the lights of the loc are on when I turn the programming track power on. Greets, Marco
No unfortunatly not. I followed these instructions: And with the step of detecting the decoder, it gives a 308 error. Also after trying to manually selecting the newest type of DH10, the throttle does not respond. Greets, Marco