We are using a technique which is often called "polling". The program repeatedly checks the state of an input and responds when a change is detected. However, it takes a small amount of time for the program to pick up the fact that the input has changed, and you can "catch the program out" in the CPIC by changing the state of the input very quickly. This shows a defect in this way of working. If we get very small pulses these are not noticed by the program which is polling for input.

If you select the RC clock and set the speed of the PICmicro development board to slow you will notice a delay between the button being pressed and the light changing.

Later in the course we will see how you can use interrupts to detect very short signal pulses. The fact that you can operate the PICmicro at a clock speed of several million instructions a second means that this is not necessarily a problem.