To provide an electronic unit which can prevent brake control from stopping a generator. An electronically controlled mechanical timepiece, which is an electronic unit, includes a generator 2 driven by a coil spring 1 to generate electric power, and a rotation control unit 50 driven by electric energy of the generator to control the rotation period of the generator 2. The rotation control unit 50 is provided with a brake control unit 55 for comparing a reference signal fs with a rotation-detection signal FG1 corresponding to the rotation period of the generator 2 to apply brake control to the generator 2, and a generator-stop preventing unit 56 for setting the amount of brake to be applied to the generator 2 to a first brake setting value to prevent the generator 2 from being stopped, when the rotation period of the generator 2 is equal to or longer than a first setting period which is longer than a reference period. When the rotation period of the generator 2 becomes long, the generator 2 is controlled by the first brake setting value. The first brake setting value is a small amount of braking, such as zero, and can prevent the generator 2 from being stopped.