RS-232 to RS-485 advice required please.
Stuarttttt
Posts: 45
Hi,
I'm trying to send / recieve data from PC (StampPlot) to BS2 using two RS-232 to RS-485 (transparent) converters
but not having much success.
I'm using RS-232 pins 2, 3, 4, and 5 at the moment, to a 485 converter then a Cat5 cable.
A sample of code I'm using is :
SEROUT 16,84,[noparse][[/noparse]"!READ (DEPTHSP)",CR] 'Read Auto control depth setpoint slider
SERIN 16,84,1000,Main1,[noparse][[/noparse]DEC DEPTHSP]
The programme·works perfectly with a long RS-232 cable but I need a longer transmission cable.
The 485 converters guide is a bit vague, do I·need to change / add anything to enable it to work with the 485 converters ?
·ie. RS-232··· RTS pin 7 ?
Any help will be appreciated.
Stuart
·
I'm trying to send / recieve data from PC (StampPlot) to BS2 using two RS-232 to RS-485 (transparent) converters
but not having much success.
I'm using RS-232 pins 2, 3, 4, and 5 at the moment, to a 485 converter then a Cat5 cable.
A sample of code I'm using is :
SEROUT 16,84,[noparse][[/noparse]"!READ (DEPTHSP)",CR] 'Read Auto control depth setpoint slider
SERIN 16,84,1000,Main1,[noparse][[/noparse]DEC DEPTHSP]
The programme·works perfectly with a long RS-232 cable but I need a longer transmission cable.
The 485 converters guide is a bit vague, do I·need to change / add anything to enable it to work with the 485 converters ?
·ie. RS-232··· RTS pin 7 ?
Any help will be appreciated.
Stuart
·
Comments
Stuart
You didn't mention having a null modem adapter. What happens when you say, "not having much success"?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I have just uploaded a small test code to the BS2 using the standard RS-232 cable. When I run the code, then insert the two 485 adapters I am actually getting data back from the BS2.
Also using StampPlot I do appear to get data back from the BS2 but can't send to it.
I can not load code to the BS2 via 485. Using "debug identify" there is no stamp, loopback or echo.
Stuart
I don't know though why you are not receiving data from the PC. Can you try it with a terminal program (e.g. Hyperterminal)? Could it be a timing issue?
Could you use RS232 at a much lower baud rate to get the distance that you need?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Is the '485 side of your connection wire two wires or 4 wires? If two, you will have to have the Tx+ and Rx+ (and Tx-/Rx-) tied together on both converters to give the proper half-duplex setup. To state the obvious, if using a 4 wire, full duplex connection the Tx's on one converter go to the Rx's of the other.
As Tracy pointed out, in half duplex or "auto switchover" mode, there can be a bit of a delay from one mode or the other but it usually shows up as missed characters, not total failure.
Are these '485 converter called "self-powered"? Those type steal power from the serial port on either end in order to run. The PC can certainly do that, but the Stamp's port implementation may not present enough parasitic power to properly operate the converters.
To get things working in the simplest form, you should only need pins 2, 3, 5. Set the converters for non-auto switchover, 4-wire, ignore RTS/CTS. Thats closest to a straight wire connection.
It will be worth it to sort out '485! Gives lots of flexibility for future projects.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
The 485 adapters "were" half duplex, self powered. After applying a mere +9v to the supply pins (as stated on the terminal) they don't appear to work at all now. Using an oscillosope on D +/A and D -/B there was a data stream present on both a couple of days ago, but not any more ?
I can only imagine they were not very good quality/faulty.
However, undeterred, I will return to this thread when I have purchased and tried a new pair.
Thanks for your time and comments.
Regards
Stuart
The chip I often use is the LT1785, but there are many choices out there.
I should add that the Stamp end would use standard pins, p0 to p15, not the debug port, p16.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com