View previous topic :: View next topic |
Author |
Message |
Ed Arnold
Joined: 02 Nov 2003 Posts: 18
|
multiple serial ports using 1 USART |
Posted: Fri Dec 24, 2004 5:23 pm |
|
|
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 |
|
|
burnsy
Joined: 18 Oct 2003 Posts: 35 Location: Brisbane, Australia
|
|
Posted: Fri Dec 24, 2004 6:08 pm |
|
|
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
|
Re: multiple serial ports using 1 USART |
Posted: Fri Dec 24, 2004 9:06 pm |
|
|
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 |
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
|
|
Posted: Sun Dec 26, 2004 3:02 pm |
|
|
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
|
|
Posted: Mon Dec 27, 2004 9:53 pm |
|
|
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. |
|
|
|