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

How can I configure 2 or more serial port in CCS

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







How can I configure 2 or more serial port in CCS
PostPosted: Wed Aug 25, 2004 12:46 am     Reply with quote

I want to interface one PIC with two serial interface devices like PIC Basic(Serout).
How to write program?

For example :

putc(Device1); // send data to device #1 via serial port #1
putc(Device2); // send data to device #2 via serial port #2
putc(Device3); // send data to device #3 via serial port #3


Thanks
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Wed Aug 25, 2004 12:56 am     Reply with quote

Use two #use rs232 statements with different stream identifiers, like:



Code:

#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,restart_wdt,errors,stream=Ser1) //Using hardware UART of PIC16F870
#use rs232(baud=19200,parity=N,xmit=PIN_C3,rcv=PIN_C2,bits=8,stream=Ser2)  /Software UART


and then:

Code:
putc (data1,Ser1);
putc (data2,Ser2);
Dandy
Guest







PostPosted: Wed Aug 25, 2004 11:55 pm     Reply with quote

Haplo
Thank you very much.
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