Pages: [1]   Go Down
Author Topic: Due PWM & H-bridge motor control.  (Read 355 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm working to get my Due to control to drive a Robot Power MegaMoto shield...
http://www.robotpower.com/products/MegaMoto_info.html

It looks like I can use the MegaMoto to do just about everything I want to do, from driving servos to driving 3ph brushless DC motors!  So fabulous...

except...

... all of the PWM libraries I have found so far for Due seem to be limited to using pins 6-9 for output.  Apparently the Due is supposed to have 13 PWM channels?  I am wondering why the 6-9 limitation is there, and how to get around it?

The immediate problem is that the MegaMoto can be configured to use D5, D10, or D3 for its channel B PWM input.  None of those channels are within the 6-9 range!

For the time being I've written a software PWM that uses timers and interrupts to provide PWM on whatever pin I want... and this works.  But this approach is a kludge at best, it is super high overhead, and it is going to really limit what else I can do with the chip down the road.  I know that the SAM chip is capable of a lot more and I want to do it right!

I'm really not sure how to get access to the super cool SAM capabilities.

Any suggestions?

Thanks,

Bill
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 124
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi I work on the same project too

try to use the ASF example pwm_synch with some modifications it will enable you to get 3 pwm channels which works synchronous to each other ...

Please tell me if you have any code devoplments
Logged

Pages: [1]   Go Up
Jump to: