Sat May 17 11:57:36 EDT 2014

PIC comparator / capture-compare

In 18F4550[1] data sheet these are relevant:

15.0 Capture/Compare/PWM (CCP)
16.0 Enhanced Capture/Compare/PWM (ECCP)
22.0 Comparator Module

  Two comparators tied to RA0-RA5 or voltage reference.  Outputs
  available at pin level.  Interrupts happen when there is a change in
  ouput value.

23.0 Comparator Voltage Reference Module

  16-tap resistor ladder network derived from V_REF+/V_DD and
  V_REF-/GND (8-16-8 or 8-16 divider). The voltage can be sent out to
  RA2 to be used as a 3-bit DAC.

[1] http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf