2.4 Analog Modules
Apart from a large number of digital I/O lines, the PIC16F887 contains 14 analog inputs. They enable the microcontroller to recognize, not only whether a pin is driven to logic zero or one (0 or +5V), but to precisely measure its voltage and convert it into a numerical value, i.e. digital format. The whole procedure takes place in the A/D converter module which has the following features:
• The converter generates a 10‐ bit binary result using the method of successive approximation and stores the conversion results into theADC registers (ADRESL and ADRESH);
• There are 14 separate analog inputs;
• The A/D converter allows the conversion of an analog input signal to a 10‐ bit binary representation of that signal; and
• By selecting voltage references Vref‐ and Vref+, the minimal resolution or quality of conversion may be adjusted to various needs.2.5 CCP ModulesThe abbreviation CCP stands for Capture/Compare/PWM. The CCP module is a peripheral which allows the user to time and control different events. Capture Mode, allows timing for the duration of an event. This circuit gives insight into the current state of a register which constantly changes its value. Estimate Mode compares values contained in two registers at some point. This circuit also allows the