pic16f877a and sc16a

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

pic16f877a and sc16a

Postby kane » Thu Nov 25, 2010 7:43 pm

hi..im currently working with a pic16f877a and a sc16a servo controller.
my question is, how do i trasfer my command from pic to sc16a? is it by enable the uart of the pic?
kane
Freshie
 
Posts: 6
Joined: Fri Oct 22, 2010 11:05 pm

Re: pic16f877a and sc16a

Postby yonghui » Thu Nov 25, 2010 8:56 pm

hi,

i never use Sc16, but i think yes, through uart comunication.


yh
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: pic16f877a and sc16a

Postby shahrul » Thu Nov 25, 2010 9:24 pm

kane WROTE:hi..im currently working with a pic16f877a and a sc16a servo controller.
my question is, how do i trasfer my command from pic to sc16a? is it by enable the uart of the pic?

Ofcourse must enable the UART module. Just setting TXSTA, RCSTA and SPBRG. I use this way.
CODE: SELECT_ALL_CODE
#define BAUD        9600
#define _XTAL_FREQ    20000000

void uart_init(void)
{
TXSTA=0b10100000;      
RCSTA=0b10010000;
SPBRG=(int)(_XTAL_FREQ/(64.0*BAUD)-1);
}

See example.
I never use sc16a yet.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: pic16f877a and sc16a

Postby ober » Thu Nov 25, 2010 9:58 pm

I thought SC16A have the sample source code, why don refer there?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: pic16f877a and sc16a

Postby kane » Thu Nov 25, 2010 11:07 pm

oh ya...didnt notice it b4...thanks ya..my problem solve ard...
kane
Freshie
 
Posts: 6
Joined: Fri Oct 22, 2010 11:05 pm

Re: pic16f877a and sc16a

Postby ober » Sat Nov 27, 2010 9:41 pm

Good to hear that!
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm


Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 8 guests

cron