CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

16f877A multiple servos and RS232

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Sling989



Joined: 17 Oct 2010
Posts: 3

View user's profile Send private message

16f877A multiple servos and RS232
PostPosted: Sun Oct 17, 2010 9:44 am     Reply with quote

Hi I'm very new to programming PICs and I need to program a 16F877A so that it moves 3 standard servos with high precision - 180 degrees for one of them. I'll be using RS232 to feed instructions. Does anyone have a working code for that?
Sling989



Joined: 17 Oct 2010
Posts: 3

View user's profile Send private message

PostPosted: Sun Oct 17, 2010 5:21 pm     Reply with quote

I'm able to move one servo using delay_ms commands now ... any advice on coding the PIC to move more than one servo would be very much appreciated from this C newbie !

Maybe using an interrupt or timer1 ???

It'll have to do more than just move servos in its final application so all the different methods of coding that I've come across in my research have got me kind of puzzled as to the best way to do it !
sturnfie



Joined: 26 Apr 2010
Posts: 17
Location: Palatine, IL

View user's profile Send private message Visit poster's website

PostPosted: Mon Oct 18, 2010 11:01 am     Reply with quote

Sling989 wrote:
I'm able to move one servo using delay_ms commands now ... any advice on coding the PIC to move more than one servo would be very much appreciated from this C newbie !

Maybe using an interrupt or timer1 ???

It'll have to do more than just move servos in its final application so all the different methods of coding that I've come across in my research have got me kind of puzzled as to the best way to do it !


For the RS232 functionality, I'd recommend using a UART module on the PIC and a MAX232 transceiver chip.

Servos are usually driven by a PWM signal. The pulse width maps to a specific rotation of the servo from center. Use several PWM modules if you want to easily drive several servos. You can also bit-bang regular I/O pins to implement a PWM signal, but then you'll have to handle the timing portions yourself.
_________________
Lucas Sturnfield
Blog - http://www.sturntech.com/blog
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 18, 2010 11:10 am     Reply with quote

There is code on the forum for multiple servos but it doesn't meet his
precision requirement.
http://www.ccsinfo.com/forum/viewtopic.php?p=115112
http://www.ccsinfo.com/forum/viewtopic.php?t=42264
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Oct 18, 2010 11:52 am     Reply with quote

I have to assume you mean HOBBY style RC servos..

.. not the stuff I deal with.

In future please specify the make/model as 'servo' is a generic word, kinda like 'computer'....
Sling989



Joined: 17 Oct 2010
Posts: 3

View user's profile Send private message

PostPosted: Tue Oct 19, 2010 6:24 pm     Reply with quote

temtronic wrote:
I have to assume you mean HOBBY style RC servos..

.. not the stuff I deal with.

In future please specify the make/model as 'servo' is a generic word, kinda like 'computer'....


Sorry about that. They are Futaba S148 servos.

http://www.technobotsonline.com/futaba-servo-s148.html
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group