All the RS485 half duplex stuff I've done has always used the TXIF to determine when to put another byte into the transmit buffer. I use the TXSTA.TRM bit to determine when the shift register is empty so that I can disable the RX485 driver. I don't bother looking at this flag until I know I've put the last byte into the TXREG. Then when TXIF is true (TXREG is now empty) I test TXSTA.TRM. John Dammeyer Automation Artisans Inc. http://www.autoartisans.com Ph. 1 250 544 4950 > -----Original Message----- > From: piclist-bounces@mit.edu > [mailto:piclist-bounces@mit.edu] On Behalf Of Dario Greggio > Sent: Thursday, June 14, 2007 1:45 PM > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] 2 Wire RS-485 question > > > Robert Ammerman wrote: > > > In the transmitter: > > > > (1) Send an additional byte at the end of each 'packet' (in > response to > > TXIF) > > (2) One BIT (not byte!) time later disable the transmitter > > (and related to other answers - just my opinion). > I'd avoid sending another "byte", i.e. another start bit etc. I > preferred just keeping the Bus "high" for some bit-time. > > I also find sooo "oldish" :) a method, to use an external 555 > or other > switch to recover from TX mode into RX mode... > Having a MCU should allow for easier handling. > > -- > Ciao, Dario > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist