Hi,
To change the speed you to execute the HPWM command. What I'm "objecting" against is this:
Code:
Main:
HPWM.....
HPWM.....
Goto Main
When you do it this your trying to update the PWM generator thousands of time per second. What happens when you update it faster then the frequency it's outputting? I don't know the answer.
In the ISR, determine what duty cycles to send to each motor and execute the HPWM command there. That way you'll update the speed once each interrupt instead of thousands of times per second.
/Henrik.
Bookmarks