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 support@ccsinfo.com

PIC18F458 control ServoController(serial) board of parallax

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







PIC18F458 control ServoController(serial) board of parallax
PostPosted: Wed Aug 09, 2006 9:39 pm     Reply with quote

How to using PIC to control ServoController(serial) board of parallax.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 11, 2006 12:28 pm     Reply with quote

I can't find any board on the Parallax website called a "ServoController".
weetax



Joined: 12 Aug 2006
Posts: 3

View user's profile Send private message

Parallax servo controller board website.
PostPosted: Sat Aug 12, 2006 9:11 pm     Reply with quote

http://www.parallax.com/detail.asp?product_id=28023
weetax



Joined: 12 Aug 2006
Posts: 3

View user's profile Send private message

PIC18F458 control ServoController(serial) board of parallax
PostPosted: Sat Aug 12, 2006 9:17 pm     Reply with quote

It's using serial communication (Open collector).

I'm useing PIC18F458.But parallax board can't response.If i'm using BasicStamp it can be worked. This is my source.

Quote:
#include <18f458.h>
#define TxD PIN_C6
#define RxD PIN_C7

#fuses H4
#fuses NOLVP, NOWDT
#fuses NOPROTECT
#use delay (clock=40000000)
#use rs232(baud=9600,xmit=TxD,rcv=RxD,stream=pc)
#use rs232(baud=2400,parity=N,xmit=PIN_D0,rcv=PIN_D1,bits=8,stream=psoc,float_high,ERRORS)
#ignore_warnings 202

void INT_Serial(void);

#INT_RDA
void INT_Serial(void){
char c,x,y,z;
long lo,hi,ch,ra;
long data;
c = getc();
switch(c){
case 'a' : fprintf(pc,"pos:1100\n");
data = 1100;
lo = data%255;
hi = data/255;
ch = 0;
ra = 0;
fputc('!',psoc);
fputc('S',psoc);
fputc('C',psoc);
fputc(ch,psoc);
fputc(ra,psoc);
fputc(lo,psoc);
fputc(hi,psoc);
fputc(13,psoc);
break;
case 'b' : fprintf(pc,"pos:500\n");
data = 500;
lo = data%255;
hi = data/255;
ch = 0;
ra = 0;
fputc('!',psoc);
fputc('S',psoc);
fputc('C',psoc);
fputc(ch,psoc);
fputc(ra,psoc);
fputc(lo,psoc);
fputc(hi,psoc);
fputc(13,psoc);
break;
}
}

void main(void){
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA);
while(1){
}
}
[/quote]
weetax



Joined: 12 Aug 2006
Posts: 3

View user's profile Send private message

Success.
PostPosted: Sat Aug 12, 2006 9:39 pm     Reply with quote

OK, I'm can be solve my problem.By change the option of rs232.

Quote:
#use rs232(baud=2400,xmit=PIN_D0,rcv=PIN_D0,stream=psoc,float_high,ERRORS)
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