摘要 |
PROBLEM TO BE SOLVED: To provide a random number generating device capable of generating random numbers in an arithmetic process of a microcomputer without using an external circuit an output of which changes according to a power supply voltage.SOLUTION: A microcomputer of a charger for charging a battery pack includes a main oscillation circuit and a sub oscillation circuit. The sub oscillation circuit exhibits higher temperature dependence than that of the main oscillation circuit and is used for counting a time by a timer. The microcomputer is operated by a clock from the main oscillation circuit exerting low temperature dependence and generates a random number for authenticating the battery pack. When generating the random number, the microcomputer starts to count a sub clock by the timer (S110), and later measures a time from when the count value of the timer reaches a predetermined value till a timer interruption occurs, by counting a variable i (S120 and S130). The time from starting the timer till occurring the timer interruption changes according to a temperature of the sub oscillation circuit. This configuration can thus generate the random number by measuring the time using the main clock. |