On Sun, 3 Feb 2008, Javid Butler wrote: > Date: Sun, 3 Feb 2008 08:27:42 -0600 > From: Javid Butler <[EMAIL PROTECTED]> > Reply-To: "Enhanced Machine Controller (EMC)" > <emc-users@lists.sourceforge.net> > To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net> > Subject: Re: [Emc-users] Modbus RS-485 Transceiver > > Kirk- > > With half duplex EIA-485 timing is very important. Unlike Ethernet, EIA-485 > does not support collision detection at the physical layer so collisions > between outgoing data and returning data cause data corruption, since the > trancievers do not back off and retransmit. After a query the controller has > to release the line and allow the responder to talk. > > You will probably have to watch flow control. For what you want to do the > controller should transmit a query and then immediately tri-state, but > converting from EIA-232 it may hold the line high or low, perhaps > anticipating the next transmission. You might have to work with the way > messages are buffered-perhaps you will only be able to buffer one message at > a time. > > Javid
Even without buffering you still need to wait until the character has been shifted out of the UARTs transmit shift register before line-turnaround. You can do this by polling TBE and TSRE but you would have to poll fast enough to meet the minimum response time of the Modbus peripheral. A better way is to use a more advanced serial chip (Exar,OxfordSemi,NetMos) that includes RS-485 support. There are also some RS-232/RS-485 adapters that use a one-shot to enable the RS-485 Xmit enable, a little Mickey-Mouse but maybe ok at low baud rates. As someone else posted, full duplex links avoid the timing problem altogether. > > > ----- Original Message ----- > From: "Kirk Wallace" <[EMAIL PROTECTED]> > To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net>; > <[EMAIL PROTECTED]> > Sent: Sunday, February 03, 2008 4:13 AM > Subject: Re: [Emc-users] Modbus RS-485 Transceiver > > >> On Sun, 2008-02-03 at 18:12 +1100, Peter Homann wrote: >>> Hi Kirk, >>> >>> A couple of things. >>> >>> The ModIO I sent you has a RS232-485 converter built in. With this you >>> can run >>> a serial cable from the ModIO to the PC, then run additional Modbus >>> devices >>> from the RS485 terminals on the ModIO. It saves from needing an external >>> converter. >>> >>> When using RS485 I recommend using full duplex rather than 1/2 duplex. >>> Some >>> times there are issues with buffers in the PC and timing for switching >>> the >>> transmission direction >>> >>> Cheers, >>> >>> Peter. >> >> I'm looking forward to getting my hands on it. >> >> Since I don't know what I am doing yet, I was thinking that I could try >> to address the timing issues. Is it that the serial port uses internal >> buffers, so you don't know exactly when data will be sent and due to the >> query and response nature of Modbus, the timing is important? I seem to >> recall that some parallel ports had the same problem, but the driver was >> broken, which disabled the buffer, so ports with fifo's were okay to use >> with EMC. I wonder if the buffers on the serial port could be disabled >> too. It would be nice to be able to use Modbus in its common forms. But >> since you have covered this territory, you could probably talk some >> sense into me. >> >> -- >> Kirk Wallace (California, USA >> http://www.wallacecompany.com/machine_shop/ >> Hardinge HNC lathe, >> Bridgeport mill conversion, doing XY now, >> Zubal lathe conversion pending) >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Emc-users mailing list >> Emc-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/emc-users >> > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users > Peter Wallace Mesa Electronics (\__/) (='.'=) This is Bunny. Copy and paste bunny into your (")_(") signature to help him gain world domination. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users