Patent ID: 8723586

Claim:
An apparatus comprising: a digital logic circuit coupled to an output of a comparator and to an input of a controllable current source, the digital logic circuit configured for controlling an amount of current supplied or drawn by the controllable current source, wherein the digital logic circuit comprises: a digital filter coupled to the output of the comparator, the digital filter configured for producing a filtered version of information provided at the output of the comparator; a delay circuit coupled to an output of the digital filter and configured for providing a delayed version of the filtered information produced by the digital filter; an exclusive-or (XOR) circuit coupled to the output of the digital filter and to an output of the delay circuit, the XOR circuit configured for providing an update signal; a control setting circuit coupled to the output of the digital filter and to an output of the XOR circuit for receiving the update signal, the control setting circuit further coupled to an input of the controllable current source and configured for controlling an active current configuration of the controllable current source; and a digital accumulator coupled to an output of the control setting circuit for measuring an amount of current supplied or drawn by the controllable current source, the digital accumulator configured for providing a result signal that is proportional to an amount of charge associated with an external source that is coupled to a first input of the comparator, wherein the apparatus is configured for measuring the amount of charge associated with the external source.