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

Two different serial communication at the same time.

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







Two different serial communication at the same time.
PostPosted: Tue Apr 29, 2008 7:21 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 7:49 am     Reply with quote

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

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

PostPosted: Tue Apr 29, 2008 7:50 am     Reply with quote

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








PostPosted: Tue Apr 29, 2008 7:59 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 8:10 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Apr 29, 2008 8:17 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 8:17 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 8:20 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 8:36 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 8:46 am     Reply with quote

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







PostPosted: Tue Apr 29, 2008 9:03 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Apr 29, 2008 9:28 am     Reply with quote

Quote:

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 hope these references are useful.

http://www.ccsinfo.com/forum/viewtopic.php?t=23958&highlight=rs485
http://www.ccsinfo.com/forum/viewtopic.php?t=25720&highlight=rs485
http://www.lammertbies.nl/comm/info/RS-485.html

Humberto
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