Abstract:
A data processor including an alternative clock generator for generating, in a power saving mode, an alternative clock signal which is supplied to a peripheral circuit instead of a system clock signal. This enables only the peripheral circuit such as an A/D converter to be put into operation in response to the alternative clock signal in the power saving mode. This solves a problem of a conventional data processor in that it cannot achieve the power saving efficiently because it is unavoidable for the remaining portion of the conventional data processor like a CPU to be involved in a high-rate operation along with the peripheral circuit even if it is desired to operate only the peripheral circuit at a high-rate when releasing the sleep mode or changing the sleep mode to a high-rate mode.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a data processor such as a microcomputer having a peripheral circuit, and a system clock oscillator for generating a system clock signal, and capable of operating in a power saving mode for reducing power consumption. 
     2. Description of Related Art 
     Recently, data processors such as microcomputers, above all, single-chip microcomputers have been widely applied to portable equipment like notebook PCs and video cameras, resulting in reduction in their size and power consumption. In particular, there is a growing demand for power saving of equipment using a battery as its power supply to further lengthen its operation time. 
     In CMOS single-chip microcomputers, their consumed current will be reduced by decreasing the operation frequency because the former is proportional to the latter. However, the operation frequency cannot be reduced if a high-rate operation is required. 
     As an alternative to the foregoing, the power saving can be achieved by applying sleep mode in which the oscillator of a single-chip microcomputer is stopped while it does not carry out processing. Thus, it operates only when some processing is required. 
     In the power saving using the sleep mode, however, the single-chip microcomputer cannot operate its embedded peripheral circuits such as an A/D converter while the oscillator is being stopped. To operate the A/D converter and other peripheral circuits, the oscillator must be activated each time before the single-chip microcomputer is brought in operation with them. 
     Alternatively, the power saving of the single-chip microcomputer is carried out by switching a high-rate mode and low-rate mode. The single-chip microcomputer has the high-rate mode based on a clock signal generated by a high-rate oscillator, and the low-rate mode based on a clock signal generated by a low-rate oscillator, and operates in the low-rate mode to save power except when the high-rate operation is required. 
     FIG. 11 is a block diagram showing a configuration of a single-chip microcomputer capable of carrying out power saving by switching its mode between the sleep mode, high-rate mode and low-rate mode. In FIG. 11, the reference numeral 100 designates a single-chip microcomputer, 101 designates a CPU, 102 designates a timer, 103 designate a RAM, 104 designates a ROM, 105 designates an interrupt controller, 106 designates an A/D converter, 107 designates an I 2  C bus, 108 designates an input/output port, 109 designates a clock generator, 110 designates a data bus, 111 designates an address bus, 112 designates a control signal line, 113 designates a high-rate oscillator for generating an original high-rate clock signal, and 114 designates a low-rate oscillator 114 for generating an original low-rate clock signal. These oscillators 113 and 114 generate the original clock signals using an external crystal oscillator or ceramic oscillator with high accuracy. 
     Next, the operation of the conventional single-chip microcomputer will be described. 
     The single-chip microcomputer 100, with its timer 102, RAM 103, ROM 104, interrupt controller 105, A/D converter 106, I 2  C bus 107, input/output port 108 and clock generator 109 connected to the CPU 101 through the data bus 110, address bus 111, and control signal line 112, executes programs stored in the ROM 104 while storing and reading data to and from the RAM 103, thereby carrying out control by activating the peripheral devices such as the timer 102. 
     In this case, a system clock signal φ generated by the clock generator 109 is required to bring into operation the embedded circuits such as the CPU 101, ROM 104, RAM 103, timer 102, interrupt controller 105, A/D converter 106, I 2  C bus 107, and input/output port 108. The clock generator 109 generates the system clock signal φ using the original clock signals oscillated by the external oscillators 113 and 114. 
     The single-chip microcomputer 100 has the CPU 101 execute a sleep mode instruction to bring itself into the sleep mode by stopping the oscillation of the high-rate oscillator 113 and low-rate oscillator 114 and halting the supply of the system clock signal φ to the CPU 101 and the peripheral circuits. To release the sleep mode, an external trigger signal is usually input to recover the supply of the system clock signal φ to the CPU 101 and peripheral circuits. In this case, the high-rate oscillator 113 starts its oscillation in response to the external trigger signal, and restarts the supply of the system clock signal φ after the oscillation has been stabilized. 
     The switching between the high-rate mode and low-rate mode is generally carried out by the instruction of the CPU 101. For example, when the high-rate operation becomes unnecessary, the following steps are taken to achieve switching from a first state, in which both the high-rate oscillator 113 and low-rate oscillator 114 are oscillating and the system clock signal φ is supplied from the high-rate oscillator 113 to carry out the high-rate operation, to a second state, in which the oscillation of the high-rate oscillator 113 is stopped and the system clock signal φ is supplied from the low-rate oscillator 114 to save power. 
     (1) The CPU 101 issues a command to have the low-rate oscillator 114 supply the system clock signal φ. 
     (2) The CPU 101 issues a command to stop the high-rate oscillator 113. 
     Reversely, switching from the second state to the first state is carried out through the following steps to have the high-rate oscillator 113 supply the system clock signal φ. 
     (3) The CPU 101 issues a command to restart the oscillation of the high-rate oscillator 113. 
     (4) The CPU 101 waits until the oscillation of the high-rate oscillator 113 is stabilized. 
     (5) The CPU 101 issues a command to have the high-rate oscillator 113 supply the system clock signal φ. 
     The conventional data processor with the foregoing configuration has a problem, in the case of saving power using the sleep mode, in that it must wait for a few hundred microseconds to a few milliseconds until the oscillator has been stabilized after releasing the sleep mode, which causes an idle time. 
     It has a similar problem, when switching the mode between the high-rate mode and low-rate mode, in that it must wait for a few hundred microseconds to a few milliseconds until the high-rate oscillator has stabilized its oscillation after it started the oscillation, which also involves an idle time. Thus, to operate the A/D converter and other peripheral circuits at the high rate, it is unavoidable that some idle time occurs because they cannot operate at the high-rate while the high-rate oscillator 113 is being stopped, and hence it must be switched to the high-rate mode each time to bring them into operation. 
     This presents another problem in that effective power saving is difficult. For example, before shifting into the high-rate mode, it is often desirable to operate only the A/D converter or peripheral circuits at the high-rate with keeping the remaining components like the CPU in the sleep mode or in the low-rate mode. To operate the A/D converter or peripheral circuits in the conventional system, however, it is necessary for the CPU to release the sleep mode or to switch into the high-rate mode, which inevitably brings the remaining components into operation at the high-rate. This results in an increase in consumption current due to the remaining components, thereby hindering the effective use of the A/D converter and other peripheral circuits from the viewpoint of power saving. 
     SUMMARY OF THE INVENTION 
     The present invention is implemented to solve the foregoing problems. It is therefore an object of the present invention to provide a data processor which can reduce the wait time from the start of the oscillation of the clock signal for operating the peripheral circuits to its stabilization, and can implement the efficient operation of the peripheral circuits in terms of the consumed power, thereby achieving the power saving. 
     According to one aspect of the present invention, there is provided a data processor that has a normal operation mode in which it operates in a normal rate, and a power saving mode in which it saves consumed power, and that operates in response to a system clock signal generated by a system clock oscillator in the normal operation mode, the data processor comprising: a peripheral circuit; an alternative clock generator for generating an alternative clock signal used instead of the system clock signal; and a clock switching circuit for supplying the peripheral circuit with the alternative clock signal generated by the alternative clock generator in the power saving mode, and with the system clock signal generated by the system clock oscillator in the normal operation mode. 
     Here, the data processor may further comprise an alternative clock generation controller for controlling generation of the alternative clock signal by the alternative clock generator in the power saving mode. 
     The peripheral circuit may be an A/D converter. 
     The power saving mode may be a sleep mode in which generation of the system clock signal is halted, and the alternative clock generation controller may comprise a feedback loop controlling circuit which starts generation of the alternative clock signal by the alternative clock generator in the sleep mode by enabling a feedback loop of the alternative clock generator in response to a trigger signal indicative of a start of a processing of the A/D converter, and which halts the generation of the alternative clock signal by disabling the feedback loop of the alternative clock generator when one of releasing of the sleep mode and completion of A/D conversion by the A/D converter has occurred. 
     The clock switching circuit may comprise a gate circuit for supplying, in the sleep mode, the A/D converter with the alternative clock generated, under control of the alternative clock generation controller, by the alternative clock generator in response to a clock switching signal based on an operation mode switching signal, and for supplying, when the sleep mode is released, the A/D converter with the system clock by switching from the alternative clock signal in response to the clock switching signal. 
     The data processor may further comprise: a register for storing in advance a reference value to be compared with an output of the A/D converter; a comparator for comparing the output of the A/D converter with the reference value stored in the register; and a control circuit for releasing the sleep mode of the data processor in response to a compared result by the comparator, and for controlling supply of the system clock to the A/D converter in response to the compared result by the comparator, the supply of the system clock being carried out through the clock switching circuit when the sleep mode is released. 
     The data processor may have a high-rate mode in which it operates at a high rate and a low-rate mode in which it operates at a low rate, and the power saving mode is the low-rate mode; the alternative clock generation controller may comprise a feedback loop controlling circuit which starts generation of the alternative clock signal by the alternative clock generator in the low-rate mode by enabling a feedback loop of the alternative clock generator in response to a trigger signal indicative of a start of a processing of the A/D converter, and which halts the generation of the alternative clock signal by disabling the feedback loop of the alternative clock generator when one of releasing of the low-rate mode to shift into the high-rate mode and completion of A/D conversion by the A/D converter has occurred; and the clock switching circuit may comprise a gate circuit for supplying, in the low-rate mode, the A/D converter with the alternative clock generated, under control of the alternative clock generation controller, by the alternative clock generator in response to a clock switching signal based on an operation mode switching signal, and for supplying, when the low-rate mode is released to shift into the high-rate mode, the A/D converter with the system clock by switching from the alternative clock signal in response to the clock switching signal. The feedback loop control circuit of the alternative clock generation controller may comprise: a first holding circuit for latching the trigger signal indicative of the start of the processing of the A/D converter, and a completion signal output when the A/D conversion of the A/D converter has been completed; an input circuit for capturing, in response to an output of the first holding circuit latching the trigger signal, a status signal indicative of the power saving mode; a second holding circuit for latching the status signal fed through the input circuit in a phase opposite to a phase captured by the input circuit, and for outputting it as a control signal for controlling clock switching operation of the clock switching circuit; and an oscillation control circuit for controlling enabling and disabling of the feedback loop of the alternative clock generator in response to the status signal captured by the input circuit and to an output of the second holding circuit. 
     The power saving mode may be a sleep mode in which generation of the system clock signal is halted; the peripheral circuit may be a bidirectional bus system for transferring data through a bidirectional transmission line; the alternative clock generation controller may comprise a detector for having the alternative clock generator start generation of the alternative clock signal in response to a change in a potential level of the bidirectional transmission line, and for having the alternative clock generator halt generation of the alternative clock signal in response to address data the bidirectional bus system receives from the bidirectional transmission line while operating in response to the alternative clock signal; the clock switching circuit may comprise a gate circuit for supplying, in the sleep mode, the bidirectional bus system with the alternative clock signal generated by the alternative clock generator, and for supplying, when the sleep mode is released, the bidirectional bus system with the system clock signal by switching from the alternative clock signal; and the data processor may further comprise an interrupt signal generating circuit for generating an interrupt signal for releasing the sleep mode in response to the address data the bidirectional bus system receives from the bidirectional transmission line while operating in response to the alternative clock signal. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram showing a main part of an embodiment 1 of a data processor in accordance with the present invention; 
     FIG. 2 is a circuit diagram showing a peripheral circuit oscillator and alternative clock generation controller of the embodiment 1; 
     FIGS. 3(a)-(k) are timing charts for illustrating signal waveforms of various portions in the embodiment 1 when carrying out the A/D conversion in a normal mode; 
     FIGS. 4(a)-(l) are timing charts for illustrating signal waveforms of various portions in the embodiment 1 when carrying out the A/D conversion in a sleep mode; 
     FIG. 5 is a block diagram showing a main part of an embodiment 2 of the data processor in accordance with the present invention; 
     FIGS. 6(a)-(m) are timing charts for illustrating signal waveforms of various portions in the embodiment 2 when carrying out the A/D conversion in a low-rate mode; 
     FIG. 7 is a block diagram showing a main part of an embodiment 3 of the data processor in accordance with the present invention; 
     FIGS. 8(a)-(o) are timing charts for illustrating signal waveforms of various portions in the embodiment 3; 
     FIG. 9 is a block diagram showing a main part of an embodiment 4 of the data processor in accordance with the present invention; 
     FIGS. 10(a)-(i) are timing charts for illustrating signal waveforms of various portions in the embodiment 4; and 
     FIG. 11 is a block diagram showing a configuration of a conventional data processor. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The invention will now be described with reference to the accompanying drawings. 
     Embodiment 1 
     FIG. 1 is a block diagram showing a main part of an embodiment 1 of a data processor in accordance with the present invention. Although the embodiment 1 handles a single-chip microcomputer as the data processor, the present invention can also be applied to a board microcomputer that comprises on a board a CPU, ROM, RAM and other components, and has a different configuration than the single-chip microcomputer. 
     In FIG. 1, the reference numeral 200 designate a single-chip microcomputer (data processor), and 1 designate a peripheral circuit oscillator (alternative clock generator). The peripheral circuit oscillator 1 comprises the following terminals: an operation mode switching signal input terminal 1a to which an operation mode switching signal is input indicating the mode of the operation of the single-chip microcomputer 200, that is, the normal operation mode or sleep mode; an oscillation start signal input terminal 1b to which a trigger signal ADSTARTTRG is input for starting the peripheral circuit oscillator 1; an oscillation stop signal input terminal 1c to which an A/D conversion stop signal ADCOMP is input for stopping the oscillation of the peripheral circuit oscillator 1 after the completion of the conversion by an A/D converter as a peripheral circuit; a clock signal φCR output terminal 1d for producing in the sleep mode an alternative clock signal φCR generated by the peripheral circuit oscillator 1 for operating the A/D converter; and a clock switching signal output terminal 1e for producing a clock switching signal MODE for selecting a clock signal to be supplied to the A/D converter. 
     The reference numeral 2 designates the A/D converter embedded in the single-chip microcomputer 200 as a peripheral circuit. It comprises the following terminals: an A/D conversion clock signal input terminal 2a to which an A/D conversion clock signal ADCLK is applied to activate the A/D converter 2; an A/D conversion start signal input terminal 2b to which a trigger signal ADSTARTTRG is applied to start the A/D converter 2; an A/D conversion result output terminal 2c to which an 8-bit bus is connected for outputting an A/D conversion result signal ADRESLT of the A/D converter 2; and an A/D conversion stop signal output terminal 2d from which the A/D conversion stop signal ADCOMP is output after the completion of the A/D conversion by the A/D converter 2. 
     The reference numeral 3 designates a clock switching circuit (gate circuit) for switching a clock signal to be input to the A/D converter 2 in response to the operation mode, that is, the normal operation mode or sleep mode. The clock switching circuit 3 comprises an inverter 3a for to inverting the clock switching signal MODE output from the clock switching signal output terminal 1e; a two-input AND gate 3b with its input terminals connected to the clock switching signal output terminal le and clock signal φCR output terminal 1d, respectively; a two-input AND gate 3c with its first input terminal connected to an output terminal of the inverter 3a and its second input terminal connected to a system clock signal φ output by an oscillator not shown in this figure; and a two-input OR gate 3d with its output terminals connected to the output terminals of the two-input AND gate 3b and two-input AND gate 3c, and its output terminal connected to the A/D conversion clock signal input terminal 2a. The foregoing oscillator not shown in this figure is embedded in the single-chip microcomputer 200 which operates in response to the system clock signal φ output by the oscillator. 
     The symbol ADSTART designates a trigger signal that a CPU of the single-chip microcomputer 200 (not shown in this figure) generates to start the A/D converter 2, and EXTTRG designates an external trigger signal supplied from the outside of the single-chip microcomputer 200 to start the A/D conversion. These signals are input to a two-input OR gate 5. The symbol SLEEP designates the operation mode switching signal output from the CPU, which is placed at an &#34;H&#34; level in the sleep mode, and &#34;L&#34; level in the normal mode. The trigger signal ADSTARTTRG is output from the two-input OR gate 5 as a logical OR of the trigger signal ADSTART and the external trigger signal EXTTRG, and is supplied to the oscillation start signal input terminal 1b of the peripheral circuit oscillator 1 and A/D conversion start signal input terminal 2b of the A/D converter 2. 
     FIG. 2 is a block diagram showing a configuration of the peripheral circuit oscillator 1 as shown in FIG. 1 and an alternative clock generation controller. In FIG. 2, the reference numeral 1y designates a latch (first holding circuit) that constitutes a part of the alternative clock generation controller, and generates a signal ADCONV from the oscillation start signal ADSTARTTRG and oscillation stop signal ADCOMP. The signal ADCONV is kept at the &#34;H&#34; level while the A/D converter 2 is carrying out the A/D conversion in response to the output of the oscillation start signal ADSTARTTRG, and is placed at the &#34;L&#34; level by the oscillation stop signal ADCOMP when the A/D converter 2 stops the A/D conversion. Here, the oscillation start signal ADSTARTTRG is generated at the same timing as the trigger signal ADSTART or the external trigger signal EXTTRG, and the oscillation stop signal ADCOMP is generated at the same timing as the A/D conversion stop signal ADCOMP. 
     The reference numerals 1g and 1h each designate a transmission gate with its conducting or nonconducting state is controlled by the signal ADCONV and the inverted signal NADCONV. The transmission gate 1g constitutes a feedback loop control circuit and an input circuit, whereas the transmission gate 1h constitutes a second holding circuit together with a series circuit 1i of two inverters. The series circuit 1i is connected in parallel with the transmission gate 1h. The reference numeral 1j designates a two-input NAND gate with its first input terminal connected to the signal ADCONV and its second input terminal connected to a connecting point X of the outputs of the transmission gate 1h and serial circuit 1i. The two-input NAND gate 1j constitutes an oscillation control circuit and the feedback loop control circuit. The reference numeral 1k designates a two-input NOR gate with its first input terminal connected to the output of the two-input NAND gate 1j and its second input terminal connected to the output of a two-input NAND gate 1q. The reference numeral 1m designate an inverter, and 1n designates a delay circuit consisting of six inverters. The reference numeral 1o designates a two-input NOR gate with its first input terminal connected to the output of the final inverter of the delay circuit in and with its second input terminal connected to the output terminal of the inverter 1m. The reference numeral 1p designates an inverter for inverting the output of the final inverter of the delay circuit 1n and for feeding its output back to the input side, and 1q designates a two-input NAND gate with its first input terminal connected to the output terminal of the inverter 1p and the second input terminal connected to the connecting point X of the outputs of the transmission gate 1h and serial circuit 1i connected in parallel. The reference numeral 1z designates a main portion of the alternative clock generation controller constituting it along with the latch 1y. 
     The clock switching signal MODE output from the clock switching signal output terminal 1e is acquired from the connecting point X of the outputs of the transmission gate 1h and serial circuit 1i connected in parallel. 
     Next, the operation of the present embodiment 1 will be described. 
     FIGS. 3(a)-(k) are timing charts showing signal waveforms of various portions in the present embodiment 1 when the A/D conversion is carried out in the normal mode, and FIG. 4 is a corresponding timing chart when it is carried out in the sleep mode. 
     (1) The A/D conversion in the normal mode. 
     First, the A/D conversion in the normal mode will be described with reference to FIG. 3. It is the same as the conventional A/D conversion carried out in response to the system clock signal φ. 
     When the CPU of the single-chip microcomputer 200 outputs the trigger signal ADSTART at time t1 as illustrated in FIG. 3(c) as a command to start the A/D conversion, the trigger signal ADSTARTTRG is output at the same time t1 in response to the trigger signal ADSTART, and is delivered to the oscillation start signal input terminal 1b of the peripheral circuit oscillator 1 and the A/D conversion start signal input terminal 2b of the A/D converter 2. 
     As a result, the oscillation start signal ADSTARTTRG is supplied to the latch 1y as shown in FIG. 2 at time t1, which causes the signal ADCONV to be placed at the &#34;H&#34; level. Thus, the transmission gate 1g is brought into the conducting state by the signal ADCONV at the &#34;H&#34; level and the inverted signal NADCONV at the &#34;L&#34; level, and captures the operation mode switching signal SLEEP. In this case, the transmission gate 1h is kept at the nonconducting state. 
     Since the operation mode switching signal SLEEP is placed at the &#34;L&#34; level in the normal mode, the connecting point X of the outputs of the transmission gate 1h and serial circuit 1i is also placed at the &#34;L&#34; level. Thus, the output of the two-input NAND gate 1j and that of the two-input NAND gate 1q are both set at the &#34;H&#34; level, and the output of the two-input NOR gate 1k is placed at the &#34;L&#34; level. Accordingly, the peripheral circuit oscillator 1 does not start its oscillation, and the alternative clock signal φCR output from the clock signal φCR output terminal 1d is kept at the &#34;L&#34; level as illustrated in FIG. 3(g). 
     In addition, the clock switching signal MODE output from the clock switching signal output terminal 1e is also kept at the &#34;L&#34; level as illustrated in FIG. 3(h). 
     As a result, the two-input AND gate 3b closes and the two-input AND gate 3c opens, so that the system clock signal φ are is supplied to the A/D conversion clock signal input terminal 2a of the A/D converter 2 through the two-input OR gate 3d. 
     Thus, at time t1, the A/D converter 2 starts the A/D conversion in response to the trigger signal ADSTARTTRG and system clock signal φ fed thereto, and completes it with generating the A/D conversion stop signal ADCOMP at time t2 after a predetermined clock cycles (16 cycles in this case) as illustrated in FIGS. 3(f) and 3(j). 
     The A/D conversion stop signal ADCOMP inverts the latch 1y as shown in FIG. 2, thereby placing the signal ADCONV at the &#34;L&#34; level and the inverted signal NADCONV at the &#34;H&#34; level. This brings the transmission gate 1g into the nonconducting state and the transmission gate 1h into the conducting state. The transmission gate 1h thus brought into the conducting state constitutes a latch circuit together with the serial circuit 1i, and latches the operation mode switching signal SLEEP of the &#34;L&#34; level. In this case, it is also possible to cause an interrupt to the CPU using the A/D conversion stop signal ADCOMP. Thus, the A/D conversion result signal ADRESLT is output at time t2. 
     (2) The A/D Conversion in the Sleep Mode. 
     Next, the A/D conversion in the sleep mode will be described which is started by the external trigger signal EXTTRG fed from the outside of the single-chip microcomputer 200 and is carried out as shown in FIG. 4. 
     In the sleep mode, the system clock signal φ is set at the &#34;H&#34; level as illustrated in FIG. 4(a) because the system clock oscillator embedded in the single-chip microcomputer 200, which is not shown in FIG. 1, suspends its oscillation. In addition, the operation mode switching signal SLEEP is set at the &#34;H&#34; level because of the sleep mode, and is input to the operation mode switching signal input terminal 1a. 
     When the external trigger signal EXTTRG is input at time t1 to start the A/D conversion as illustrated in FIG. 4(d), the trigger signal ADSTARTTRG is output at the same time t1 as illustrated in FIG. 4(e), and is supplied to the latch 1y shown in FIG. 2 as the oscillation start signal, which places the signal ADCONV at the &#34;H&#34; level and the inverted signal NADCONV at the &#34;L&#34; level. Thus, the transmission gate 1g is brought into conducting state, and the operation mode switching signal SLEEP of the &#34;H&#34; level is captured through the operation mode switching signal input terminal 1a. 
     As a result, the clock switching signal MODE output from the clock switching signal output terminal 1e is also placed at the &#34;H&#34; level. Hence, the two-input AND gate 3b opens, and the two-input AND gate 3c closes, which makes a preparation for supplying the A/D conversion clock signal input terminal 2a of the A/D converter 2 with the alternative clock signal φCR through the two-input OR gate 3d, when it is output from the clock signal φCR output terminal 1d. 
     Incidentally, unless the trigger signal ADSTARTTRG is output, the signal ADCONV and the inverted signal NADCONV are kept at the &#34;L&#34; and &#34;H&#34; levels, respectively. Accordingly, the transmission gate 1g is kept at the nonconducting state and the transmission gate 1h is placed at the conducting state. In this case, since the operation mode switching signal SLEEP of the &#34;L&#34; level has been latched by the latch circuit consisting of the transmission gate 1h and serial circuit 1i, no oscillation of the peripheral circuit oscillator 1 takes place, keeping the alternative clock signal φCR at the &#34;L&#34; level, and the A/D convertor clock signal ADCLK in halted state. 
     Once the &#34;H&#34; level operation mode switching signal SLEEP has been captured at time t1, the connecting point X of the outputs of the transmission gate 1h and two-input NAND gate 1j connected in parallel is brought into the &#34;H&#34; level. This places the output of the two-input NAND gate 1j at the &#34;L&#34; level, enabling the output of the two-input NAND gate 1q. As a result, the output of the two-input NOR gate 1k changes in response to the output of the two-input NAND gate 1q, and the peripheral circuit oscillator 1 starts its oscillation, outputting the alternative clock signal φCR from the clock signal φCR output terminal 1d as illustrated in FIG. 4(h). The alternative clock signal φCR is supplied to the A/D conversion clock signal input terminal 2a of the A/D converter 2 through the two-input AND gate 3b and two-input OR gate 3d whose gates are open. 
     It should be noted here that the oscillation of the peripheral circuit oscillator 1 is stabilized in a short time because of its light load. 
     The trigger signal ADSTARTTRG, which is produced at the same time t1 with the external trigger signal EXTTRG for starting the A/D conversion as illustrated in FIGS. 4(d) and 4(e), is also supplied to the A/D conversion start signal input terminal 2b of the A/D converter 2. Thus, the A/D converter 2, receiving the trigger signal ADSTARTTRG and the alternative clock signal φCR, starts the A/D conversion, and completes it with generating the A/D conversion stop signal ADCOMP after the predetermined clock cycles (16 clock cycles, in this case) have elapsed at time t2. Completing the A/D conversion, the A/D converter 2 produces the A/D conversion result signal ADRESLT consisting of an 8-bit converted value. 
     At the same time t2, the A/D conversion stop signal ADCOMP requires the CPU to release the sleep mode, and activates the system clock oscillator not shown in the drawings. Thus, the CPU releases the sleep mode at time t2, and sets the operation mode switching signal SLEEP at the &#34;L&#34; level as illustrated in FIG. 4(b). Although the system clock oscillator starts its oscillation at time t2, at which the sleep mode is released, the system clock signal φ is not supplied to the CPU and A/D converter 2 until it is stabilized at time t3 as illustrated in FIGS. 4(a) and 4(c). In other words, the system clock oscillator requires the oscillation stabilized interval from t2 to t3, and the system clock signal φ is supplied to the CPU and the A/D converter 2 at time t3 at which that interval has passed. 
     In the peripheral circuit oscillator 1 which receives the A/D conversion stop signal ADCOMP at the oscillation stop signal input terminal 1c at time t2, the latch 1y is flipped in response to it, changing the signal ADCONV from the &#34;H&#34; to &#34;L&#34; level at time t2 as illustrated in FIG. 4(g). Thus, the output of the two-input NAND gate 1j is placed at the &#34;H&#34; level, and the output of the two-input NOR gate 1k is placed at the &#34;L&#34; level, resulting in the completion of the A/D conversion and the halt of the oscillation of the alternative clock signal φCR. 
     It is possible to cause an interrupt to the CPU by the A/D conversion stop signal ADCOMP. 
     Thus, it is possible for the A/D converter 2 to carry out the A/D conversion in response to the externally supplied external trigger signal EXTTRG even in the sleep mode, and for the single-chip microcomputer 200 to start its operation from the sleep mode after the A/D conversion has been completed. 
     As described above, the present embodiment 1 can activate the peripheral circuit oscillator 1 in response to the externally supplied external trigger signal EXTTRG in the sleep mode, and have only the A/D converter 2, the peripheral circuit, operate in response to the peripheral alternative clock signal φCR generated by the peripheral circuit oscillator 1 at the rate corresponding to the clock signal, thereby enabling the A/D converter to operate during the sleep mode without generating the system clock signal φ. This offers an advantage that only the peripheral circuit is activated with preventing the remaining portion from being put into operation, thus achieving efficient power saving. 
     Embodiment 2 
     FIG. 5 is a block diagram showing a main portion of an embodiment 2 of the data processor in accordance with the present invention, in which the same or corresponding portions to those of FIG. 1 are designated by the same reference numerals and the description thereof is omitted here. The circuit configuration as shown in FIG. 2 is also applied to the present embodiment 2. 
     Although the embodiment 2 handles a single-chip microcomputer as the data processor, the present invention can also be applied to a board microcomputer that comprises on a board a CPU, ROM, RAM and other components, and has a different configuration than the single-chip microcomputer. 
     In FIG. 5, the reference numeral 300 designate a single-chip microcomputer (data processor) of the present embodiment 2. The single-chip microcomputer 300 comprises a high-rate oscillator and low-rate oscillator for generating a pair of system clock signals φ1 and φ2, and the operation mode switching signal input terminal la of the peripheral circuit oscillator 1 is supplied with the high-rate/low-rate operation mode switching signal for ID switching between a high-rate mode based on the high-rate system clock signal φ1 generated by the high-rate oscillator and the low-rate mode based on the low-rate system clock signal φ2 generated by the low-rate oscillator. The high-rate/low-rate operation mode switching signal is set at the &#34;H&#34; level in the low-rate mode and at the &#34;L&#34; level in the high-rate mode. 
     Next, the operation of the present embodiment 2 in the low-rate mode will be described with reference to the timing chart of FIGS. 6(a)-(m) which illustrate signal waveforms of various portions while the A/D conversion is carried out in the low-rate mode. 
     Since the single-chip microcomputer 300 operates in the low-rate mode, the system clock signal φ is based on the low-rate system clock signal φ2 oscillated by the low-rate oscillator as illustrated in FIG. 6(a). Besides, the high-rate/low-rate operation mode switching signal of the &#34;H&#34; level is supplied to the operation mode switching signal input terminal 1a, and hence the clock switching signal MODE of the &#34;H&#34; level is output from the clock switching signal output terminal 1e. Thus, the alternative clock signal φCR is selected as the A/D conversion clock signal ADCLK to be supplied to the A/D conversion clock signal input terminal 2a. 
     In this case, since the trigger signal ADSTARTTRG is not produced from the two-input OR gate 5, the alternative clock signal φCR is set at the &#34;L&#34; level, and hence the A/D conversion clock signal ADCLK supplied to the A/D conversion clock signal input terminal 2a is also set at the &#34;L&#34; level. 
     At time t1 of FIG. 6, the CPU of the single-chip microcomputer 300, which is not shown in FIG. 5, outputs the trigger signal ADSTART as illustrated in FIG. 6(e) as a command to start the A/D conversion. The trigger signal ADSTARTTRG is output at the same time t1 in response to the trigger signal ADSTART, and is delivered to the oscillation start signal input terminal 1b of the peripheral circuit oscillator 1 and the A/D conversion start signal input terminal 2b of the A/D converter 2. 
     As a result, the trigger signal ADSTARTTRG is supplied to the latch 1y as shown in FIG. 2 at time t1, which causes the signal ADCONV and the inverted signal NADCONV to be placed at the &#34;H&#34; level and &#34;L&#34; level, respectively. Thus, the transmission gate 1g is brought into the conducting state by the signal ADCONV at the &#34;H&#34; level and the inverted signal NADCONV at the &#34;L&#34; level, and captures the high-rate/low-rate operation mode switching signal through the operation mode switching signal input terminal 1a. In this case, the transmission gate 1h is kept at the nonconducting state. 
     At the same time t1, the clock switching signal MODE output from the clock switching signal output terminal 1e is placed at the &#34;H&#34; level as illustrated in FIG. 3(j). As a result, the two-input AND gate 3b opens and the two-input AND gate 3c closes, which enable the alternative clock signal φCR to be supplied to the A/D conversion clock signal input terminal 2a of the A/D converter 2 through the two-input OR gate 3d, if it is output from the clock signal φCR output terminal 1d. 
     When the high-rate/low-rate operation mode switching signal of the &#34;H&#34; level has been captured through the operation mode switching signal input terminal 1a at time t1, the connecting point X of the outputs of the transmission gate 1h and serial circuit 1i is also placed at the &#34;H&#34; level. This in turn places the output of the two-input NAND gate 1j at the &#34;L&#34; level, enabling the output of the two-input NAND gate 1q. Thus, the output of the two-input NOR gate 1k changes in response to the output from the two-input NAND gate 1q, and hence the peripheral circuit oscillator 1 starts its oscillation at time t1 as illustrated in FIG. 6(i). As a result, the alternative clock signal φCR is output from the clock signal φCR output terminal 1d, and is supplied to the A/D conversion clock signal input terminal 2a of the A/D converter 2 through the two-input AND gate 3b and two-input OR gate 3d whose gates are open. 
     The trigger signal ADSTARTTRG, which is produced at the same time t1 with the trigger signal ADSTART for starting the A/D conversion as illustrated in FIGS. 6(e) and 6(f), is also supplied to the A/D conversion start signal input terminal 2b of the A/D converter 2. Thus, the A/D converter 2, receiving the trigger signal ADSTARTTRG and the alternative clock signal φCR as illustrated in FIG. 6(i), starts the A/D conversion at time t1, and completes it with generating the A/D conversion stop signal ADCOMP after the predetermined clock cycles (16 clock cycles, in this case) have elapsed at time t2. Completing the A/D conversion, the A/D converter 2 produces the A/D conversion result signal ADRESLT consisting of an 8-bit converted value. 
     In the peripheral circuit oscillator 1, the A/D conversion stop signal ADCOMP is input to the oscillation stop signal input terminal 1c, resulting in the completion of the A/D conversion and the halt of the oscillation of the alternative clock signal φCR. 
     Thus, it is possible for the A/D converter 2 to carry out the A/D conversion at a high-rate in response to the frequency of the alternative clock signal φCR even when the single-chip microcomputer 200 is operating in the low-rate mode. 
     Here, the A/D conversion stop signal ADCOMP can cause an interrupt to the CPU. It is also possible to add circuitry for automatically carrying out a series of operations such as activating the high-rate oscillator to start its oscillation by the A/D conversion stop signal ADCOMP, and switching the operation mode of the single-chip microcomputer 300 to the high-rate mode after the oscillation has been stabilized. 
     As described above, the present embodiment 2 can activate the peripheral circuit oscillator 1 in response to the trigger signal ADSTART supplied from the CPU operating in the low-rate mode, and have only the A/D converter 2, the peripheral circuit, operate in response to the peripheral alternative clock signal φCR generated by the peripheral circuit oscillator 1 at the rate corresponding to the clock signal, thereby enabling the A/D converter to operate even in the low-rate mode without releasing the low-rate mode and without shifting into the high-rate mode to generate the high-rate system clock signal φ1 as in the conventional system. This offers an advantage of operating only the peripheral circuit at the high-rate in the low-rate mode, thereby achieving the efficient power saving. 
     Embodiment 3 
     Next, an example will be described which carries out A/D conversion in response to an external trigger signal in the sleep mode in a single-chip microcomputer embedding an A/D converter, and starts the microcomputer from the sleep mode only if the A/D conversion result compared with a reference value prestored in a register satisfies a certain condition. 
     FIG. 7 is a block diagram showing a main part of an embodiment 3 of the data processor in accordance with the present invention, in which the same or corresponding portions to those of FIG. 1 are designated by the same reference numerals, and the description thereof is omitted here. The circuit configuration as shown in FIG. 2 is also applied to the present embodiment 3. 
     In FIG. 7, the reference numeral 400 designates a single-chip microcomputer (data processor) of the present embodiment 3; and 15 designate a comparison register (register) for storing a reference value in advance; 16 designates a comparator for comparing the conversion result signal ADRESLT output from the A/D converter 2 with the reference value stored in the comparison register 15. The reference symbols CMPDATA and CMP designate the reference value stored in the comparison register 15, and a compared result signal obtained by comparing the A/D conversion result signal ADRESLT with the reference value CMPDATA, respectively. The reference numeral 19 designates a latch (control circuit) for outputting the operation mode switching signal SLEEP of the &#34;H&#34; level in response to a sleep mode setting signal fed from the CPU, and for outputting that of the &#34;L&#34; level in response to a sleep mode releasing signal. 
     Next, the operation of the embodiment 3 will be described. 
     FIGS. 8(a)-(o) are timing charts showing signal waveforms of various portions of the single-chip microcomputer 400 which carries out the A/D conversion in the sleep mode, and starts its operation from the sleep mode only if the compared result of the A/D conversion result with the reference value CMPDATA satisfies a predetermined condition. 
     It is assumed here that the single-chip microcomputer 400 operates in the normal operation mode, and hence the operation mode switching signal SLEEP applied to the operation mode switching signal input terminal 1a is placed at the &#34;L&#34; level. Accordingly, the clock switching signal MODE is placed at the &#34;L&#34; level, and hence the system clock switching φ is selected as the A/D conversion clock signal ADCLK to be supplied to the A/D conversion clock signal input terminal 2a. 
     When the CPU outputs the sleep mode setting signal at time t0 as illustrated in FIG. 8(b), the operation mode switching signal SLEEP changes its level from the &#34;L&#34; to &#34;H&#34; level. In response to this, the system clock signal φ, which has been output while the operation mode switching signal SLEEP is at the &#34;L&#34; level, is set at the &#34;H&#34; level at the time t0 as illustrated in FIG. 8(a). 
     When the operation mode switching signal SLEEP changes its level from the &#34;L&#34; to &#34;H&#34; level at time t0, the clock switching signal MODE also changes from the &#34;L&#34; to &#34;H&#34; level, thereby switching the A/D conversion clock signal ADCLK, which is to be supplied to the A/D conversion clock signal input terminal 2a, from the system clock signal φ to the alternative clock signal φCR. In this case, since the trigger signal ADSTARTTRG has not yet been produced from the two-input OR gate 5, the alternative clock signal φCR is set at the &#34;L&#34; level, and hence the A/D conversion clock signal ADCLK is halted. 
     Subsequently, when the external trigger signal EXTTRG is input at time t1 as illustrated in FIG. 8(e) to start the A/D conversion, the trigger signal ADSTARTTRG is produced at the same time t1 in response to the external trigger signal EXTTRG, and is supplied to the oscillation start signal input terminal 1b of the peripheral circuit oscillator 1 and the A/D conversion start signal input terminal 2b of the A/D converter 2. 
     In this case, since the operation mode switching signal SLEEP is set at the &#34;H&#34; level, the peripheral circuit oscillator 1 starts its oscillation, outputting the alternative clock signal φCR from the clock signal φCR output terminal 1d. The alternative clock signal φCR is supplied to the A/D conversion clock signal input terminal 2a of the A/D converter 2 through the two-input AND gate 3b and two-input OR gate 3d. Thus, the A/D converter 2 starts the A/D conversion in response to the alternative clock signal φCR and the trigger signal ADSTARTTRG. 
     Afterward, at time t2 when the predetermined clock cycles (16 cycles, here) have elapsed, the A/D converter 2 completes the A/D conversion with outputting the A/D conversion stop signal ADCOMP. 
     Completing the A/D conversion, the A/D converter 2 outputs the 8-bit A/D conversion result signal ADRESLT from the A/D conversion result output terminal 2c. In response to this, the comparator 16 compares it with the reference value CMPDATA prestored in the comparison register 15, and outputs the compared result signal CMP only when they satisfy the predetermined condition. In response to the compared result signal CMP, the operation mode switching signal SLEEP output from the latch 19 changes its level from the &#34;H&#34; to &#34;L&#34; level, thereby releasing the sleep mode at time t3. 
     Although the oscillator starts oscillating the system clock signal φ when the sleep mode is released at time t3, its oscillation is unstable immediately after the start. Accordingly, the system clock signal φ is not supplied to the CPU or A/D converter 2 by time t4 at which the oscillation has been stabilized as illustrated in FIGS. 8(a) and 8(k). In other words, an appropriate waiting time is required for the system clock signal φ to be supplied to the CPU and A/D converter 2. 
     At time t2 when the A/D converter 2 completes the A/D conversion, and supplies the A/D conversion stop signal ADCOMP to the oscillation stop signal input terminal 1c of the peripheral circuit oscillator 1, the peripheral circuit oscillator 1 halts its oscillation. The A/D conversion stop signal ADCOMP can also cause an interrupt to the CPU. 
     The present embodiment 3 is also applicable to the foregoing embodiment 2 of the single-chip microcomputer operating in the high-rate mode and low-rate mode, by reading the &#34;sleep mode&#34; in the present embodiment 3 as the &#34;low-rate mode&#34;. 
     According to the present embodiment 3, the A/D conversion can be achieved even in the sleep mode in response to the externally supplied trigger signal EXTTRG. In addition, it has an advantage that the operation mode of the single-chip microcomputer 400, that is, whether the sleep mode is to be released or not, can be determined after the A/D conversion by comparing the A/D conversion result signal ADRESLT with the preset reference value CMPDATA. 
     Embodiment 4 
     Next, an example will be described of a microcomputer which incorporates as a peripheral circuit an I 2  C bus (a trade mark of a bidirectional bus of Philips&#39; in the Netherlands). The microcomputer is started from the sleep mode by having the I 2  C bus carry out a series of operations associated with address data reception in response to a clock signal generated by a multivibrator in a stop mode in which the I 2  C bus is in a slave receiving mode, and by having a system clock signal generated in response to a result of the address data reception. 
     FIG. 9 is a block diagram showing a main portion of an embodiment 4 of the data processor in accordance with the present invention, in which the configuration of the clock switching circuit 3 is the same as that of the foregoing embodiments 1-3, and hence the description thereof is omitted here. 
     In FIG. 9, the reference numeral 500 designates a single-chip microcomputer (data processor); 21 designates an I 2  C bus (bidirectional bus) as a peripheral circuit; 21a designates an alternative clock generation controller block; 21b designates an interrupt signal generating circuit for generating an interrupt signal for releasing the sleep mode in response to address data received from a serial clock line (bidirectional transmission line) 22 which will be referred to as &#34;SCL&#34; from now on; 23 designates a bidirectional serial data line which will be called &#34;SDA&#34; below; and 24 designates an SDA detector (alternative clock generation controller) for producing a multivibrator start signal in the stop mode in which the I 2  C bus is in a slave receiving mode. The SDA detector 24 and alternative clock generation controller block 21a constitute the alternative clock generation controller. 
     The reference numeral 25 designates a multivibrator (alternative clock generator) and 26 designates a latch. The latch 26 inputs through its set input terminal a one-shot φ (system clock) stop signal output when the single-chip microcomputer 500 shifts to the sleep mode, and through its reset input terminal a one-shot φ (system clock) start signal when the single-chip microcomputer 500 shifts from the sleep mode to the normal operation mode, in which it operates in response to the system clock signal φ. The latch 26 outputs from its Q output terminal a clock switching signal J3 which is placed at the &#34;H&#34; level when the φ stop signal is input to the set input terminal, and changes to the &#34;L&#34; level when the φ start signal is input to the reset input terminal. 
     Next, the operation of the present embodiment 4 will be described. 
     FIGS. 10(a)-(i) are timing charts showing the operation when starting the single-chip microcomputer 500 from the sleep mode by having the I 2  C bus 21 carry out the series of operations associated with the address data reception in response to the clock signal generated by the multivibrator 25 in the stop mode, in which the I 2  C bus 21 is in the slave receiving mode, and by having the system clock generated in response to a result of the address data reception. 
     At time t0 when the single-chip microcomputer 500 shifts to the sleep mode and the system clock signal φ is halted, the φ stop signal is supplied to the set input terminal of the latch 26 at the start of the sleep mode. As a result, the clock switching signal J3 rises to the &#34;H&#34; level at time t0 as illustrate in FIG. 10(a). 
     In the sleep mode of the single-chip microcomputer 500, in which the system clock signal φ is suspended, although the I 2  C bus 21 halts its operation, the SDA detector 24 detects the falling edge (start condition) of the SDA at time t1 as illustrated in FIGS. 10(d) and 10(e). When the SDA detector 24 detects the start condition as illustrated in FIG. 10(d), it supplies the multivibrator 25 with a multivibrator start signal SA. Then, the multivibrator 25 starts its oscillation at time t1, thereby generating the alternative clock signal φMB as illustrated in FIG. 10(g). 
     The alternative clock signal φMB is supplied to the I 2  C bus 21 through the two-input AND gate 3b and two-input OR gate 3d because the two-input AND gate 3b opens and two-input AND gate 3c closes owing to the clock switching signal J3 of the &#34;H&#34; level. 
     As a result, the I 2  C bus 21 starts its operation even when the single-chip microcomputer 500 is in the sleep mode, carrying out the series of operations associated with the address data reception such as generation of acknowledge bits. Then, having generated the final clock pulse (acknowledge clock pulse) of the address data, the I 2  C bus 21 supplies the multivibrator 25 with a multivibrator stop signal SB at time t2 as illustrated in FIG. 10(f), thereby halting the oscillation of the multivibrator 25. At this time t2, the SCL is placed at the &#34;L&#34; level as illustrated in FIG. 10(c), thereby holding the I 2  C bus 21. 
     At the same time t2, the I 2  C bus 21 generates the interrupt signal SD as illustrated in FIG. 10(i), which activates the oscillator to generate the system clock signal φ of the single-chip microcomputer 500, and releases the sleep mode. When the oscillator starts to generate the system clock signal φ at time t2, and its oscillation is stabilized at time t3 after an oscillation stabilized period has passed, the φ start signal is input to the reset input terminal of the latch 26 so that the clock switching signal J3 output from the Q output terminal of the latch 26 changes from the &#34;H&#34; to &#34;L&#34; level as illustrated in FIG. 10(a). 
     As a result, the two-input AND gate 3b of the clock switching circuit 3 closes, and two-input AND gate 3c opens so that the system clock signal φ is supplied to the I 2  C bus 21 through the two-input AND gate 3c and two-input OR gate 3d. Thus, the I 2  C bus 21 begins the normal operation mode based on the system clock signal φ. 
     According to the present embodiment 4, the SDA detector 24 can detects the falling edge of the SDA even in the stop mode, in which the I 2  C bus 21 is in the slave receiving mode, and the I 2  C bus 21 can carry out the series of operations associated with the address data reception in response to the alternative clock signal φMB generated by the multivibrator 25 instead of the halted system clock signal φ. This offers an advantage of saving power by an amount reduced by the single-chip microcomputer 500 which remains in the sleep mode while the I 2  C bus 21 carries out the series of operations associated with the address data reception.