Tony Kubek wrote: > Now, the other day, I had an idea , is it possible to actually send an > dummy byte after the last byte ( 0x00 or 0xFF ) and use that as an > 'timer' for the rts control ?. I.e. when you are sending the last byte > you set an flag, at the next tx irq you know that the byte is > transfered to the tx shift register and are beeing sent out, now send > the dummy byte and wait until next tx irq at which time we disable the > 'rts' signal. > And I'm curious what will happen with the 'dummy' byte, is it possible > that is will start beeing shifted out before we can disable the > transmitter ? Almost certainly, a portion the start bit for the dummy byte will be transmitted before you can disable the transmit driver, which means that the rest of the receivers on the bus may interpret the now-floating bus as an input byte, especially if another node starts transmitting within one byte time. Seems risky to me. On an 8051 system with RS-485 that I built, I had a set of software timers that were driven by an interrupt from the same hardware timer that generated the UART bit rate. When I put the last byte into the UART transmit buffer, I just started a software timer for 20 bit times, and when that timer expired, I turned off the transmitter. 20 bit times allows enough time for the last byte to go out, plus one full byte time of enforced idle time between packets. -- Dave Tweed -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu