ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
unknowndomain
 
Posts: 1
Joined: Mon Jun 09, 2014 5:35 pm

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by unknowndomain »

Hey,

I am interested in finding out more about the project, could we talk via email [email protected]

Thanks

Tom

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by sonicalflair »

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?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by adafruit_support_rick »

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

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by sonicalflair »

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?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by adafruit_support_rick »

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?

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by sonicalflair »

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...

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by adafruit_support_rick »

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?

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by integrate »

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!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by adafruit_support_rick »

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

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by integrate »

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 BANNED. External 6v 10a power supply. Don't know for sure but really does look like an i2c communication issue.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by adafruit_support_rick »

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

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by integrate »

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?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by adafruit_support_rick »

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

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

Re: ARDUINO DUE + ADAFRUIT MOTORSHIELD V2

Post by integrate »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”