Hiya Mike, I did optimise your code a couple of years ago and posted it on the PICLIST back then. I also did 19200 and 38400 versions and posted those (but with errors that Andy Warren spotted ). I credited both you and Andy for the original idea and the discussion that led to my optimisation. I found that I got errors on the receive side with some comm programs. It appears that they don't like that the stop bit tends to be a little bit long between individual characters (caused by the amount of time it takes to get the next character to be transmitted. Increasing to 2 or more stop bits eliminated the error in every instance that it was encountered. This was a VERY good idea that you came up with, Mike. This and another idea that you came up with about the same time (using the carry bit to determine that a full 8 bits has been shifted into a register) have been used in many projects over the past few years. Here is the post that I sent to the Piclist back then... The following is a series of tiny routines for sending asynchronous serial data. It is based upon ideas from both Mike Harrison and Andy Warren and uses only 15 code spaces and 1 register. The speed isn't exact, but is only 0.16% fast. The output polarity is true and can directly feed a RS232 driver (MAX232). For inverted data (to directly feed an RS232 input), swap the bsf and bcf instructions. There are 3 different versions for 9600, 19200, and 38,400 baud. All routines assume 4 MHz clock. The following routines set the data format at 8N1. Increase the .10 by up to .15 if you need more stop bits (this will affect the cycle times mentioned). Note that W is used as the delay counter. ;TXBYTE: send 1 byte @ 9600 baud: 1 RAM, 15 (16) ROM, 1043 cycles ;enters with data in w, exits with w trashed. ;Copyright (C) 1995 Dwayne Reid. May be freely used so long as this ;copyright notice is retained. txbyte ; send byte in W at 9600 baud (4MHz osc), 8N1 movwf temp movlw .10 ; 8 data + 1 start + 1 stop (inc for more stop bits) clrc ; start bit txloop ; bit time = 104.167 uSec skpnc bsf serport,dout ; output bit = carry skpc bcf serport,dout dloop ; 95 clk cycle delay goto $+1 ; 2-cycle NOP in 1 instruction! addlw b'00010000' ; increment upper nibble skpc ; delay = 6n -1 (1 less when falls thru) goto dloop ; loop sixteen times addlw -1 ; dec w, valid z, c=1 if w>=0 after decrement rrf temp,F ; carry will be set - shifted in as stop bit skpz goto txloop ; txloop is 104 clk cycles return (other versions deleted for brevity - ask and yee shall receive). Dwayne Reid Trinity Electronics Systems Ltd Edmonton, Alberta, CANADA (403) 489-3199 voice (403) 487-6397 fax