Patent ID: 9134752
Filing Date: 2015-09-15
Classification: G06F

Abstract:
1. A time measurement device comprising: a first measurement unit configured to measure a clock period of a first reference clock signal within a specific cycle of a second reference clock signal, said second reference clock signal having an oscillation frequency lower than that of the first reference clock signal and oscillation accuracy higher than that of the first reference clock signal; a calculation unit configured to calculate a physical amount indicating a variance amount of a clock period measured with the first measurement unit relative to a reference clock period measured in advance as the clock period of the first reference clock signal within the specific cycle of the second reference clock signal; a compensation unit configured to compensate an expected measurement value indicating the clock period of the first reference clock signal corresponding to a time as a measurement target according to the physical amount calculated with the calculation unit; and an output unit configured to output time information indicating that the clock period of the first reference clock signal reaches an expected measurement value thus compensated after a clock period of the first reference clock signal measured with the first measurement unit reaches the expected measurement value thus compensated; and a first interruption unit configured to output a first interruption signal per cycle of the second reference clock signal; a second interruption unit configured to output a second interruption signal after the clock period of the first reference clock signal measured with the first measurement unit reaches the expected measurement value thus compensated; a second measurement unit configured to measure an overflow number count of an overflow that occurred when the first measurement unit measures the clock period of the first reference clock signal within the specific cycle of the second reference clock signal; and a third interruption unit configured to output a third interruption signal when the overflow occurs, wherein said calculation unit is configured to determine whether the first interruption signal is output for the first time after the first interruption unit outputs the first interruption signal, said calculation unit is configured to initialize a measurement value of the first measurement unit so that the calculation unit sets flag information indicating that a first interruption occurs after the first interruption signal is output for the first time, and said calculation unit is configured to retrieve a clock period of the first reference clock signal measured before as the clock period of the first reference clock signal within the specific cycle of the second reference clock signal so that the calculation unit initializes the flag information after the first interruption signal is not output for the first time, said calculation unit is configured to control the first measurement unit to start measuring the clock period of the first reference clock signal after the first interruption unit outputs the first interruption signal, and to wait for a next first interruption signal, said calculation unit is configured to retrieve the clock period of the first reference clock signal measured before as the clock period of the first reference clock signal within the specific cycle of the second reference clock signal after the first interruption unit outputs the next first interruption signal so that the calculation unit calculates a ratio between the clock period of the first reference clock signal measured before and the reference clock period as the physical amount, said compensation unit is configured to compensate the expected measurement value according to the ratio, said output unit is configured to control the first measurement unit to start measuring the clock period of the first reference clock signal measured with the first measurement unit after the compensation unit compensates the expected measurement value, and to wait until the second interruption unit outputs the second interruption signal, said output unit is configured to output the time information after the second interruption unit outputs the second interruption signal, said calculation unit is configured to calculate a product of the overflow number count of the overflow measured with the second measurement unit and a clock period that causes the overflow, said calculation unit is configured to calculate a sum of the product of the overflow number count of the overflow and a clock period of the first reference clock signal measured with the first measurement unit without the overflow, said calculation unit is configured to retrieve the sum as the clock period of the first reference clock signal within the specific cycle of the second reference clock signal, said second measurement unit is configured to measure the overflow number count of the overflow when the third interruption unit outputs the third interruption signal, said calculation unit is configured to initialize the measurement value of the first measurement unit and a measurement value of the second measurement unit so that the calculation unit sets the flag information indicating that the first interruption occurs when the calculation unit determines that the first interruption signal is output for the first time, said calculation unit is configured to retrieve the clock period of the first reference clock signal measured before and the overflow number count measured with the second measurement unit when the first interruption signal is not output for the first time, and said calculation unit is configured to calculate the product and the sum so that the calculation unit initializes the flag information.