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 many Stream's Can I Use?

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







How many Stream's Can I Use?
PostPosted: Mon Oct 04, 2004 9:21 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 04, 2004 10:34 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 04, 2004 5:27 pm     Reply with quote

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
PostPosted: Tue Oct 05, 2004 3:21 am     Reply with quote

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

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

PostPosted: Tue Oct 05, 2004 8:42 am     Reply with quote

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

View user's profile Send private message

Re: RS232 Streams
PostPosted: Tue Oct 05, 2004 5:42 pm     Reply with quote

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)
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