Re Routing a pin on the motor/stepper/servo shield.
Moderators: adafruit_support_bill, adafruit

Re Routing a pin on the motor/stepper/servo shield.

by nhume on Thu Nov 08, 2012 8:29 am

Hi,

I want to use the Adafruit motor shield to power 1 dc motor. i want to use it with the sparkfun wifly shield but have worked out that pin 12 is used by both of these shields and so wondered if it would be possible to re route it to a different digital pin, and how i might go about changing this in the code.

Thanks,

Nicky
Last edited by nhume on Thu Nov 08, 2012 9:16 am, edited 1 time in total.
nhume
 
Posts: 4
Joined: Thu Nov 08, 2012 8:26 am

Re: Re Routing a pin on the s=motor/stepper/servo shield.

by adafruit_support_bill on Thu Nov 08, 2012 8:38 am

Pin 12 is the latch control for the 74HC595. If you cut the trace and jumpered to a free pin, you would need to redefine MOTORLATCH in AFMotor.h.
User avatar
adafruit_support_bill
 
Posts: 29831
Joined: Sat Feb 07, 2009 9:11 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by nhume on Thu Nov 08, 2012 9:13 am

Thanks, what do you mean by cut the trace?
nhume
 
Posts: 4
Joined: Thu Nov 08, 2012 8:26 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by adafruit_support_bill on Thu Nov 08, 2012 9:20 am

There is a copper trace making an electrical connection between the latch chip and pin 12. To use a different pin, you must cut that trace (use a knife or a dremel tool with a small cutter wheel) and solder a jumper to the pin you want to use.
User avatar
adafruit_support_bill
 
Posts: 29831
Joined: Sat Feb 07, 2009 9:11 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by nhume on Thu Nov 08, 2012 9:47 am

thanks, I have now realised that pin 7 is also used by both. Would it be possible to re route 12 and 7 to digital pins 1 and 2 respectively. Will there be a problem since pin 1 is also a tx pin?
nhume
 
Posts: 4
Joined: Thu Nov 08, 2012 8:26 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by adafruit_support_rick on Thu Nov 08, 2012 10:23 am

The Tx pin is tied to the same output that goes to the serial monitor. If you are using Serial.print() anyplace, it will interfere with the operation of anything you attach to digital pin 1.
User avatar
adafruit_support_rick
 
Posts: 12170
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Re Routing a pin on the motor/stepper/servo shield.

by adafruit_support_bill on Thu Nov 08, 2012 10:23 am

Pin 7 is MOTORENABLE. You can cut & jumper this and redefine it in AFMotor.h as with pin 12.

Pin 1 will interfere with serial communication. You probably want to keep that pin free since the serial monitor is very handy for debugging code. One or more of these pins would be available if you are not using all four motor channels:

    Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)
    Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)
    Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control)
    Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control)
User avatar
adafruit_support_bill
 
Posts: 29831
Joined: Sat Feb 07, 2009 9:11 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by nhume on Thu Nov 08, 2012 10:41 am

Great, thanks for your help!
nhume
 
Posts: 4
Joined: Thu Nov 08, 2012 8:26 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by jlouis2k4 on Wed Dec 19, 2012 10:03 pm

Hello there,

I too am trying to control (3) motors wirelessly using an Uno, Sparkfun Wifly Shield and Adafruit Motor Shield (stacked in that order).

As per the directions above, I went ahead and cut the copper trace off with a knife for pins D12 and D7, jumpered D12 to 11 and D7 to 2 respectively, and changed the code in AFMOTOR.h to reflect the changes.

However, on attempting to test the modified shield with the UNO using the MotorTest sketch, I get the motor in M3 to rotate continuously regardless of which motor I specify. I have motors connected to 2, 3, and 4.

On sandwiching the WiFly Shield in between the UNO and MotorSfield, I ave the same behavior as above happening to Motor 2.

Any ideas on what is going on?

Thanks!
Joe
jlouis2k4
 
Posts: 5
Joined: Wed Jun 06, 2012 12:40 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by adafruit_support_bill on Thu Dec 20, 2012 5:49 am

jumpered D12 to 11

You can't use 11. As noted above and here, it is used for motor #1.
User avatar
adafruit_support_bill
 
Posts: 29831
Joined: Sat Feb 07, 2009 9:11 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by jlouis2k4 on Thu Dec 20, 2012 3:15 pm

One or more of these pins would be available if you are not using all four motor channels:
Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)


I am using only DC Motors 2,3, and 4.

Would you suggest that I use D13 instead?

Thank You,
Joe
jlouis2k4
 
Posts: 5
Joined: Wed Jun 06, 2012 12:40 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by adafruit_support_bill on Thu Dec 20, 2012 4:58 pm

If you are not using motor 1, pin 11 should be safe. The motor 3 problem is likely related to your pin 7 modifications. Make sure you have cut all the way through the trace. And make sure you locate and change all locations in the library that refer to pin 7. Maybe the OP can share his modified code.
User avatar
adafruit_support_bill
 
Posts: 29831
Joined: Sat Feb 07, 2009 9:11 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by jlouis2k4 on Fri Dec 21, 2012 1:48 am

Hello there,

Thank you for your reply. I realize I had soldered the pins directly to each other(D12&D11, I am not using Motor1, and D7&D2) rather than the pin to the little hole in front of it. I re-soldered the jumpers and checked to ensure that there is no connection between the pins D12 and D7 and the little hole in front of it, after having scratched off the Copper Trace.

Also, I changed the define statements in AFMotor.h for MOTORENABLE AND MOTORLATCH. I did not find any other references to the Pins D7 and D12 in either AFMotor.f or AFMotor.cpp

This is what I have now.

Image

It seems now that the MOTORLATCH is not working correctly. When I connect to the Wifly Module wirelessly via telnet and pass it commands for the motor to start, it works only when I provide a connection between D11 and D3. Also, I need to do this each time a motor.set() command is passed.

Am I doing something wrong in the above? Please let me know if you need more information.

Thank You,
Joe
jlouis2k4
 
Posts: 5
Joined: Wed Jun 06, 2012 12:40 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by adafruit_support_bill on Fri Dec 21, 2012 6:18 am

Did you test the shield to make sure everything worked before you started your modifications? If you post clear photos of the front & back of the shield we can check over your assembly.
User avatar
adafruit_support_bill
 
Posts: 29831
Joined: Sat Feb 07, 2009 9:11 am

Re: Re Routing a pin on the motor/stepper/servo shield.

by jlouis2k4 on Fri Dec 21, 2012 7:46 am

Hello,

Yes it was working perfectly before the modifications.

I just tested it (with the modifications, and stacked atop the Uno and Wifly shield) using the motor test sketch and it worked perfectly.

It behaves strangely once the I attempt to introduce SpiSerial.begin() into the setup() function in the sketch. Nothing happens until I jumper D12 (which is jumpered to D11, the new MOTORLATCH) to Aref(For another sketch, it was D3 instead of Aref that got the motor started). Also, in the MotorTest sketch, the motor is supposed to alternate directions, but it continues in one direction until I jumper D12 to D11 again, upon which it changes direction.

Please find a picture of my board below.

Image

Thanks,
Joe
jlouis2k4
 
Posts: 5
Joined: Wed Jun 06, 2012 12:40 am