Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help, check my circuit

Status
Not open for further replies.

Das

Newbie level 3
Newbie level 3
Joined
May 22, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,321
check my circuit

hi every one,
i am designing a stepper motor controller using 8051 microcontroller, my ckt is not working (stepper motor is not running), i am using unipolar 6 wire stepper motor. i don know where the problem is.
this is my code:

NAME STEPPER_MOTOR

;USING 0 ; Register-Bank 0

; Execution starts at address 0 on power-up.
;JMP START

; first set Stack Pointer
START: JMP OVER

; Continuously check whether any key is pressed
POLL: MOV A, P3
CJNE A, #0FFH, CHECK_P3
JMP POLL

; Find which key is pressed and call the ROTATE
CHECK_P3: RRC A
JNC ROTATE
INC R1
JMP CHECK_P3

; Used to rotate the Stepper Motor
ROTATE: CJNE R1, #4H, NXT_LOGIC
CALL CLOCKWISE
JMP OVER

NXT_LOGIC: CJNE R1, #5H, NXT_LOGIC_2
CALL ANTI_CLOCK
JMP OVER

NXT_LOGIC_2: CJNE R1, #6H, NXT_LOGIC_3
CALL NEW_LOGIC
JMP OVER

NXT_LOGIC_3: ; CJNE R1, #7H, NXT_LOGIC_4
CALL NEW_LOGIC_ONE
JMP OVER

;NXT_LOGIC_4: CJNE R1, #8H, NXT



;MOTOR_SEL: CJNE R1, #6H, OVER
; CALL SELECT_MOTOR
; JMP OVER

; Rotate the Stepper Motor clockwise direction
;CLOCKWISE: MOV R1, #32H
CLOCKWISE: MOV R1, #0FFH
GO_CLOCK: MOV P2, #0CH
CALL DELAY
MOV P2, #06H
CALL DELAY
MOV P2, #03H
CALL DELAY
MOV P2, #09H
CALL DELAY
DJNZ R1, GO_CLOCK
RET

ANTI_CLOCK: MOV R1, #32H
;ANTI_CLOCK: MOV R1, #0FFH
GO_ACLOCK: MOV P2, #05H
CALL DELAY
MOV P2, #0AH
CALL DELAY
;MOV P2, #04H
;CALL DELAY
;MOV P2, #02H
;CALL DELAY
DJNZ R1, GO_ACLOCK
RET


NEW_LOGIC: MOV R1, #0FFH
GO_NLOGIC: MOV P2, #08H
CALL DELAY
MOV P2, #04H
CALL DELAY
MOV P2, #02H
CALL DELAY
MOV P2, #01H
CALL DELAY
DJNZ R1, GO_NLOGIC
RET

NEW_LOGIC_ONE: MOV R1, #0FFH
GO_NLOGIC_ONE: MOV P2, #08H
CALL DELAY
MOV P2, #0CH
CALL DELAY
MOV P2, #04H
CALL DELAY
MOV P2, #06H
CALL DELAY
MOV P2, #02H
CALL DELAY
MOV P2, #03H
CALL DELAY
MOV P2, #01H
CALL DELAY
MOV P2, #09H
CALL DELAY
DJNZ R1, GO_NLOGIC_ONE
RET

;SELECT_MOTOR: JB P3.6, AZIMUTH_MOTOR
; MOV R0, #80H
; MOV @R0, #01H
; JMP OVER
;AZIMUTH_MOTOR: MOV R2, P2
; JMP OVER

; Initialize the Ports and return back to polling mode
OVER: MOV R1, #00H
MOV P2, #00H
MOV P3, #0FFH
;MOV R0, 01H
JMP POLL

; it will insert the delay of 30ms
DELAY: MOV R5, #1EH
;DELAY: MOV R5, #0FFH
LOOP: MOV R4, #0FAH
LEVEL2: NOP ; approx nop take 2.0 microsecond
NOP
;NOP
;NOP
;NOP
DJNZ R4, LEVEL2
DJNZ R5, LOOP
RET

END




help me, Thanks in advance
Das
 

except the fact that all the keys are shifted one place (they should begin at P3.4 to P3.7) and that the NXT_LOGIC_4 label you took out, should be something like this
Code:
NXT_LOGIC_4: jmp OVER
I think the program could work... So maybe the problem is at the hardware... first check the port outs with simple leds... if the leds don't light with your sequences... check the board...

maybe your motor wiring is not working! in a stepper motor, you should check which coil combination makes the motor to spin...
 

    Das

    Points: 2
    Helpful Answer Positive Rating
Try directly powering the stepper motor. Input V is probably ±3 to ±5. Disconnect motor from circuit and try powering from power supply. If all leads check, try the connectors. Substitute LEDs (with appropriate resistors) for the motor leads.
 

    Das

    Points: 2
    Helpful Answer Positive Rating
Thanks for ur help (Electronics dude...) Kurenai_ryu. i will check my ckt as u said, and let u know the result.

-Das

Added after 22 minutes:

Thanks for ur reply Mr. Mathman47, sure i will check my stepper motor with direct power supply and i don know how i miss this.

Sir, i need one more help, this is with morse code generation, i am generating ILS and VOR signal in matlab, in that i have to add morse code with my amplitude modulated signal.
i don know how to add morse code with a AM wave.
i came to know that u r specialised with ham radio from ur profile, so please help me out,.
 

Hai Das,
For sending morse on AM, you just need to key On/Off the RF final stage according to the morse codes and thus the RF is switched as per the codes. Another way (I used to) is to modulate the tone on the RF and put a modulated wave. The first method is accepted one and the second i tried as my crazy idea of experimenting. But it works. Good luck
 

    Das

    Points: 2
    Helpful Answer Positive Rating
hi pranam,
i think ur second method will help my project, because i already had a discussion abt the 1st method with my boss and it wont help. but still i am struggling to add morse code with AM signal.
Morse code is generally transmitted as "dots" and "dashes" or "dits" and "dahs", so i have no idea how to add these things with AM wave.
help me out.,
Thanks
 


Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top