[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling RS-485 and other serial ports




At 1:26 PM +0100 2/12/02, Gerhard Großberger wrote:
>Hi all,
>
>i know that questions about the serial ports have a long history in this
>group, but...
>
>In my application i need all the four serial ports enabled for my program to
>handle four serial bidirectional data streams. When looking to all the past
>entries in this newsgroup i tried out more or less all the stuff given here.
>
>But, however, it is very hard to face out what one must do to get all the
>four ttySx ports under his control.
>
>I have verified the ..\devboadr_lx\kernelconfig.latest file, it looks now
>the folliwing:
>
>...
># CONFIG_ETRAX_DEBUG_PORT0 is not set
># CONFIG_ETRAX_DEBUG_PORT1 is not set
># CONFIG_ETRAX_DEBUG_PORT2=y
># CONFIG_ETRAX_DEBUG_PORT3 is not set
># CONFIG_ETRAX_DEBUG_PORT_NULL is not set
># CONFIG_ETRAX_RESCUE_SER0 is not set
># CONFIG_ETRAX_RESCUE_SER1 is not set
># CONFIG_ETRAX_RESCUE_SER2=y
># CONFIG_ETRAX_RESCUE_SER3 is not set
>...
>#
>#   Port 0 is always enabled
>#
># CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
>CONFIG_ETRAX_SERIAL_PORT1=y
>CONFIG_ETRAX_SERIAL_PORT2=y
>CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PA=y
>CONFIG_ETRAX_SERIAL_PORT3=y
>CONFIG_ETRAX_RS485=y
>
>With this settings i get compiler errors that a "structure has no member
>rs485". I hacked the code and found that the part in serial.h is
>conditionally compiled, so i added a line into kernelconfig:
>
>CONFIG_RS485=y
>

When I did this the last time, i did not have to change any kernel 
configuration for RS-485. /dev/ttyS3 automatically does RS-485 4-wire 
mode. If you want to do RS-485 2-wire mode, you have to toggle the 
RTS pin between serial_write and serial_read.  To enable all the 
other ports, you have to enable them in the configuration as you did 
below. One of them is used for console mesages, so you may have to 
turn off that.

Ujwal
--