On Aug 20, 2004, at 7:34 AM, Lawrence Lile wrote: > So here is the architecture question: To interrupt or poll? Put the > RX line and interrupt on PortB,0, and use the "external interrupt"? > Move it all back to a hardware UART, and use that as an interrupt > source? Or poll it all the time with kbhit() ? How do other people > approach this? > If you can't have actually interrupt-driven IO (which is ideal, but can be a bit tricky to implement on a bit-banged serial port), what you probably want is a getc_wait(timeout) function: getc_wait(int timeout) { int then = currenttime()+ timeout; while (currenttimer < then) { if (kbhit()) { return getc(); } } } this is what parallax's basic-stamp "serin" does, isn't it? BillW -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics