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

multiple serial ports using 1 USART

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



Joined: 02 Nov 2003
Posts: 18

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

multiple serial ports using 1 USART
PostPosted: Fri Dec 24, 2004 5:23 pm     Reply with quote

I have a project which will need up to 4 serial ports on 1 USART. For many reasons, I don't wish to use software serial ports. I also don't want to use an external SPI UART like a MAX3100. Since the Main (Master)controller unit and the 4 external devices (SLAVES) will all contain uControllers. Also each external device will be up to 8 feet away, I decided to go with rs232 instead of RS485. I have also decided to use a polling method and switch between each of the 4 Slaves to ask if it has any data to send or for the Master to send it a command. The use of a 74HC139 and 2-74HC4066 bilateral switches should do the job. This would require only 2 more IO pins from the Master uController. The question I have for this forum is, Has anyone tried this? Or, is this idea a wasted effort? Does anyone have a better, more cost effective way of doing this?

Thanks in advance...Happy Holidays Smile
burnsy



Joined: 18 Oct 2003
Posts: 35
Location: Brisbane, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Dec 24, 2004 6:08 pm     Reply with quote

Are you sure you can't use 485? It would be a lot simpler and use less I/O. 485 chips are cheaper than 232s and only one cap req, maybe a resistor as well. As you seem to want a system where your master talks to one slave at a time, 485 sounds perfect.

If it is a case that you have never used 485, someone here will show you a simple protocol to use.

Let us know how you go

regards
_________________
This is the last code change until its ready....
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: multiple serial ports using 1 USART
PostPosted: Fri Dec 24, 2004 9:06 pm     Reply with quote

Ed Arnold wrote:
I have a project which will need up to 4 serial ports on 1 USART. For many reasons, I don't wish to use software serial ports. I also don't want to use an external SPI UART like a MAX3100. Since the Main (Master)controller unit and the 4 external devices (SLAVES) will all contain uControllers. Also each external device will be up to 8 feet away, I decided to go with rs232 instead of RS485. I have also decided to use a polling method and switch between each of the 4 Slaves to ask if it has any data to send or for the Master to send it a command. The use of a 74HC139 and 2-74HC4066 bilateral switches should do the job. This would require only 2 more IO pins from the Master uController. The question I have for this forum is, Has anyone tried this? Or, is this idea a wasted effort? Does anyone have a better, more cost effective way of doing this?

Thanks in advance...Happy Holidays Smile

I did a project using AND gates to multiplex the Slave USART replys. The master transmitts with an address and only the addressed slave replys. The slave's TX is normaly high so only when one is replying does a signal get through.
hentropy



Joined: 27 Oct 2004
Posts: 6
Location: Kuala Lumpur, Malaysia

View user's profile Send private message

PostPosted: Sun Dec 26, 2004 3:02 pm     Reply with quote

Yes, I have done a project using 74LS139 and 74HC151 before (but not using the 2x 74HC4066). In my case, it worked fine and you won't waste your time.

That would be doing the signal splitting at the master.

I've also tried doing an RS-232 bus, after reading some materials on the net, such as this link below. This would be akin to splitting the signal at the slaves.

http://www.epanorama.net/documents/datacom/rs232_bus.html

It also sounds risky but it works. I've done up to 6 devices on a bus with longer distances. For your application of 8 ft, I guess it'll be no problem at all.

Hope it helps, Ed.
Ed Arnold



Joined: 02 Nov 2003
Posts: 18

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

PostPosted: Mon Dec 27, 2004 9:53 pm     Reply with quote

Thanks for all of the replies. After looking at my original ideas and now with your suggestions, it would be most cost effective to use the Mux/Demux idea. It only requires 2 chips, 1 HC139 and 1 HC253. This method can easily controlled by the Master and requires less expense than a simular full duplex RS485 system. I didn't want to daisy chain this anyway. Thanks Again. Smile
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