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

2 rs232 on PIC

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



Joined: 15 Mar 2004
Posts: 33
Location: Swiss

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

2 rs232 on PIC
PostPosted: Sun Jul 25, 2004 7:03 am     Reply with quote

How can I use two rs232 channels in one program?
And how to say printf() function to use one or the other rs232?
Thanks for examples.
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Sun Jul 25, 2004 9:42 am     Reply with quote

Search the help file and readme.txt file for "streams". Also you can search the forum for "streams".
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Jul 26, 2004 7:01 am     Reply with quote

If you have a really old version of the compiler that does not support streams then multiple serial ports is still possible but complicated. Let us know if you are in this situation.
_________________
The search for better is endless. Instead simply find very good and get the job done.
carlosma



Joined: 24 Mar 2004
Posts: 53
Location: Portugal

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Mon Jul 26, 2004 8:37 am     Reply with quote

hello
se this


Code:

#USE RS232(BAUD=9600, XMIT=PIN_B0, RCV=PIN_B1, STREAM=COM_A)

#USE RS232(BAUD=9600, XMIT=PIN_B2, RCV=PIN_B3, STREAM=COM_B)

      main() {
      char c;
      fprintf(COM_A,"Porta A\n\r");
      fprintf(COM_B,"Imprime em B\n\r");
      while(TRUE) {
        c = fgetc(COM_A);
        fputc(c, COM_A);
        fputc(c, COM_B);
      }
    }


Carlos
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