Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Stefans Toolbox and MotorShield. Does not run!


  • Please log in to reply
24 replies to this topic

#21 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 28 May 2012 - 11:16 AM

Hi Allan and welcome to the Netduino forums!

Hi Stephen,

Who? :huh: B)

Anything incorrect stand out and should it work with the shield base? Any help would be much appreciated.



It should indeed work, but there are still some issues with PWM on the shieldbase I believe. Keep in mind the shieldbase is in Beta. One thing I would check out though;

sb.PWMChannels.PWM_4 == Pin D3
sb.PWMChannels.PWM_3 == Pin D10
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#22 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 28 May 2012 - 03:41 PM

var sb = new ShieldBase(GoSockets.Socket5);

// Defines the H-Bridge IC on the correct pins
var motorDriver = new HBridge(sb.PWMChannels.PWM_4, sb.Pins.GPIO_PIN_D5, sb.PWMChannels.PWM_3, sb.Pins.GPIO_PIN_D2);

Hi Allan,

The Shield Base is an awesome addition to the Netduino Go platform, however, unfortunately it is still in beta and has some bugs with PWM. They are working on a fix for the PWM of which should be released in the near future.

I also noticed that your pin assignments may be a little off. The HBridge class expects the following arguments, speed control 1(PWM), direction 1, speed control 2, direction 2. You have provided four, but I'm not sure which actual digital pins you are using. PWM is only available on certain digital pins, and for the most part the Shield Base follows the same pinout as the Netduino Plus, however there isn't a lot of information out there at the moment regarding which digital pins PWM_0 to PWM_5 are referring to. If you look at the schematics of the shield base we can see that PWM_0 is found on D5, PWM_1 on D6, PWM_2 on D9 and PWM_3 on D10. The extra two are uncertain at the moment.

In your code you use PWM_4 for the speed control and D5 as the direction of motor 1. Since, we aren't sure of the PWM_4 perhaps it would be best to use PWM_2 (D9). You can still use D5 for the motor direction, however down the road you may want to keep it free for something else requiring PWM.

Hopefully this isn't too long winded and you can have you code ready for when the firmware for the shield base is updated.

Cheers,
Steve

Update: Sorry didn't, I see Stephen ;) had beat me to the punch. And PWM_4 is D3!!!

#23 alhardy

alhardy

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationSydney, Australia

Posted 29 May 2012 - 03:57 AM

Sorry Stefan :)

Thanks for the replies guys, I didn't expect such quick response, nice to have an active forum!

Stefan, by saying

sb.PWMChannels.PWM_4 == Pin D3
sb.PWMChannels.PWM_3 == Pin D10

are you saying that sb.PWMChannels.PWM_4 = pin 3 in the digital io part on the netduino shieldbase? How do I tell which can be used for PWM?

#24 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 29 May 2012 - 06:06 AM

are you saying that sb.PWMChannels.PWM_4 = pin 3 in the digital io part on the netduino shieldbase? How do I tell which can be used for PWM?

Yep.
I once made a list for myself which I believe is correct;

internal const Cpu.PWMChannel GPIO_PIN_D3 = (Cpu.PWMChannel)0x04;
        internal const Cpu.PWMChannel GPIO_PIN_D5 = (Cpu.PWMChannel)0x00;
        internal const Cpu.PWMChannel GPIO_PIN_D6 = (Cpu.PWMChannel)0x01;
        internal const Cpu.PWMChannel GPIO_PIN_D9 = (Cpu.PWMChannel)0x02;
        internal const Cpu.PWMChannel GPIO_PIN_D10 = (Cpu.PWMChannel)0x03;
        internal const Cpu.PWMChannel GPIO_PIN_D11 = (Cpu.PWMChannel)0x05;

"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#25 alhardy

alhardy

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationSydney, Australia

Posted 29 May 2012 - 06:22 AM

Yep.
I once made a list for myself which I believe is correct;

internal const Cpu.PWMChannel GPIO_PIN_D3 = (Cpu.PWMChannel)0x04;
        internal const Cpu.PWMChannel GPIO_PIN_D5 = (Cpu.PWMChannel)0x00;
        internal const Cpu.PWMChannel GPIO_PIN_D6 = (Cpu.PWMChannel)0x01;
        internal const Cpu.PWMChannel GPIO_PIN_D9 = (Cpu.PWMChannel)0x02;
        internal const Cpu.PWMChannel GPIO_PIN_D10 = (Cpu.PWMChannel)0x03;
        internal const Cpu.PWMChannel GPIO_PIN_D11 = (Cpu.PWMChannel)0x05;


Nice, thanks again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.