[Doing a software UART for 31.25KBaud] > The timing was very critical, even at 8 Mhz, and there was just barely > enough time even with 64 cycles! I couldn't emagine trying to squeeze it > down any further for this type of setup. You could maybe just poll a pin > like mad and reset a timer as soon as the start bit comes in. > Hope this helps. One technique I've used for a SWUART elsewhere, which should also work fairly well on a PIC, is to arrange some bytes of memory as a pseudo-shift-register and then shift incoming data through them once every (baud/3) clock cycles. To avoid having to pack/unpack the data (which would be rather a pain in the tusch) the data goes through the following sequence: input->p3->p2->p1->p0->c7->b7->a7->c6->b6->a6->c5->b5->a5-> ... ...p7->p6->p5->p4 --__xx0xx1xx2xx3xx4xx5xx6xx7xx-x ppppabcabcabcabcabcabcabcabcpppp 45670001112223334445556667770123 If (p & 11110100b == 00110100b) then grab data from "c" fill a, b, c with $FF; IOR p with $F7. Endif Code should probably look something like this: bcf xP,4 btfsc INPUT ; Use btfss if input is inverted bsf xP,4 rrf xP,w rrf xA,w xorwf xB xorwf xB,w xorwf xB ; xB==xA; W==xB xorwf xC xorwf xC,w xorwf xC ; xB==xA; xC==xB; W==xC movwf xA rrf xP movf xP,w andlw '11110100'b xorlw '00110100'b btfss Z goto Done movf xC,w movwf Wherever bsf GotByte movlw 255 movwf xA movwf xB movwf xC movlw 254 iorwf xP Done: Looks to me like about 26 cycles worst-case; should be enough time there to incorporate a transmit routine as well.