Patent ID: 8151098

Claim:
A periodic signal processing apparatus for receiving a periodic sensor signal and a phase signal outputted from a sensor and for processing the sensor signal, the sensor signal being responsive to a physical quantity detected by the sensor, the phase signal indicating a phase of the sensor signal, the periodic signal processing apparatus comprising: a central processing unit (CPU) configured to execute a plurality of tasks in parallel; and a task switch timer configured to output a task switch signal to the CPU, the task switch signal switching an execution condition of the plurality of tasks executed by the CPU, wherein one of the plurality of tasks is a signal processing task for processing the sensor signal, the task switch timer disables an interrupt to the CPU and outputs to the CPU a signal for causing the CPU to stop executing instructions immediately before finishing counting of a time corresponding to a timer value, the task switch timer outputting to the CPU a switch signal for causing the CPU to execute the signal processing task after finishing counting of the time, when receiving the switch signal from the task switch timer, the CPU interrupts the executing task and then starts to execute the signal processing task, and in the signal processing task, the CPU performs a synchronization processing to synchronize with a sampling processing of the sensor signal by detecting an edge of the phase signal, sets the timer value to the task switch timer, and starts to perform the sampling processing by releasing the disabled condition of the interrupt that is sent to the CPU as an execution request of the other tasks.