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 Full Duplex to Half Duplex Conversion ? O/T

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



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

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

RS485 Full Duplex to Half Duplex Conversion ? O/T
PostPosted: Mon Nov 03, 2008 5:19 am     Reply with quote

This is bit off topic but I hope there will be a number of interesting comments from people with some experience in RS485. Wink

I have bunch of PIC based devices all happily communicating over a Half Duplex (2-Wire) RS485 Bus. Since I needed to extend the bus from one building to another without using a wire I ordered a pair of radio modems to bridge the gap. I have two Typhoon-4000's http://www.rfsolutions.co.uk/acatalog/Typhoon_Radio_Modem.html

The modems have both RS232 and a RS485 interface and have adequate speed for my application. Very Happy

The problem is the RS485 out of the Modem is Full-Duplex (4-Wire) so I can't just link it up to my 2-Wire bus. Sad

Since the modems can't simultaneously transmit and receive at the same time they are logically the same as my Half-Duplex RS485 bus so there must be some way of getting it to work. Idea

I was therefore wondering if there are any RS485 chip devices that have some kind of "Bus Idle" output. I could then perhaps use this as a bus direction signal in some kind of 4-Wire to 2-Wire 485 Repeater gadget. i,e depending on when the 4-Wire Transmit bus side is idle the 2-Wire bus transceiver side is in the default receive mode. Only when its not idle is the 2-Wire transceiver switch into transmit while the data is being put on the Half Duplex RS485 bus.

Does anyone know of such a gadget or a chip that would do it ? Question

I suppose my problem is really the same as how to implement a Repeater on a Half-Duplex bus if you don't have a data direction signal as well.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Nov 03, 2008 9:13 am     Reply with quote

Why can't you use the Typhoon's RS232 port with a common 232-485 (2 wire) converter box?
_________________
The search for better is endless. Instead simply find very good and get the job done.
Ttelmah
Guest







PostPosted: Mon Nov 03, 2008 9:51 am     Reply with quote

The normal way, is with a timer.
All you do, is decode the RS485 to a 'logic' signal. Feed this into a timer (normally a monostable multivibrator, or a simple processor). Have the design be 'single shot' (not retrigerable), and have the time interval be half a bit 'less'than the time for a character on your bus. So (for instance), if using 9600, N, 8, 1, the time interval would want to be 9.5/600 (one start bit, 8 data bits, and half a stop bit) = 989uSec. Have the timer trigger on the first edge of the start bit. The output of this, then becomes your direction control bit. If you connect this to the data output of the modem, and have the control line that it generates, operating a multiplexer switching these lines 'onto' your half-duplex' bus, and disconnecting your bus from the modem inputs, then when data is seen to arrive 'from' the modem, the unit switches connecting the incoming data to your bus. When nothing is arriving, it switches back.
I have done this on many occassions, using a simple 8pin PIC, and even adding intelligence, so that the code works out the shortest bit time arriving, and makes it's timing 9.5*this, allowing the same chip to be used at different baud rates. The .5, ensures the unit switchs off before the next character, and if your RS485, is biased so that it idles correctly, this gives what you want. Smile

Best Wishes
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

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

PostPosted: Mon Nov 03, 2008 10:19 am     Reply with quote

Dear Ttelmah

That sounds like a useful gadget, perhaps you should consider selling them.
Ttelmah
Guest







PostPosted: Mon Nov 03, 2008 10:40 am     Reply with quote

There are several units doing this for RS232 to RS485, and a couple doing it for TTL serial to RS485. Some of the existing RS485 repeater modules also have this logic in them. Do a search for IC1650A-US. It ought to do what you want.

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