Microcontroller programming for motor control

Discussion in 'Embedded Systems and Microcontrollers' started by milksica, Nov 2, 2009.

  1. milksica

    Thread Starter New Member

    Nov 2, 2009
    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 -___-
    Last edited: Nov 2, 2009
  2. Markd77

    Senior Member

    Sep 7, 2009
    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.
  3. milksica

    Thread Starter New Member

    Nov 2, 2009
    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?
  4. russ_hensel

    Distinguished Member

    Jan 11, 2009
    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 ).