On Thu, 12 Jun 2008 15:46:22 +0200, "tinu b" said: > i need to handle multiple serial interfaces on a pic18fxxxx (28pin pic). > > i need at least 2 bidirectional rs232 interfaces, running at 9600bps. > > there is no 28 pin pic with 2 hardware usart interfaces, so i think i > need a > software solution. > > i tried to design a 2 channel full duplex software uart, running with 8x > oversampling, polling the rx lines, detecting startbit and sampling rx > lines > in the middle of the bit of each rx line. > unfortunately, this seems to use the full power of the pic, not leaving > any > performance left to do other things. > is there a good solution for a pic18 multi-uart around? Hi Tinu, I have done one 9600 bps uart using timer0 interrupt in software with a circular buffer at 14MHz on a 16F84A. In "C". So you should be able to do it on an 18F with two software uarts. You can sample at 2x the baud rate. Setting your timer interrupt to some exact multiple of the baud rate is important. So in this case interrupt 19200 times per second. If you have a 40MHz clock you should have plenty of cycles left over even with two software channels. Cheerful regards, Bob -- http://www.fastmail.fm - Access all of your messages and folders wherever you are -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist