|
|
View previous topic :: View next topic |
Author |
Message |
bertronicom Guest
|
How many Stream's Can I Use? |
Posted: Mon Oct 04, 2004 9:21 am |
|
|
How many diferent serial ports can be used by the way of Stream?
#use rs232(STREAM=HOST_id, baud=9600,parity=N,xmit=HOST_TX,rcv=HOST_RX,bits=8)
#use rs232(STREAM=BT_id, baud=9600,parity=N,xmit=BT_TX,rcv=BT_RX,bits=8)
I'm working with CCS last version, and I'm sucessfully work with 2 conections. |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Oct 04, 2004 10:34 am |
|
|
I am using three streams on a 16C771, but I suspect the only limits are RAM and ROM space. What chip are you using? _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon Oct 04, 2004 5:27 pm |
|
|
In theory, there are is limit to the number of streams you can use. As SherpaDoug said the limiting factor is the code space, and also availability of I/O pins (althoug you can define two different streams on the same pins).
I have used 4 without any problems. |
|
|
bertronicom Guest
|
RS232 Streams |
Posted: Tue Oct 05, 2004 3:21 am |
|
|
Hello SherpaDoug, I'm using PIC18LF252 at 3.3volts.
I've configured two RS232 serial ports.
#use rs232(STREAM=HOST_id, baud=9600,parity=N,xmit=HOST_TX,rcv=HOST_RX,bits=8)
#use rs232(STREAM=BT_id, baud=9600,parity=N,xmit=BT_TX,rcv=BT_RX,bits=8)
void main () {
fprintf( BT_id , "INQUIRY 5 NAME\n\r");
fprintf( HOST_id , "\n\rRx Comando: INQUIRY_NAME");
}
In this case de first fprintf works but not second.
void main () {
#use rs232(STREAM=BT_id, baud=9600,parity=N,xmit=BT_TX,rcv=BT_RX,bits=8)
fprintf( BT_id , "INQUIRY 5 NAME\n\r");
#use rs232(STREAM=HOST_id, baud=9600,parity=N,xmit=HOST_TX,rcv=HOST_RX,bits=8)
fprintf( HOST_id , "\n\rRx Comando: INQUIRY_NAME");
}
This code works.
Theoretically the first code would work �isn't so?
Hello Haplo, Are you saying you're multiplexing two pins to diferents RS232 conections?
It's working fine?
thanks everyone |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Oct 05, 2004 8:42 am |
|
|
I think I do something like this too.
Code: |
#use rs232(baud=38400,xmit=PIN_C4,INVERT,stream=DEBUG)
#use rs232(baud=38400,xmit=PIN_C4,INVERT,stream=STDERR) //
#use rs232(baud=19200,xmit=PIN_C6,rcv=PIN_C7,stream=RS485) // RS485 is the default
|
one is is STDERR and one is DEBUG,.. both to the same pins..
in therory I can take out debug,.. and leave STDERR. |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
Re: RS232 Streams |
Posted: Tue Oct 05, 2004 5:42 pm |
|
|
bertronicom wrote: |
Hello Haplo, Are you saying you're multiplexing two pins to diferents RS232 conections?
It's working fine?
|
Yes you can, and it works fine. Taken from one of my source files:
Code: |
#use rs232(baud=4800 ,parity=N,xmit=PIN_C3,rcv=PIN_C2,enable=PIN_C1,bits=8,restart_wdt,stream=EUM1)
#use rs232(baud=1200 ,parity=N,xmit=PIN_C3,rcv=PIN_C2,enable=PIN_C1,bits=8,restart_wdt,stream=EUM2)
|
|
|
|
|
|
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
|