I used the mbed platform to program PWM on this chip. Links to setup your board for mbed and the mbed pwm api are located here: http://hackaday.io/event/3178/log/10740
You need to use the pins that have PwmOut capability shown in this image:
#include "mbed.h"
PwmOut servo(PTD4);
int main() {
servo.period_ms(20);
servo.pulsewidth_ms(2);
while(1) {
wait(2);
servo.pulsewidth_ms(1);
wait(2);
servo.pulsewidth_ms(2);
}
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.