You need to use interrupts and have a latency under 1/2 bit time. You will need interrupt on change for both kinds of edges on both clock and data lines. A little bit of external hardware on a parallel port might help a lot. I mean a latch clocked by you (2/2 HCT74) to sample the 'old' state of the SDA and SCL lines and 2 XOR gates to compare its input and output, followed by a (N)OR combination to feed the interrupt line (ACK) on a parallel port. That would be max. 3 chips and 2 hours of work. It would generate some extra interrupts but you can live with that. There is a PAL implementation somewhere for a simple I2C slave. For SPI it is a little harder, so I have always relied on a shift register (4094) to recover the data and a counter (div. 8) to give interrupts every 8th clock. I also used a flipflop to detect pulse type strobes (microwire ?). This was interfaced on a parallel port and programmed in C. For Tx I usd direct bit banging through a half of a HCT244 which was driven tristate for slave operation. You may have to hijack the clock interrupt in the PC BIOS because some of these take ages to run every X calls. This means that you will need to reset the clock from CMOS at the end of your code and periodically while running it because the system clock will not work (and nothing that relies on it, like ETA displays etc). good luck, Peter -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu