Hi, I'm using the Microchip C18 compiler, and a PIC18F452 to relay RS232 serial data from a host computer to a serially controlled CCTV camera. I'm using the hardware USART on RC6/RC7 to communicate with the PC, and this works fine. Now I'm trying to use the C18 'Software UART' library functions to implement a software UART on RD6/RD7. Trouble is, the C18 manual says you (the user) has to define the following delays: DelayRXHalfBitUART as ((((2*FOSC/(4*baud))+1) / 2)- 12 cycles DelayRXBitUART ((((2*FOSC/(8*baud))+1) / 2)- 9 cycles DelayTXBitUART ((((2*FOSC/(4*baud))+1) / 2)- 14 cycles I guess these routines would need to be written in assembler to be accurate (?) and my assembler is pretty poor, so I'm looking for any kind soul who have already done this, and can send me some pointers or sample code. (My system clocks at 4 Mhz with 4x PLL enabled = 16 Mhz, and the comms is running at 4800 baud) Thanks, Peter Moreton -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body