Motor Shield v2 and Netduino

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
deashute
 
Posts: 4
Joined: Wed Oct 30, 2013 5:46 pm

Motor Shield v2 and Netduino

Post by deashute »

Hi all,

I'm fairly new to the world of Netduino, but my goal is to use stepper motors with the Adafruit Motor Shield v2.0 on my Netduino Plus 2. I have found a plethora of code samples for using the first generation of motor shield with C# and the Netduino, but have had no luck in my attempts to control version 2. I understand that the motor shield is controlled through I2C, but am not completely certain what the process of programming for I2C entails. I know that the majority of users on this forum most likely tend towards Arduino, but does anyone have any experience with Netduino and this motor shield, or maybe any idea of where I can get started?

Thanks,
Dean

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Motor Shield v2 and Netduino

Post by adafruit_support_mike »

I2C is a fairly simple protocol once you get used to it, but you have to suspend disbelief for a while as you do get used to it.

Start by looking at datasheets for a few devices that use I2C. They almost always include a description of the basic protocol, then explain the variations necessary to make the device in question work.

http://www.adafruit.com/datasheets/mcp23017.pdf
http://www.adafruit.com/datasheets/ina219.pdf
http://www.adafruit.com/datasheets/mcp4725.pdf

If you have questions, post back and we'll see if we can help.

deashute
 
Posts: 4
Joined: Wed Oct 30, 2013 5:46 pm

Re: Motor Shield v2 and Netduino

Post by deashute »

Thanks for your help. I suppose that has been my biggest problem so far, grasping that we can control an entire slave device using just two pins.

Those links definitely help in understanding some of the basics. In looking at the first link, there is a table of register addresses (TABLE 1-2). Under the "Access to" heading, are those the names of the pins that I can access through the I2C connection?

Also, I have so far not had any success finding such a data sheet for the Motor Shield v2, at least not one that references I2C and gives the information regarding its use. I have also attempted to look at the C++ library for the Motor Shield, but had very little luck modifying/rewriting that library in C#. I'm hoping that there's a better way.

Thanks,
Dean

deashute
 
Posts: 4
Joined: Wed Oct 30, 2013 5:46 pm

Re: Motor Shield v2 and Netduino

Post by deashute »

This blog post was also very helpful in finding some of the methods to initialize I2C.

http://blog.codeblack.nl/post/NetDuino- ... h-I2C.aspx

The biggest question I have now is how to find the registers for the Motor Shield. Once those are determined, I am hopeful that I can successfully program the Steppers. I just don't really know how to communicate with them at the moment.

Thanks,
Dean

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield v2 and Netduino

Post by adafruit_support_bill »

The Arduino library would be your best reference there. The H-bridge chips are controlled via the PCA9685 PWM chip. Some of the PWM channels us e PWM for speed control. Others are used more like simple digital output pins to control enable the H-bridge.

deashute
 
Posts: 4
Joined: Wed Oct 30, 2013 5:46 pm

Re: Motor Shield v2 and Netduino

Post by deashute »

Thanks Bill!

I found what I think are the register addresses, we'll see if they work. I think I'm making some progress, but unfortunately I know that I'm still a ways off. I think this has helped me get moving though. The real trick for me is to work out transitioning the C++ Adafruit driver to usable C#.

Thanks,
Dean

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

Return to “Arduino Shields from Adafruit”