Hardware interrupts such as the output compare interrupt allow micro-controllers to schedule process execution in real-time. Another important role of hardware interrupts is that they allow the micro-controller to respond in an asynchronous manner to external events. By "asynchronous", we mean that the occurrence of the external event can occur at any time, either on or between the micro-controller's clock tick. This learning module focuses on the input capture interrupt. Input capture interrupts are hardware interrupts that are tied to a change in the logical state of an input pin. This type of interrupt allows the micro-controller to respond quickly to asynchronous external events.
This learning module examines the use of input capture interrupts to control the response of the MicroStamp11 to asynchronous external events. In particular, you will build a system that transmits a single byte across a serial wireless IR (infra-red) link. An ADC chip (ADC0831) will be used to convert a voltage over a potentiometer into an 8-bit number. This byte will be transmitted over a wireless IR link. The input capture interrupt will be used to detect the beginning of the transmitted byte and an output compare interrupt will be used to time the reading of each information bit in the byte. The transmitted and received byte will be displayed on a 2 line by 16 character LCD display.