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 CCS Technical Support

can I have more than two rs232 ports?

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







can I have more than two rs232 ports?
PostPosted: Sun Aug 07, 2005 9:00 pm     Reply with quote

I have read many topics about two ports, i'm curious if i can have three ports.


Nick
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Sun Aug 07, 2005 9:28 pm     Reply with quote

Yes
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sun Aug 07, 2005 11:44 pm     Reply with quote

Yes you can, but.....
The CCS software UART is not interrupt based, so reception and transmission of multiple streams simultaneously is only possible with a good handshake mechanism (software XON-XOFF, or hardware CTS/RTS).

Or use one of the interrupt based drivers you can found on the internet.
Ttelmah
Guest







PostPosted: Mon Aug 08, 2005 4:11 am     Reply with quote

There are three different 'types' of asynchronous serial port you can have/generate. The first is the one (or in the case of some of the more modern chips, two), provided by the UART hardware on the chip. These are nice, since the data is received/transmitted without the CPU having to do the work.
The second is the 'software UART' provided automatically by the compiler, if you attempt to do serial I/O, on pins without the hardware. This (as has been mentioned by Ckielstra), imposes severe timing limitations. There is nothing to stop you implementing multiple serial streams using this technology, but only one at a time can receive or transmit, and any other work, really has to stop while the transfer takes place....
The third is to add an external hardware UART. This then just becomes a matter of writing a suitable driver, depending on the chip chosen. potentially this gives the same advantages as the internal UART, but at the cost of processor pins. The 'lowest cost' solution (in terms of _processor_ resources), is to use an SPI or I2C UART, and use the hardware on the chip that talks to this interface. I have used the MAX3110 this way, which is a fairly bulky chip, but has the advantage of including a RS232 buffer in the package.
At this point, you could perfectly well have a chip with two hardware UARTs internally, add a couple (or more!) of these SPI interfaced UARTs externally, with seperate interrupts and chip select lines, and use a software UART as well!...
It really is just down to how much hardware you want to implement, and the software problems generated as the PIC has to do more.

Best Wishes
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