Patent ID: 7428459

Claim:
An apparatus for controlling an engine having a crankshaft and a camshaft, the apparatus comprising: an interval measuring unit configured to receive an input signal input thereto, the input signal having a level that repetitively changes in time in a predetermined direction, the interval measuring unit being configured to measure a time interval from when a predetermined-directed level change appears in the input signal to when a temporally next predetermined-directed level change appears therein; an input unit configured to input a crank signal as the input signal to the interval measuring unit, the crank signal having a level that repetitively changes in a predetermined direction each time the crankshaft rotates by a first angle; a multiplication clock generating unit configured to generate a first multiplication clock including a train of clock pulses whose clock cycle is determined by dividing, by a first multiplication number, the interval measured by the interval measuring unit; a count unit configured to count in synchronization with the first multiplication clock generated by the multiplication clock generating unit, a count value of the count unit corresponding to a rotational position of the crankshaft in one cycle of the engine when the rotational position thereof is represented with a predetermined resolution, the predetermined resolution being obtained by dividing the first angle by the first multiplication number; an event generating unit configured to generate at least one event associated with control of the engine according to a crankshaft's rotational position identified by a count value of the count unit; and an abnormality determining unit configured to determine whether the crank signal is abnormal based on a state of the input signal, the input unit working to switch the input signal for the interval measuring unit from the crank signal to a cam signal when it is determined that the crank signal is abnormal, the cam signal having a level that repetitively changes in time each time the camshaft rotates at least by a second angle different from the first angle, the multiplication clock generating unit working to generate a second multiplication clock to be used in place of the first multiplication clock after it is determined that the crank signal is abnormal, the second multiplication clock including a train of clock pulses whose clock cycle being set to be substantially equivalent to the clock cycle of the first multiplication clock.