Reply by Steve at fivetrees February 7, 20082008-02-07
"muktabh" <m_anchlia@hotmail.com> wrote in message 
news:cdGdnb0bHvpf9zbanZ2dnUVZ_sGvnZ2d@giganews.com...
> Hi, > I have an advantech PCM-4153 board with 4 com ports. The user guide > says > port 2 can be configured as a RS485 port. I have a few doubts. > I am using linux on this board. Will I need special drivers to use > RS485? > (the board uses sch3112 chip for IO) The user guide says to set a > jumper > to switch from rs232 to rs485. Will I need to change the serial comm > code > too? > Is it OK if i do this: > 1) COM 2 is configured as a serial port right now. > 2) I dont change the code, just set the jumper to RS485. > 3) I run the code, connect COM 2 to a RS485 to RS232 convertor, and > read > in the output in using hyperterminal. > > Will the above work?
I don't know that specific board (have dealt with other PCM cards), but typically RS-485 needs some line discipline. Strictly speaking, RS-485 is half-duplex (3-wire: 2 for comms, 1 for ground); you either tx, or you rx. Not both. Something (often the RTS output) needs to enable/disable the drivers. Again strictly speaking, the 5-wire version (full duplex) is RS-422, but the distinction is getting a bit blurred - people talk about FDX RS-485 links these days (which is mostly ok - RS-485 drivers are way more robust than RS-422 drivers). If your board has a distinct pair of RS-485 outputs and another distinct pair of inputs, you'll be fine. Otherwise, you'll need to enable the drivers while you tx (and for a short while afterwards, long enough for the last character to leave), and disable the drivers when you rx or when you're idle. HTH, Steve http://www.fivetrees.com
Reply by muktabh February 7, 20082008-02-07
Hi,
I have an advantech PCM-4153 board with 4 com ports. The user guide says
port 2 can be configured as a RS485 port. I have a few doubts.
I am using linux on this board. Will I need special drivers to use RS485?
(the board uses sch3112 chip for IO) The user guide says to set a jumper
to switch from rs232 to rs485. Will I need to change the serial comm code
too?
Is it OK if i do this:
1) COM 2 is configured as a serial port right now.
2) I dont change the code, just set the jumper to RS485.
3) I run the code, connect COM 2 to a RS485 to RS232 convertor, and read
in the output in using hyperterminal. 

Will the above work?

Thanks...