View previous topic :: View next topic |
Author |
Message |
restman Guest
|
Two different serial communication at the same time. |
Posted: Tue Apr 29, 2008 7:21 am |
|
|
Hi.
How can i do two serial communication at the same time by using PIC. Can i use USART module for two different serial communication.
Thanks for your help. |
|
|
Matro Guest
|
|
Posted: Tue Apr 29, 2008 7:49 am |
|
|
The simplest way is to use a PIC that has 2 UARTs.
Actually it depends on what kind of UART. If one of them shall just send data (only TX), you can think about implementing it in software.
Difficult to say more without any extra information about your project.
Matro |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Apr 29, 2008 7:50 am |
|
|
If I were you I'd find a PIC with 2 hardware USARTS.
Then you could fill the buffers and the IRQ could trickle out the data
at the right rate. |
|
|
Guest
|
|
Posted: Tue Apr 29, 2008 7:59 am |
|
|
Hmm. that's one solution thanks.
In my project, i need min 5m distance for one communication, min 80m for the other communication. We use 18f4620 for our latest project and we want to develop it by adding two serial communications.
Is there any other solution along this solution? |
|
|
Matro Guest
|
|
Posted: Tue Apr 29, 2008 8:10 am |
|
|
You will never achieve a 80m communication with RS-232.
Maybe with RS-485. So you will need an external driver.
Matro. |
|
|
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Tue Apr 29, 2008 8:17 am |
|
|
Matro wrote: | You will never achieve a 80m communication with RS-232.
Maybe with RS-485. So you will need an external driver.
Matro. |
I don't think that is a hard and fast limit. If the baud rate is low enough and the line is adequately filtered, you can go 80m and much farther than that. For 80m, I would try 2400 baud.
Robert Scott
Real-Time Specialties |
|
|
restman Guest
|
|
Posted: Tue Apr 29, 2008 8:17 am |
|
|
Hmm. We've searched for it and we found that we could use sn75176 for it. But i don't know how to use it exactly. I found and read its datasheet but couldn't find an example code for PIC. If i can find i think we can use two sn75176 for two different communications. |
|
|
restman Guest
|
|
Posted: Tue Apr 29, 2008 8:20 am |
|
|
RLScott wrote: | Matro wrote: | You will never achieve a 80m communication with RS-232.
Maybe with RS-485. So you will need an external driver.
Matro. |
I don't think that is a hard and fast limit. If the baud rate is low enough and the line is adequately filtered, you can go 80m and much farther than that. For 80m, I would try 2400 baud.
Robert Scott
Real-Time Specialties |
Data safety is important for us so i think we should use a safer solution. But thanks for your comments. |
|
|
Matro Guest
|
|
Posted: Tue Apr 29, 2008 8:36 am |
|
|
restman wrote: | Hmm. We've searched for it and we found that we could use sn75176 for it. But i don't know how to use it exactly. I found and read its datasheet but couldn't find an example code for PIC. If i can find i think we can use two sn75176 for two different communications. |
I don't see the need for code example. This driver is "just" connected to USART of PIC and convert single-ended serial com to RS-485.
As another example of appropriate part, look for instance at the MAX3535E datasheet that is a full-duplex converter.
Matro. |
|
|
restman Guest
|
|
Posted: Tue Apr 29, 2008 8:46 am |
|
|
Ok. I understood. Now, it can be only used one sn75176 per PIC(with one USART), did i understand correctly?
Is there another driver solutions that can be used without SFR? |
|
|
Matro Guest
|
|
Posted: Tue Apr 29, 2008 9:03 am |
|
|
You have to use one SN75176 by channel, i.e. one for RX and one for TX. Of course if you only need RX or TX, you can use only one.
But I definitely don't see what SFR do here !!??
Matro. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
|
|