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.

Prolific pl2303 to RS485

Status
Not open for further replies.

uC_Learner

Newbie level 3
Joined
Jun 28, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,323
Hi edaboarders,

I have Prolific PL2303, USB to RS232 converter, which is working fine. Now, I have to communicate to Conzerve EM6400 meter, which has 2 wire, RS485 interface. I have tried standard SN75176 based circuit connected after pl2303, but my Modbus tester software always gives 'illegal response'. Have tried different baud rates, parities, etc., but its not helping. EM6400 register map is with me and I am addressing valid registers. Also tried with and without 120R terminator resistors. One more thing, I ve tried interface circuits (after pl2303) having MAX232 + 75176 and without MAX232 (just one IC SN75176). Actually, I tried these 2 circuits directly on PC RS232 port, without prolific pl2303, but it refused to work. Just want to know, where is the problem or is there any combination left to check ? One thing that catches my mind is that EM6400 does not have a ground terminal and sometimes common ground is used in RS485, which is not there in EM6400. Is this the problem ? Any help here would be highly appreciated. Thanks in advance.
 

Attachments

  • RS485_to_RS232_Converter_Schematic.pdf
    38.5 KB · Views: 313

Just a suggestion, maybe unuseful: try to invert A and B on the 485. There is a lot of confusion about the meaning of these wires (see this Wikipedia article for more details)
 

My preferred solution is an automatic TX-Enable as shown in this thread:
https://www.edaboard.com/threads/115805/

With your circuit, the first question is, if RTS is controlled as TX-Enable at all, the second, if it's low active. I would rather expect the opposite polarity. A ground connection isn't generally needed, but pull-up and pull-down resistors to set the line idle state are often required, otherwise false start bits or break state may be detected.

FTDI converters have a pin for automatic RS485 control, but it's not exposed as a RS232 control signal. PL2303 has no hardware RS485 TX-Enable according to the datasheet, but maybe, the function is provided by a driver. Standard PC RS232 drivers however don't, and they would have difficulties to keep up with TX-Enable for fast communication.
 

Thanks for your valued replies. I have already tried changing the polarity of A & B. One combination results in receiving some data, which is claimed as 'illegal response' by Modbus Tester software from Modbus in embedded systems and in other polarity I receive the same transmitted data, but again with 'illegal response' message. RTS enable/disable is controlled by the tester software, with default timings and they cannot be changed.

With another tester from Modbus, Modbus Software, Modbus RTU, Modbus ASCII, there is "'Timeout" message.

Also, tried pull-up & pull-down resistors but it did not work, as well.

I have already ordered a USB to RS485, converter, hopefully it would reach me in 3-4 days time. But why my approach is not working, just curious about that.

Thanks again, guys, for your help. I will reply if I find solution. By the way, I saw a post here where someone has used similar pl2303 with some add-on circuit for RS485, but I missed it and now its not coming in search. Does anyone remember such post ?

Thanks & Regards.
 

From the MODBUSTools Manual:
RTS Toggle:
Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low.

You can use this to switch direction if you have a 232/485 converter without automatic direction switch.

Warning:
The use of RTS controlled RS232/RS485 converters should be avoided if possible. It is difficult to determine the exact time when to switch off the transmitter with non real-time operating systems like Windows and Linux. If it is switched off to early characters might still sit in the FIFO or the transmit register of the UART and these characters will be lost. Hence the slave will not recognize the message. On the other hand if it is switched off too late then the slave's message is corrupted and the master will not recognize the message.

You apparently ignored my comment about RTS polarity, but as I already guessed, RTS is used active high (at the RS232 level) during send, opposite to the requirement of your circuit. The manual also clarifies, that software controlled RTS is something like a poor man's RS485 control, it should be preferred to use hardware control. But most likely, the adapter will work when inverting the RTS polarity.
 

You are right, FvM. I overlooked your point, I thought it was about wire polarity. Thanks for the reminder. I will change 'RTS polarity' and will inform you.

Auto RTS is really a nice idea. I will certainly give it a try.

Regards.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top