Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CTS/RTS Question Ethernet

Status
Not open for further replies.

Kamelzz

Newbie level 3
Joined
Mar 5, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,309
Hi,
I am trying to build an ethernet to RS485 converter.

On one side I have TX,RX,CTS,RTS(comming out of an already purchased ethernet to TTL module) and on the other side I have the MAX485 chip.

Now, what Im trying to do is figure out how to switch the max485 from receive to transmit mode and viseversa.
I decided to use the RTS pin : so when asserted to 1 by the PC I will also assert the max485 to tx mode and when RTS pin switches back to 0 I will put max485 in RX mode.
and I also connected the RTS to CTS on the ethernet to ttl module side.
Would that work?
Some people did this strategy but left CTS unconnected. but i don't know how this would work since the PC is asserting RTS to 1 and waiting for CTS to start transmitting so if you leave CTS not connected how would it work?

Im desperate people,any help would be great and a schematic would be better :)

Thanks alot!
 

RS485 operation doesn't need CTS/RTS but a TX enable signal. Check the manual of the converter module, if a suitable signal can be generated. Otherwise you need to generate it in hardware.
 

The chip is digi connect me, which acts sort of an FTDI chip.
Now the RTS I believe can be asserted to high as long as the buffer is full and the chip is transmitting.
so I can use the RTS as mymax485 tx enable signal.
But my question is basically should I aslo connect rhe RTS of the FTDI chip to its CTS? would that work or should I just leave CTS unconnected?

Thanks.
Btw Im a newbie to electronic design please have in mind that I don't have in deapth knowledge on this subject.

---------- Post added at 16:43 ---------- Previous post was at 16:42 ----------

Hi, Please check this webpage if you have time, if shows a bit the concept of what I am talking about and I asked a similar question to the author of that webpage.
**broken link removed**
 

But my question is basically should I also connect rhe RTS of the FTDI chip to its CTS?
Which FTDI chip?
I reviewed the digi connect me manual and couldn't find a clear statement about RS485 transmission enable. A FT232 datasheet in constrast is telling you explicitely how to connect a RS485 interface.
Now the RTS I believe can be asserted to high as long as the buffer is full and the chip is transmitting. so I can use the RTS as mymax485 tx enable signal.
This wouldn't be the usual meaning of those signals. RTS is telling the peer, that you are ready to receive something. CTS senses, if you are allowed to send. None of these signals tells that you are sending data.
 

Ok now Im confused,
I thought RTS is ready to send which means that the connectme is telling to other devices that it wants to send something and then puts rts to high.

I took this idea from this website.
**broken link removed**
 

In the said article, you'll find this statement:
The only difference is that you have to set appropriate state of RTS line before sending/receiving any data. Because RTS line is very often used in half-duplex converters to switch TX/RX mode, many programs can be used without any modifications.
Then the author describes, how RTS can be controlled through the Windows API.

In other words, he suggests to set it by the application software. This is in fact a longwinded and slow method. You should also consider, that you don't have exact control, when the data is actually sendout by the Windows OS. If you wait until you expect the data has been sent, it may be too late, because you have blocked the answer to your telegram. In my opinion, it's a poor-mans TX enable control, that shouldn't seriously considered. And it can't work through an ethernet tunnel.

Only the processor of the ethernet module respectively it's UART "knows" excatly when to set TX enable. Many processors have a hardware option to send this signal, otherwise it's usually generated from the TX interrupt handler, possibly using an auxilary timer.

If no suitable TX enable is available, you would generate it in hardware, as already mentioned. You can simply use a monoflop or a RC filter to extend the active low TxD signal by a certain amount of time, e.g. one bit time up to a frame duration. You'll see, that this method can't give an exact enable timing, it's either dropping during "1" bits or lasting too long, bringing up the risk of collisions. But's it's the best available method anyway.

P.S.: My personal preference is to extend TxD only by a small amount of time, just sufficient to charge the bus lines to the correct level with a "1" bit, and then leave it to the RS485 pull-up and pull-down resistor to keep the idle level until the next active "0" bit comes.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top