Hello,
I'm trying to set-up TxEnable (other gpio for RTS) in rs485 of my custom 
cape with Device Tree from weeks: all works fine, except RTS!
I use 14_04_2014 Debian image and libmodbus 3.1.1 .
can you explain me better what I have to do?
I haven’t find a complete guide for how to set-up  rs485 pin (not uart 
physical line!) in Device tree, only suggestion...
I'm not sure that my kernel (3.8.47) supports RS485 controls pin...

I haven't understand how modify  modbus_rtu_set_serial_mode function. 
Finally: must I set my custom RTS pin in device tree structure (half 
unknown) or in modbus_rtu_set_serial_mode function? or both?

I am sure that it was not clear... but if Yuo or someone can help me... I'm 
very grateful!!!

Thanks in advance!

Francesco.
Il giorno martedì 29 aprile 2014 16:24:49 UTC+2, [email protected] ha 
scritto:
>
>
> Yes you can use the serial ports for RS485. You will need a UART to RS485 
> IC to get the correct voltages. RS485 is a half duplex standard and 
> therefore has to have a directional pin. This pin can be selected to be any 
> of the GPIO pins of the Beaglebone Black. Use the UART cape in the device 
> tree overly to enable the serial port and then pass the RS485 stucture 
> along with the termios information to setup the port. The structure can be 
> found in serial.h. If you are planning to use the Modbus protocol over the 
> RS485 network then you need to make a slight change to the libmodbus source 
> code. In the file modbus-rtu.c there is a function called 
> modbus_rtu_set_serial_mode. In the passing argument for the function 
> include an additional variable int GPIO for the directional pin. In the 
> firs if statement change the code so that it will now pass the structure of 
> the RS485 to the port along with the directional pin. Note that you are 
> using the patched serial.h that comes with the Debian Image for the 
> Beaglebone Black and not the serial.h that comes as standard with Debian. 
> After this setup the normal reading and writing functions of the Modbus 
> library can be used
> On Wednesday, November 2, 2011 9:59:05 PM UTC+2, Iñaki Zuloaga Izaguirre 
> wrote:
>>
>> I have been reading the documentation for the TI microprocessors and I 
>> haven't been able to figure out if the serial ports can be used for 
>> RS485. It seems to me that there is no integrated support for RS485 
>> Transmit enable generation, has anybody tried this? You can always 
>> control the enable with a digital output, but it is very difficult to 
>> accurately disable the Transmit enable after transmission ends. 
>> Microprocessors from other companies like the AT91SAM9260 and LPC1768 
>> directly support handling the RS485 enable.
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to