I agree that you cannot use the uart interrupt, since it only interrupts when there is room in the transmit buffer. There is still possibly data being shifted out. I think the only option is to use a timer interrupt instead of the uart interrupt. You can then check to see if the transmit shift register is empty. Note that the uart in the 24H series lets you generate an interrupt when there is room in the transmit buffer, when the last character has been shifted out, or when a character has been moved from the transmit fifo into the shift register (there's room for another character in the fifo). Harold > I'm running a network of instruments using a 4 wire RS-485 scheme, > where there is a single master and multiple slaves. All the slave > receivers connect to the master transmitter, and all the slave > transmitters connect to the master receiver. I have logic that > automatically switches all the slaves into receive mode whenever the > master drives it's transmit signal active. > > All the slaves contain PICs (18fxxxx) and use the UART to implement the > RS-485. > > I Now want to make a different version that operates as a party line, > with all transmitters and receivers connected together. To do so, each > node has to know how to turn off its transmitter as soon as it has > finished a transmission. > > What's the cleanest way, in a PIC, to do this? I think I can't use the > UART Transmit interrupt, because it does not tell you when the last > byte has gone out on the wire. I know I could use a timer but consider > that my solution of last resort. I'm looking for any other ideas that > would let me turn off the transmitter at the earliest possible moment, > as soon as the last transmitted byte is on the wire. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist