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.

help me with my pic basic code

Status
Not open for further replies.

crabking

Junior Member level 1
Junior Member level 1
Joined
Nov 23, 2010
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,416
help me with my code and my circuit.i made a linear robot,,,it will grip then slide to opposite position then go back to its original position..

the problem is the stepper motor i used did not work properly..it only vibrate

here is the code

here is the code:

clear
ti var byte
c var byte
z var byte
ti=100
trisb=0

gripper open(cw the gripper stepper):
for z=1 to 2
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay

gripper open1(cw the gripper stepper):
for z=1 to 2
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay3

close(reverse gripper stepper):
for z=1 to 2
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay1

close1(reverse gripper stepper):
for z=1 to 3
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay4

delay:
portb=0
pause 2000
goto close

delay1:
portb=0
pause 2000
goto loop
delay2:
portb=0
pause 2000
goto open1

delay3:
portb=0
pause 2000
goto close1

delay4:
portb=0
pause 2000
goto loop1
delay5:
portb=0
pause 2000
goto open

loop(cw the slider):
for c=0 to 11
portb=8
pause ti
portb=4
pause ti
portb=2
pause ti
portb=1
pause ti
next c
pause 2000
goto delay2

loop1(ccw the slider):
for c=0 to 11
portb=1
pause ti
portb=2
pause ti
portb=4
pause ti
portb=8
pause ti
next c
goto delay5
end


here is the circuit:


if you have idea please help..
 

I have replied the other thread. The usual or best practice is to close one thread and start other one or continue with the same thread. You will not be able to follow 2 threads because your mind has already locked the previous thread and you will never bother to look again.

Re: please help me with my problem about mcu
Here are some useful link to learn.

**broken link removed**

**broken link removed**

https://www.edaboard.com/threads/119493/

**broken link removed**

Read those and do modify according to your requirement you will enjoy it.

Thankyou
 
it is necessary to define an external clock like xt in the program?
 

If you intend to use external crystal then you have to. Otherwise I think it internal clock default.

Thankyou
 
thank you very much...

maybe that is the problem why my project don't run well..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top