On Friday 26 Sep 2003 12:17 am, you wrote: > I am having a little trouble with a bit-bashed RECEIVE uart routine for > PIC18F252. (Code is written in Hi-Tech C). Baud rate is 19200, Crystal is > 16 MHz. (The hardware UART is already dedicated and I need a second port) > > The start bit is being detected by INT0 and then a getch() routine is being > called to sample the incoming bits. > > It seems the Hi-Tech compiler saves all registers to be used in any code > called from the interrupt and it appears that at present 100 cycles latency > is occurring. > > Do I need to move the getch() routine into the interrupt handler ? or a > better way of doing this ? > Bit bashing is such a hardware intimate function that IMHO you really should be using assembler for it. Ian -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.