Perhaps someone on the forum has encountered the same dificulties as I.
I´m trying to communicate a half duplex RS-485 equipment with the GC864QUADV2
modem thru an RS-485 transceiver. I need to control de direction of data flow, but the CTS and RTS signals only activate on buffer overflow. I would like to know if this could be done by
configuring the modem or if by the contrary I would have to write a routine in
software to handle this, I´m using the IP_Easy to communicate the RS-485 slave with a remote
Maybe you can use a modem GPIO to control the direction, or you can use AT#V24CFG and AT#V24 to manipulate individual serial port pins.
Thanks for the help, I have attached the CTS pin to the RE and TE pins on the
transceiver so I think I will go with your second suggestion. Could you give me any
hints as how to detect when data is going to be transmitted in the serial port in data mode?
I think this is the job of the host application/driver or am I wrong?
You mean like sending the data direction command from the remote host app, then the
data and then once again the data direction command?. If that is the case there is no warranty
that the commands will arrive before the data, at least not for PSD(packet switched data).
Couldn´t I just monitor the modem´s serial port tx buffer for data and raise the data direction flag accordingly? If this is feasible how could it be acomplished in parallel with regular data mode in IP_Easy?
Here are some examples of hardware and software solutions to the problem:
Hardware Solution (RS232 to RS485 Converter):
Pros: Quick to implement
Cons: Fixed Baud rate for schmitt trigger scheme
Cons: If a microcontroller is used a variable baud rate could be achieved but this
Software Solution :
Instead of using IP easy, use a phyton script to interface between the serial port and
the socket and set the CTS signal accordingly.
Pros: No additional hardware
Cons: Fixed baud rate, Responses from the slave could be lost if the delay
in setting data direction is large.
I wonder if it is possible to get acces to the ASC0 UART flags, to monitor
the TX buffer flags and change data direction??
Here´s a link to info on the subject:
I don’t think the low access to the module UART flags is possible so the quickest, feasible, low term but portable solution would be the hardware converter.
Well that is unfortunate, older half duplex modems implemented data direction control thru the RTS/CTS pins. I guess I will have to modify my hardware design.
Thanks for the advice
I think the easy way to do it is to let the device to MASTER the communication, ie use the same line used for RE TE to stop data sending out from module by means of flow control (line connected to RTS of module) so when device need to trnasmit it stop data coming from module.
The thing is that the device connected to the module has an RS-485 serial interface, so there is no RTS signal available. Also I´m using an isolated RS-485 transceiver so that option would imply an extra opto-isolator. I´m attaching an image of my circuit for your review.
I meant not to use the RTS of your device, I understood you don’t have it.
I meant to select a GPIO to be used to select Tx Rx and the same to be used to stop send data aout from module
Pardon me, I missunderstood, I see. Well that is possible indeed but how would I know exactly when to
activate the GPIO? when is there data to be Tx and when has it all been transmited?
and suppose I do know when I´m going to transmit data thru the serial port, would the
program execution be fast enough as to deactivate the transmitter in time to listen to the slave response?
You stated that the same GPIO PIN could be used to stop sending data out from the module, how could this be acomplished?
As Cosmin pointed out the CTS pin can be used as a GPIO thru the V24 command
so control over the pin should be no issue, then I guess I should try to make a program
that receives data thru a socket, activates the Data Direction control PIN, then sends this received data thru the serial port and then changes the Data Direction PIN once again, waits for data thru the serial port and receives it and the sends it thru the socket.
All the functionality already comprised on IP_easy but with the added Data Direction Control.
Thanks for your quick reply and advice
I meant you use a GPIO form your uC drived directly to both EN TxRx of converter and the RTS of the module. So this way when you have to trnasmit you stop module from sending any data to prevent collision and at the same time you enable the Tx direction on the converter. When finished to trnasmit data toggle this line so you chenge direction on converter and at the same time you allow module to transmit data if any. I believe this should be the easy way to do it; of course you must know when YOU have data to be transmitted out form uC.
if you have a FW version newer thaN it could help the command AT#RS485?
When I tried the AT# RS485? command I got an error response, I guess it is not
supported on my firmware version:
My module model is GC864QUADV2
I was thinking of trying this modified script, taken from the SKT_CL_SR.py example:
while MDM.getDCD() == 1:
b = SER.read()
res = MDM.send(b, 10)
s = MDM.read()
rs = SER.send(s)
MOD.sleep(2) # 50
And try it at different serial bus speeds see how it goes.
uyes your FW is a bit old, the command is supported in new FW.
Cant’ you upgrade it?
Yes, in my board I do have access to the ASC1 interface. How do I obtain
the latest FW version? shall I talk to my distributor? (Rutronik).
Hi Haroldo, please check your email.
Hi Cosmin, Luca,
Thanks for the link, will download it and give it a try to the firmw upgrade.
Any hints on the use of AT#RS485? I don´t see any reference to the command
in the current documentation.
After downloading the latest ATcommandsReferenceGuide I checked the AT#RS485
command functionality, but I don´t have the xfp tool to download the new firmware.
The firmware update is performed thru ASC0 or ASC1?
I tried to flash the new firmware using xfp ver2_0_13 with no success. After completing about 70% of the programming I get the error on the attached image. I tied the service pin to Ground
connected my RS232 to USB converter to Txtrace and Rxtrace, hit the program button and a second later turned the module ON after wich the software showed the programming bar advancing.
I sent you a download link for XFP 2.0.19, try that.
After downloading and installing the new Xfp version I tried to program the new
firmware with the same results, I got an error after aprox 70% of the programming.
Later on I REMOVED THE RTC LITHIUM BATTERY on my platform and the firmware
programming completed with succes (attached picture). It is important to REMOVE
the RTC battery when performing a firmware upgrade, I was not aware of that!!
I was searching for the command #RS485 in my ATCommandsReferenceGuide but I think my device doesn’t support it. I’m using the HE910.
I want to communicate using RS485 too, but in the case I’m sending data I won’t know when it stop, so I couldn’t use an GPIO to control the RE/ and TE pins. I mean, if I put HIGH an GPIO (that is controlling the TE and RE/ of the RS485 transceiver -like the max485-), I’ll send data, but if I put LOW the same pin, the transmission will stop and I’ll start to receive data, but I won’t know if I did send all the data (because I did change it too fast), or in the other case (assuming I did send all the data, but I wait too long to change the GPIO’s state) I won’t know if the other devices answer me, so maybe the data that I received from the other devices is uncompleted.
The #RS485 command is perfect for this scenario, because it tells you when the data transmission has finished, so in the moment that the data transmission has finished, I could change the GPIO state to start receiving the outcoming data.
Is there any command that works like the #RS485 command, but that is compatible with the HE910?
If any of you can help me, I’ll appreciate.
I was searching for the command #RS485 in my
ATCommandsReferenceGuide but I think my device doesn’t support it. I’m using
I want to communicate using RS485 too, but in the case
I’m sending data I won’t know when it stop, so I couldn’t use an GPIO to
control the RE/ and TE pins. I mean, if I put HIGH an GPIO (that is controlling
the TE and RE/ of the RS485 transceiver -like the max485-), I’ll send data, but
if I put LOW the same pin, the transmission will stop and I’ll start to receive
data, but I won’t know if I did send all the data (because I did change it too
fast), or in the other case (assuming I did send all the data, but I wait too
long to change the GPIO’s state) I won’t know if the other devices answer me,
so maybe the data that I received from the other devices is uncompleted.
The #RS485 command is perfect for this scenario,
because it tells you when the data transmission has finished, so in the moment
that the data transmission has finished, I could change the GPIO state to start
receiving the outcoming data.
Is there any command that works like the #RS485
command, but that is compatible with the HE910?
Hit enter to search or ESC to close
Knowledge Base & Download Zone