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

RS485 half duplex direction control

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



Joined: 20 Aug 2007
Posts: 2

View user's profile Send private message

RS485 half duplex direction control
PostPosted: Fri Aug 24, 2007 10:34 am     Reply with quote

What do I need to do to control the RS485 TX and RX direction with one PIC? I can setup the PIC to TX data or RX data. When I try to use one PIC to TX and RX I can TX but not RX, eventhough there is data on the PIC RX pin. Using a PIC16F876A and a SN65176BP transceiver.

Thanks in advance.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri Aug 24, 2007 11:27 am     Reply with quote

Basically you should either TX or RX but not TX and RX at the same time. If you use one PIC pin to control the RS485-to-logic converter you should be OK. The #use statement for the serial port has a parameter to control the pin attached to the converter.
Guest








PostPosted: Fri Aug 24, 2007 12:11 pm     Reply with quote

The driver and receiver have active-high and active-low
enables, respectively, that can be connected together externally to function as a direction control.

Tie the enables together and connect them to a pin from the PIC and let the #use rs232 control direction?

terryallen1981
ritchie



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

PostPosted: Sun Aug 26, 2007 12:32 am     Reply with quote

Analyzing the given schematic below... you could be able to control the direction of TX and RX in RS485 communication without using any I/O pin from PICmicro.

Take note: the circuit is always in the receive mode and when it transmit data it will sample the transmitted data to trigger the direction of the RS485 pin.

I hope this helps coz I use this in one of my project before and it is working perfectly.



The image is hosted by: ImageShack for Free Image Hosting

^::^
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

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

PostPosted: Mon Aug 27, 2007 9:13 am     Reply with quote

With this circuit, won't you get the TX data looped back in the RX?
You Rx all the time and selectively tx. But when you tx won't that data
appear in the Rx? I would/do do it as guest suggested above.
Ttelmah
Guest







PostPosted: Mon Aug 27, 2007 9:36 am     Reply with quote

Yes. In fact it is slightly worse than that. With this circuit, you are only driving during the -ve (on the PIC) 'parts' of the serial waveform, and are reliant on the bus bias for the 'drive' during the other parts of the waveform. This will give slower edges, poorer noise rejection, and shorter range operation, than RS485 is really capable of...
The normal way of doing this, is to use a monostable multivibrator, triggered on the falling edge of the serial line, that then holds the buffer in transmit mode, for the entire 'byte time'. More sophisticated units, use something like an 8pin PIC, detect the incoming baud rate, and automatically adjust how long the driver is enabled for.

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