Tony Kubek wrote: > Dave Tweed wrote: > > 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. > > Well that's about how my current designs operates, but it requires > an available timer. On an pic I use an dedicated timer for this, > well is dedicated during transmission. Which is started when the last > byte is sent to the internal uart. When it set it's irq I disable the > rts. But I just feel that there should be an easier way. Like I said, on the 8051 one HW timer is dedicated to generating the UART clock anyway, so you can enable its interrupt to get "free" timer interrupts at the same rate (actually 16x the baud rate). Since I already had a system of software timers running from this interrupt, creating one more for the transmit turn-off was trivial. -- Dave Tweed -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu