PDA

View Full Version : control servo motor by using pic16F84A



waterlee2000
- 20th June 2006, 03:41
how to write a program and control servo motor by using pic16F84A... please help me and teach me because i really really need it!!!!!
thanks

Archilochus
- 20th June 2006, 05:12
Hi waterlee2000,
This section is devoted to peoples "wishes" for PBP functionality. For help with code, try one of the other sections, like the PicBASIC or PicBASICPro forums.

Arch

Acetronics2
- 20th June 2006, 13:52
Hi, Waterloo (!)

Have a look HERE : http://www.rentron.com/SerialServo.htm ( other interesting matter around ...)

and try to UNDERSTAND ...if you REALLY REALLY NEED IT ...

Alain

waterlee2000
- 22nd June 2006, 18:01
Include "modedefs.bas"
si var PORTA.0
pos var byte
servo var byte
cont var byte
trisb = 0
start:
serin si,N2400,servo,pos
for cont = 0 to 50
pulsout servo,pos
pause 15
next cont
goto start

this program just can clockwise only.... then how to write the anti anti clockwise program???

what the different between trisb=0 and trisb=%00000000 ???
what the above mean serin si,N2400 ,servo,pos?? can you explain

Bruce
- 22nd June 2006, 21:10
See the lower section of this project page for info on how pulsout works to
control hobby servos http://www.rentron.com/Micro-Bot/IR_Nav.htm

waterlee2000
- 23rd June 2006, 02:51
that is used by IRLED... my circuit and program as below... please help me check it and correct it... if can, explain to me... thanks... urgency

waterlee2000
- 23rd June 2006, 02:54
that is used by IRLED... my circuit and program as below... please help me check it and correct it... if can, explain to me... thanks... urgency

Bruce
- 23rd June 2006, 05:01
that is used by IRLED... my circuit and program as below... please help me check it and correct it... if can, explain to me... thanks... urgency

Look at the bottom of the page. It explains how to drive a servo with pulsout.

The example in your attachment should also work assuming you are sending a
servo # followed by a position from 100 to 200 as explained on the page
above when using a 4MHz osc.

waterlee2000
- 23rd June 2006, 13:51
then... my lecture said that if you use this circuit, you better choice B because no need any declaration but make sure you program is in true language!!! can you help me check??? or what are you suggestion for this circuit?? A or B??

is it A using C language and B is using basic language??? i cannot understand C and basic, i thought both is C language!!! what the difference???

thanks...

Melanie
- 23rd June 2006, 15:20
Both examples are in BASIC language (though each is slightly different), but unless you have the manual dexterity to accurately toggle S1 at 2400 baud, then example A will not apply.

Acetronics2
- 23rd June 2006, 15:31
Hi, Waterloo

As this section is dedicated to Wishes ... I make one for you:

BEGIN from the beginning : try to learn at first what the different PbP statements do, How PbP programs are built. There's THE Manual for that.

There's also the Parallax "school "...

http://www.parallax.com/html_pages/edu/index.asp

Thousands of pages to explain you " by the example " what to do. And it's free and Downloadable !!!

THEN, you'll save a great, great, great lot of time... as you seem in a hurry !!!

AND we will be seriously able to help you ....

But the first step must come from you ... that's it.

Alain

PS : Note there are no " projects ", ready to download , on this site ...