Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

MSP430 and Servo Motor (Triying,Triying and Triying...)

$
0
0

Hi everyone 

I have msp430 launchpad development kid. 

https://estore.ti.com/MSP-EXP430G2-MSP430-LaunchPad-Value-Line-Development-kit-P2031.aspx

this is my item.

And I bought an servo motor. 

this is my servo motor. And I want to move it. I try some c code and asm codes.

But it didnt work.

This is my assembly example code.

*
#include "msp430g2553.h"
;-------------------------------------------------------------------------------
ORG 0F800h ; Program Reset
;-------------------------------------------------------------------------------
RESET mov.w #0280h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupP1 bis.b #001h,&P1DIR ; P1.0 output
MOV.B #XT2OFF+RSEL2+RSEL1+RSEL0,&BCSCTL1
MOV.B &CALDCO_1MHZ,&DCOCTL ; Then set target DCOx and
MOV.B &CALBC1_1MHZ,&BCSCTL1 ; Finally set target RSELx ;
Mainloop xor.b #001h,&P1OUT ; Toggle P1.0
call #wait
jmp Mainloop ; Again
;


wait mov.w #9FFh,R5
ss dec R5
jnz ss
ret



;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
END

Thanks for ur help


Viewing all articles
Browse latest Browse all 262198

Trending Articles