On 7 Jul 97 at 22:07, Daniel Najemy wrote: > Easy Question (for you pro's): I want to read a non-interrupt driven > port on a PIC16C74 and detect a rising or falling edge. ... > How could I implement this in C? Hi Daniel, here's are two functions (taken from an example program delivered with the CCS C compiler): void wait_for_low_to_high() { while(input(PIN_B1)) ; /* if it's high, wait for a low */ delay_us(3); /* account for fall time */ while(!input(PIN_B1)); /* wait for signal to go high */ } void wait_for_low() { delay_us(3); /* account for rise time */ while(input(PIN_B1)); /* wait for signal to go low */ } Regards, Wolfgang -----