Another Motor shield (or Mega) problem

Steve Begnaud Nov 9, 2020

  1. Steve Begnaud

    Steve Begnaud New Member

    1
    0
    1
    Hi all, I did also post this in the DCC++ Discord forum, so I apologize if its showing up twice for you. Although I do get some of what's going on with EX, I am a hobbyist and not an electrical engineer. I recently set up a Mega with EX using this motor shield https://www.diymore.cc/products/rep...ard-l298nh-module-driving-module-mega2560-one. It seems to be a clone of the Arduino. I was using this with a UNO, DCC++ and jumpers, it worked fine. I am having this issue with two different motor boards so I think the issue is with my Mega. Unfortunately I got careless with my UNO and killed it, so I cant go back to it for testing. Here is the issue. Channel A wont work. When I power on the unit, the lights for channel B light up and it works. Just for testing, I added this code to the config.h library:

    // DIY More Motor Shield #define DIY_MORE_RUN F("DIY_MORE_MOTOR_SHIELD_RUN"), \
    new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN), \
    new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN)

    #define DIY_MORE_PROG F("DIY_MORE_MOTOR_SHIELD_PROG"), \
    new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN), \
    new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN)

    #define MOTOR_SHIELD_TYPE DIY_MORE_RUN

    Now by changing the #define motor shield type line between RUN and PROG, I can swap the outputs. Whichever output I put on B channel works as expected, BUT "A" channel is only getting DC power and as soon as I power on the track any train immediately starts running on this DC. so, is there a way for me to confirm that maybe pin 3 (or 12)on the MEGA is bad? if I change code to say pin 2 and jumper between 2 & 3 on the Motor shield would that work or would I burn something up? Is there voltage or current reading on the channel pins (3 & 12) I can check for? any thoughts?
     
  2. Rico (momfer)

    Rico (momfer) New Member

    9
    2
    2
    My 2 cents: you changed the speed and direction pins (3, 12 vs 11, 13) , but not the corresponding current reading pin A0/A1.
     

Share This Page