I am working on a project where I am controlling two Pololu 9.7:1 HP 12V w/encoder DC Motors using the Dual VNH5019 Motor Driver. I am using the Motor driver as a shield with an Arduino Due. The Motor driver library is written for the Atmel ATmega based chips and the Arduino due has a SAM3X8E chip which has different timers for PWM. My project goal is to use the 12bit PWM resolution that the Arduino due provides for controlling the motor. I also want to make use of a higher PWM frequency to ensure smooth switching in motor directions. My project needs high precision and I am stuck to see if I can make any modifications to the library to make use of the 12 bit PWM outputs available from the Arduino due microcontroller. Any help is much appreciated.
Unfortunately, we do not currently have any plans to add support for higher-frequency PWM on the Due to the DualVNH5019MotorShield library. If you are interested in implementing this yourself, you would need to learn how to work with the Due’s PWM outputs on a low level, which would most likely involve configuring registers directly. You might consider searching for information or asking on the Arduino forum; this thread looks like it might have some relevant discussion that might help point you in the right direction.
Thanks for your reply, I did try to follow the Arduino thread you mentioned above and tried to play with the register level, but did not succeed. Hence the reason for my post here. I will try it out again and if I could get a solution will update it here.