DCC++ and wired throttle - problems

AndyH Aug 25, 2019

  1. AndyH

    AndyH TrainBoard Member

    77
    9
    6
    I'm running DCC++ on an Arduino Mega/Deek Robot motor shield. I don't know what version I am running.

    I have tried a few times to connect some form of controller to the Rx port, and it freezes the system every single time. I've tried an ESP-01 based web controller and now I've tried a Dave Bodnar rotary encoder controller (The keypad and screen work but I don't know how to test the rotary encoder to see if that is working). However as soon as I connect it up to the Arduino (RX port on the motor shield), the system fails. I can't even turn the track on and off in JMRI.

    Any suggestions as to what I am doing wrong?

    Thanks.
     
  2. RCMan

    RCMan TrainBoard Member

    271
    132
    12
    How are you powering the Arduino? If you have it powered using the USB port, that may be your problem. It might be already connected to the RX/TC ports and you are trying to parallel the ESP-01, etc to the same ports, You cannot do that. One connection per port only.

    Dennis
     
    AndyH likes this.
  3. AndyH

    AndyH TrainBoard Member

    77
    9
    6
  4. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    As Dennis says you can't connect the usb to a pc at at the same time as a throttle. You should however get more luck by connecting the basestation usb lead to a wallwart phone charger instead of the pc.

    Edit: sorry our posts have just crossed. You may well be able to use an alternte serial port on the mega, as I don't have one I've never tried...
     
  5. NormHal

    NormHal TrainBoard Member

    138
    126
    12
    If anyone is interested, I took the liberty of modifying DCCpp_Uno - renamed it to DCCpp_Mega and added a line in the config.h file to enable a "THROTTLE_INTERFACE". Also added some code to "SerialCommand.cpp"

    This version can still be used on an UNO, with the same historic restrictions. On a MEGA, you can connect the Throttle TX line to either RX0 or RX1 on the MEGA - RX1 overcomes the conflict between a PC attached via USB and the Throttle.

    I have tested the code and all seems to work fine.

    Best,
    Norm
     

    Attached Files:

    Last edited: Sep 10, 2019

Share This Page