A/D emulation is accomplished using the on-chip peripheral analog comparator and the 8-bit modulo timer (MTIM). The PTA0 pin is first set as output zero to discharge the capacitor. The analog comparator is then configured and the MTIM begins counting. The MTIM essentially measures the time it takes for the RC voltage to match the input voltage. The timer count is used against a look-up table to determine the 8-bit ADC value. Even though the memory size is limited, the table is used to resolve the charge/discharge of a capacitor.