Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

ARDUINO DUE + ADAFRUIT MOTORSHIELD V2
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by unknowndomain on Tue Jun 10, 2014 7:28 pm

Hey,

I am interested in finding out more about the project, could we talk via email me@unknowndomain.co.uk

Thanks

Tom

unknowndomain
 
Posts: 1
Joined: Mon Jun 09, 2014 5:35 pm

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by sonicalflair on Wed Jun 11, 2014 10:41 pm

Update: I received the scope today and probed the SCL1 line. I see the clock waveform for a few seconds, and then one of two things will happen

1.) The stepper motor will stop spinning and i'll continue seeing a clock signal
2.) The stepper motor will stop spinning and the don't see the clock waveform, it just stays "high"

Pressing the reset of the Due when '1.)' then causes the clock waveform to stay "high".

The waveforms themselves look good, they arn't "saw-tooth"

So something is happening that's causing the clock to stop, any ideas?

sonicalflair
 
Posts: 10
Joined: Thu May 01, 2014 10:51 pm

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by adafruit_support_rick on Thu Jun 12, 2014 7:23 am

Can you compare this behavior with the way it happens on the Mega?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by sonicalflair on Thu Jun 12, 2014 7:35 am

The SCL waveform on the Mega was less square, similar to the '100Khz 4.7KOhm resistor' in the link below:

http://dsscircuits.com/index.php/articl ... -resistors

However, I haven't experienced any issues running 1 or 8 Motorshield V2 boards with the Mega.

Are you using pull-up resistors when you use the board with the Due's SCL1/SDA1 connectors?

sonicalflair
 
Posts: 10
Joined: Thu May 01, 2014 10:51 pm

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by adafruit_support_rick on Thu Jun 12, 2014 7:54 am

The motorshield has 10k pullups on the I2C lines. I don't think there are any pullups on the Due.

Do you see behavior 1) with the Mega, or just behavior 2)?
What are the clock rates on the Mega and Due? 100kHz? Are they both the same?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by sonicalflair on Thu Jun 12, 2014 12:39 pm

I'm not seeing any issues with the Mega, it communicates to 8 Motorshields without problems.

The clockrate for the Mega is at 400kHz, I updated that value in the twi.h file. I've used 100KHz-800KHz with no issues.

The clockrate for the Due is at 100kHz, I've verified that by looking at '\hardware\arduino\sam\libraries\Wire\Wire.h`

I've also updated Adafruit Motorshield library to force the Due to use SCL/SDA, and ran the same tests as SCL1/SDA1. The results were the same as SCL1/SDA1; I'd see the clock signal for a few seconds, and '1.)' or '2.)' will happen.

Since I'm using an identical set up for my Mega tests, besides adding the Motorshield 3.3V jumper and making sure the 3.3V and GND from the Due go to the MotorShield, i'm running out of ideas.

Somehow connecting 4 Megas together seems like a better solution at this point...

sonicalflair
 
Posts: 10
Joined: Thu May 01, 2014 10:51 pm

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by adafruit_support_rick on Thu Jun 12, 2014 1:26 pm

Seems like it must be a bug in the Due wire library. I have no other explanation.
Have you tried probing this over at the Arduino forums?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by integrate on Fri Jun 13, 2014 8:07 am

Can anyone look into the following posts... Is this related? I implemented the code change to wire.cpp as described by the third link, but it didn't work with the latest adafruit motor/pwm/servo libraries that have the due fixes.

https://code.google.com/p/arduino/issues/detail?id=28

http://forum.arduino.cc/index.php?PHPSE ... =146802.30

https://github.com/arduino/Arduino/pull/1994

Help!

integrate
 
Posts: 14
Joined: Thu Feb 06, 2014 12:36 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by adafruit_support_rick on Fri Jun 13, 2014 10:46 am

@integrate - what was the original problem you were having?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by integrate on Fri Jun 13, 2014 11:03 am

Simultaneous control of 4 servos using one pwm shield stutters and struggles to catch up when moving large distances. Small slow movements are fine if you go very slow. Worked fine on uno and galileo. External 6v 10a power supply. Don't know for sure but really does look like an i2c communication issue.

integrate
 
Posts: 14
Joined: Thu Feb 06, 2014 12:36 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by adafruit_support_rick on Fri Jun 13, 2014 1:07 pm

It certainly seems that way. Can you report this over on the Arduino forums? Hopefully, they can fix it for the next release.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by integrate on Thu Jun 19, 2014 8:12 am

This is a well known bug with a fix:

http://forum.arduino.cc/index.php?PHPSE ... =146802.30

But the fix appears to break the recently fixed adafruit pwm shield library, and presumably the motor shield as well. Can you take a look at this?

integrate
 
Posts: 14
Joined: Thu Feb 06, 2014 12:36 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by adafruit_support_rick on Mon Jun 23, 2014 1:22 pm

I'm not seeing any problems. In what way are you seeing the library broken?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

by integrate on Sun Jul 27, 2014 8:11 pm

Nevermind. Figured out it was a combination of not enough juice (8 servos with 2.5A max stall) and an issue where I was sending a float instead of an int to setPWM().

thanks anyway

integrate
 
Posts: 14
Joined: Thu Feb 06, 2014 12:36 am

Please be positive and constructive with your questions and comments.