Microcontroller programming for motor control

Thread Starter

milksica

Joined Nov 2, 2009
2
Hello guys,

My current task is to program a micro-controller using MSP430F1611. I am supposed to program the servo motor to move its angle/position. To move its angle/position, i need to use PWM modulation. I am really a newbie in micro controller programming. Can anyone guide me along?

P.S: I have tried reading tutorials and stuff. But i still dont understand -___-
Thanks.
 

Attachments

Last edited:

Markd77

Joined Sep 7, 2009
2,806
You just need to send a 1-2ms pulse every 20ms. 1ms will turn the servo one way, 2ms the other way and 1.5ms it will be in the middle. I'd suggest using the timer interrupt for the 20 ms gap and a loop for the pulse timing. Also try searching for MSP430 servo control - I'm sure you would find an example.
 

Thread Starter

milksica

Joined Nov 2, 2009
2
I dont even know whats the interrupt for. I seriously dont know anything about microprogramming. how do i actually start the programming? & which pins should i use?
 

russ_hensel

Joined Jan 11, 2009
825
There are lots of tutorials out there. You can do it all using timing loops ( not as good as interrupt, but easier ). Generally avoid the pwm peripherals if they are on you chip, as they usually do not have good resolution for this sort of application. C is easier than asm if it is available. Do you have your circuit all set up. If not I would consider restarting with an Arduino ( which could be too easy if you use their servo library ).
 
Top