View previous topic :: View next topic |
Author |
Message |
Vovachess
Joined: 15 Mar 2004 Posts: 33 Location: Swiss
|
2 rs232 on PIC |
Posted: Sun Jul 25, 2004 7:03 am |
|
|
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
|
|
Posted: Sun Jul 25, 2004 9:42 am |
|
|
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
|
|
Posted: Mon Jul 26, 2004 7:01 am |
|
|
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
|
|
Posted: Mon Jul 26, 2004 8:37 am |
|
|
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 |
|
|
|