Single chip microcomputer having two kinds of timer functions

Abstract: A single chip microcomputer includes two kinds of timer circuits which receive a common clock signal. One of the timer circuits generates a first timer signal, and the other generates a second timer signal. When the first timer signal is being reset, the second timer signal is inactive.

Description: BACKGROUND OF THE INVENTION 1) Field of the Invention The present invention relates to a microcomputer having two kinds of timer functions incorporated into a single chip. 2) Description of the Related Art IBM TECHNICAL DISCLOSURE BULLETIN, vol. 34, no. 3, 1 August 1991, pages 350-351, XP000210612 "PROGRAMMABLE TIMERS" describes a mechanism consisting of two 16-bit timers that may be operated independently of each other or concatenated to form a 32 bit timer and providing for three different types of outputs from each timer. Each 16-bit timer consists of a 16-bit count register that begins its count at zero and counts up by one every four cycles and a 16-bit compare register with a comparator to determine when the compare register value is equal to the count register value. A single chip (or one-chip) microcomputer includes not only a central processing unit (CPU), but also a random access memory (RAM), a read-only memory (ROM), and other peripheral circuits which include an interrupt controller, a direct memory access (DMA) controller, a serial interface, and a timer, to thereby carry out various functions. On the other hand, for example, in a current control system for printheads, two kinds of timer outputs may be required. In this case, only when one of the timer outputs is being set, can the other be set and reset. In the prior art, since each single chip microcomputer has only one timer function, two single chip microcomputers are provided to generate the above-mentioned two kinds of timer outputs, thus increasing the cost. Also in this case, in order to maintain the above-mentioned relationship between the two timer outputs, one of the microcomputer has to generate interrupt signals and transmit them to the other, which creates a time lag in operation between the two microcomputers, i.e., between the two timer outputs. As a result, an accurate phase relationship between the two timer outputs can not be expected due to this timer lag, which will be explained in more detail. Also, another external timer circuit may be connected to a single chip microcomputer, thereby obtaining two kinds of timer functions. However, in this case also, since controling the external timer circuit by using the microcomputer is complex, an accurate phase relationship between the two timer outputs can not be expected, similar to the above-mentioned two microcomputer system. SUMMARY OF THE INVENTION It is, therefore, an object of the present invention to reduce the cost of a microcomputer system for generating two kinds of timer outputs. It is another object of the present invention to realize an accurate phase relationship between the two kinds of timer outputs. According to the present invention as defined in claim 1, two kinds of timer circuits are incorporated into a single chip microcomputer. That is, a first timer circuit is used for generating a first timer output, and a second timer circuit is used for generating a second timer output. When the first timer circuit is being reset, i.e., when the first timer output is being reset, the second timer circuit is disabled, so that the second timer output is inactive. Both the first and second timer circuits receive a common clock signal to thereby maintain an accurate phase relationship between the two timer outputs. BRIFE DESCRIPTION OF THE DRAWINGS The present invention will be more clearly understood from the description as set forth below, as compared with the prior art, with reference to the accompanying drawings, wherein: Fig. 1 is a block circuit diagram illustrating a prior art single chip microcomputer; Fig. 2 is a detailed block circuit diagram of the timer control circuit of Fig. 1; Figs. 3A, 3B, and 3C are timing diagrams showing the operation of the timer control circuit of Fig. 2; Figs. 4A and 4B are timing diagrams showing two kinds of timer outputs; Fig. 5 is a block circuit diagram illustrating a prior art microcomputer system for generating the timer outputs of Figs. 4A and 4B; Fig. 6 is a block circuit diagram illustrating an embodiment of the single chip microcomputer according to the present invention; Fig. 7 is a detailed block circuit diagram of the timer control circuit of Fig. 6; Figs. 8A through 8E are timing diagrams showing the operation of the timer control circuit of Fig. 7; Fig. 9 is a block circuit diagram of a modification of the timer control circuit of Fig. 7; Figs. 10A through 10F are timing diagrams showing the operation of the timer control circuit of Fig. 9; Fig. 11 is a block circuit diagram of another modification of the timer control circuit of Fig. 7; and Fig. 12 is a circuit diagram of a modification of the timer counter of Figs. 7, 9, and 11. DESCRIPTION OF THE PREFERRED EMBODIMENT Before the description of an embodiment of the present invention, prior art microcomputers will be explained with reference to Figs. 1 through 5. In Fig. 1, which illustrates a prior art single chip microcomputer, a single chip microcomputer 1 includes a CPU 11, an internal clock generating circuit 12, a timer control circuit 13, an internal bus 14, and the like. The CPU 11 includes a program counter (PC), a program status word (PSW), an arithmetic and logic unit (ALU), various registers, and the like, to carry out various instructions. Also, the CPU 11 controls the timer control circuit 13 via the internal bus 14. The internal clock generating circuit 12 generates various clock signals and transmits them to the CPU 11, the timer control circuit 13, and other peripheral circuits, to operate them. For example, the internal clock generating circuit 12 generates an operation clock and transmits it to the CPU 11. Also, the internal clock generating circuit 12 generates three clock signals having freqnencies fo, fo/8, and fo/16, respectively, where fo is the frequency of a system clock signal, and transmits them to the timer control circuit 13, thereby dynamically changing the frequency (period) of a timer output TOUT1 of the timer control circuit 13. Note that other external clock signals can be supplied via the input interfaces (not shown) to the timer control circuit 13. In Fig. 2, which is a detailed block circuit diagram of the timer control circuit 13 of Fig. 1, reference numeral 131 designates a control register for storing 2-bit processor mode (PRM) data, 1-bit clock enable (CE) data, and other control data for various portions of the timer control circuit 13. Such data is written into its corresponding areas via the internal bus 14. The processor mode data PRM is supplied to a decoder 132 which, in turn, decodes the processor mode data PRM to supply a 3-bit decoding signal to a clock selection circuit 133. As a result, the clock selection circuit 133 selects one of the clock signals fo, fo/8, and fo/16 and supplies it to a timer circuit TM1. The timer circuit TM1 includes a timer counter 134 for counting a time duration CNT1, a comparison register 135, a comparator circuit 136 for comparing the value (CNT1) of the timer counter 134 with the value (TA) of the comparison register 135, a comparison register 137, and a comparator circuit 138 for comparing the value (CNT1) of the timer counter 134 with the value (TB) of the comparison register 137. The values TA and TB of the comparison registers 135 and 137 are written by the CPU 11. When the clock enable data CE stored in the control register 131 is logic "1" to pass the selected clock signal by the clock selection circuit 133 through an AND cricuit 139, the timer counter 134 is incremented by + 1 by receiving each pulse of the selected clock signal. Also, when the clock enable signal CE stored in the control register 131 is switched from "0" (inactive state) to "1" (active state), the timer counter 134 is cleared due to the presence of an OR circuit 140. Further, when the comparator circuit 138 generates a coincidence signal indicating that the value (CNT1) of the timer counter 134 has reached the value (TB) of the comparison register 137, the timer counter 134 is also cleared due to the presence of the OR circuit 140. Also, the timer circuit TM1 includes an RS flip-flop 141 which is set by the coincidence signal of the comparator circuit 136 and is reset by the coincidence signal of the comparator circuit 138. The operation of the timer control circuit 13 of Fig. 2 will be explained with reference to Figs. 3A, 3B, and 3C. Before time to, the processor mode data PRM of the control register 131 and the values TA and TB (<TA) are set in advance in the comparison registers 135 and 137 by the CPU 11. Also, in this state, the timer output TOUT1 of the flip-flop 141 is indefinite (i.e., undecided), since it depends on the state of the flip-flop 141. Further, in this state, the value CNT1 of the timer counter 134 is suspended, since the clock signal does not pass through the AND circuit 139. At time to, when the clock enable data CE of the control register 131 is switched from "0" to "1" as shown in Fig. 3A, the value CNT1 of the timer counter 134 is cleared by the OR circuit 140, and the timer counter 134 begins counting the selected clock signal via the AND circuit 139, as shown in Fig.3B. Before time t 1 , since the value CNT1 of the timer counter 134 does reach the value TA of the comparison register 135 as shown in Fig.3B, the state of the flip-flop 141 is unchanged and remains in its previous state which is "0" or "1". At time t 1 , the value CNT1 of the value TA of the comparison register 135 is as shown in Fig.3B, so that the comparator circuit 136 generates a coincidence signal to set the flip-flop 141. Therefore, the timer output TOUT1 is determined to be "1", as shown in Fig. 3C. Before time t 2 , since the value CNT1 of the timer counter 134 does reach the value TB of the comparison register 137 as shown in Fig. 3B, the state of the flip-flop 141' is unchanged and remains in its previous state "1". At time t 2 , the value CNT1 of the timer counter 134 reaches the value TB of the comparison register 135 as shown in Fig. 3B, so that the comparator circuit 138 generates a coincidence signal to reset the flip-flop 141, Therefore, the timer output TOUT1 is switched from "1" to "0", as shown in Fig. 3C. Simultaneously, the value CNT1 of the timer counter 134 is cleared by the coincidence signal of the comparator circuit 138 via the OR circuit 140, as shown in Fig. 3B. At time t 2 , the value CNT1 of the timer counter 134 again reaches the value TA of the comparison register 135 as shown in Fig. 3B, so that the comparator circuit 136 generates a coincidence signal to set the flip-flop 141. Therefore, the timer output TOUT1 is switched from "0" to "1" as shown in Fig. 3C. The above-mentioned state is repeated. That is, as shown in Fig. 3C, a state having a time period corresponding to the value TA of the comparison register 135 where the time output TOUT1 is "0" and a state having a time period corresponding to the value (TB-TA) corresponding to the difference in value between the comparison registers 135 and 137 where the timer output TOUT1 is "1", are alternately repeated. Here, consider a system requiring two kinds of timer outputs (TOUT1 and TOUT2) as shown in Figs. 4A and 4B, which are required for a current control system for printheads. In this case, when the first timer output TOUT1 is "0", the second timer output TOUT2 is inactive, i. e., "0", while, when the first timer output TOUT1 is "1", the second timer output TOUT2 is active, i.e., the second timer output TOUT2 is switched from "0" to "1" and vice versa. In Fig. 5, which illustrates a prior art microcomputer system for realizing the two kinds of timer outputs TOUT1 and TOUT2 as shown in Fig. 5, two single chip microcomputers 1 and 2, each of which has the same configuration as that of Fig. 1, are provided. In this case, values TA and TB (<TA) are set in the comparison registers of the timer control circuit 13 of the microcomputer 1, and values TC and TD (<TC) are set in the comparison registers of the timer control circuit 23 of the microcomputer 2. In order to activate the second timer output TOUT2 only when the first timer output TOUT1 is "1", it is necessary for the CPU 21 of the microcomputer 2 to receive two kinds of interrupt signals from the timer control circuit 13 of the microcomputer 1. Note that a first interrupt signal occurs when the first timer output TOUT1 is switched from "0" to "1" (see: t 1 , t 3 , t 5 , · · · of Fig. 3C), and a second interrupt signal occurs when the first timer output TOUT1 is switched from "1" to "0" (see: t 2 , t 4 , t 6 , · · · of Fig. 3C). However, in the system of Fig. 5, the manufacturing cost is high, since two single chip microcomputers are required. Also, since the two microcomputers 1 and 2 use different clock signals so that a time lag occurs in operation between the two microcomputers 1 and 2, an accurate phase relationship between the timer output TOUT1 and TOUT2 cannot be expected. Further, when one of the timer control circuits 13 and 23 changes the selection of the clock signals, the other also has to change the selection of the clock signals to maintain the count rate of the timer counters at the same value. This involves complex control. Also, another external timer control circuit can only be added to the single chip microcomputer 1, instead of the second single chip microcomputer 2. However even in this case, when the internal timer control circuit changes the selection of the clock signals, the external timer control circuit also has to change the selection of the clock signals to maintain the count rate of the timer counters at the same value. This also involves complex control. In Fig. 6, which illustrates an embodiment of the present invention, only one single chip microcomputer 1 ' is provided for generating the two kinds of timer outputs TOUT1 and TOUT2 as shown in Figs. 4A and 4B. In Fig. 6, a timer control circuit 13' includes two timer circuits therein for generating the two timer outputs TOUT1 and TOUT2. Therefore, the system for generating the two kinds of time outputs TOUT1 and TOUT2 is decreased in size to thereby reduce the cost. Also, the timer circuits receive the same clock signal, so that no time lag occurs in operation between the timer circuits. In Fig. 7, which is a detailed block circuit diagram of the timer control circuit 13' of Fig. 6, a timer circuit TM2 is added to the elements of the timer control circuit 13 of Fig. 2. The timer circuit TM2 has a similar configuration to the timer circuit TM1. That is, the timer circuit TM2 includes a timer counter 134' for counting a time duration CNT2, a comparison register 135' , a comparator circuit 136' for comparing the value (CNT2) of the timer counter 134 ' with the value (TC) of the comparison register 135' , a comparison register 137' , and a comparator circuit 138' for comparing the value (CNT2) of the timer counter 134' with the value (TD) of the comparison register 137 ' . The values TC and TD of the comparison registers 135' and 137 ' are also written by the CPU 11. The timer circuit TM2 further includes an AND circuit 142 which has two inputs connected to the outputs of the flip-flops 141 and 141 ' . Therefore, when the timer output TOUT1 is "0", the AND circuit 142 is disabled so that the timer output TOUT2 is inactive ("0"), while, when the timer output TOUT1 is "1", the AND circuit 142 is enabled so that the timer output TOUT2 is active (i.e., the timer output TOUT2 is switched from "0" to "1" or vice versa). The operation of the timer control circuit 13' of Fig. 7 will be explained with reference to Figs. 8A, 8B, 8C, 8D, and 8E. Before time to, the processor mode data PRM of the control register 131 and the values TA and TB (<TA) are set in advance in the comparison registers 135 and 137 by the CPU 11, and, in addition, the values TC and TD (<TC) are set in advance in the comparison registers 135 ' and 137' by the CPU 11. Also, in this state, the timer output TOUT1 of the flip-flop 141 and the timer output TOUT2 of the flip-flop 141' are indefinite (i.e., undecided), since they depend on the state of the flip-flops 141 and 141' , respectively. Further, in this state, the values CNT1 and CNT2 of the timer counters 134 and 134' are suspended, since the clock signal does not pass through the AND circuits 139 and 139' . At time to, when the clock enable data CE of the control register 131 is switched from "0" to "1" as shown in Fig. 8A, the value CNT1 of the timer counter 134 is cleared by the OR circuit 140, and the timer counter 134 initiates to count the selected clock signal via the AND circuit 139, as shown in Fig. 8B. At this time, in Fig. 8D, although the value CNT2 of the time counter 134' is 0, it is actually not always 0, and accordingly, the timer output TOUT2 is undecided as shown in Fig. 8E. Before time t 1 , since the value CNT1 of the timer counter 134 does reach the value TA of the comparison register 135 as shown in Fig. 8B, the state of the flip-flop 141 is unchanged and remains in its previous state which is "0" or "1". At time t 1 , the value CNT1 of the timer counter 134 reaches the value TA of the comparison register 135 as shown in Fig. 8B, so that the comparator circuit 136 generates a coincidence signal to set the flip-flop 141. Therefore, the timer output TOUT1 is determined to be "1", as shown in Fig. 8C. Simultaneously, if the timer output TOUT1 is switched from "0" to "1", the value CNT2 of the timer counter 134' is cleared by the OR circuit 140' , and the timer counter 134' begins counting the selected clock signal via the AND circuit 139' , as shown in Fig. 8D. At time t 1 ' , the value CNT2 of the timer counter 134' reaches the value TC of the comparison register 135 ' as shown in Fig. 8D, so that the comparator circuit 136 ' generates a coincidence signal to set the flip-flop 141' . Therefore, the timer output TOUT2 is determined to be "1", as shown in Fig. 8E. Before time t 2 ' , since the value CNT2 of the timer counter 134' does reach the value TD of the comparison register 137' as shown in Fig.8D, the state of the flip-flop 141' is unchanged and remains in its previous state "1". At time t 2 ' , the value CNT2 of the timer counter 134' reaches the value TD of the comparison register 135 ' as shown in Fig. 8D, so that the comparator circuit 138' generates a coincidence signal to reset the flip-flop 141' . Therefore, the timer output TOUT2 is switched from "1" to "0", as shown in Fig. 8E. Simultaneously, the value CNT2 of the timer counter 134' is cleared by the coincidence signal of the comparator circuit 138' via the OR circuit 140' , as shown in Fig. 8D. At time t 3 ' , the same operation that occurred at time t 1 ' is carried out, and at time t 4 ' , the same operation that occurred at time t 2 ' is carried out. At time t 2 , the value CNT1 of the timer counter 134 again reaches the value TA of the comparison register 135 as shown in Fig. 8B, so that the comparator circuit 136 generates a coincidence signal to set the flip-flop 141. Therefore, the timer output TOUT1 is switched from "0" to "1", as shown in Fig. 8C. Simultaneously, the value CNT2 of the timer counter 134' is cleared by the OR circuit 140' as shown in Fig. 8D. However, the time counter 134 ' does not begin counting the selected clock signal as shown in Fig. 8D, since the AND circuit 139' is disabled by the state "0" of the flip-flop 141. The above-mentioned state is repeated. That is, as shown in Fig. 8C, a state having a time period corresponding to the value TA of the comparison register 135 where the timer output TOUT1 is "0" and a state having a time period corresponding to the value (TB-TA) corresponding to the difference in value between the comparison registers 135 and 137 where the timer output TOUT1 is "1", are alternately repeated. In addition, when the timer output TOUT1 is active ("1"), a state having a time period corresponding to the value TC of the comparison register 135' where the timer output TOUT2 is "0" and a state having a time period corresponding to the value (TD-TC) corresponding to the difference in value between the comparison registers 135' and 137' where the timer output TOUT2 is "1", are alternately repeated. In Fig. 9, which is a modification of the timer control circuit of Fig. 7, the control register 131 of Fig. 7 is modified to store another clock enable data CE ' . Instead of the timer output TOUT1 of the flip-flop 141, the clock enable data CE' is supplied via the AND circuit 139 ' and the OR circuit 140' to the timer counter 134' . Thus, the operation of the timer circuit TM2 is independent of that of the timer circuit TM1, except that the state "0" of the flip-flop 141 (i.e., the timer output TOUT1 (="0")) disables the timer circuit TM2. The operation of the timer control circuit 13" of Fig. 9 will be explained with reference to Figs. 10A, 10B, 10C, 10D, 10E, and 10F. Before time to, the processor mode data PRM of the control register 131 and the values TA and TB (<TA) are set in advance in the comparison registers 135 and 137 by the CPU 11, and, in addition, the values TC and TD (<TC) are set in advance in the comparison registers 135' and 137' by the CPU 11. Also, in this state, the timer output TOUT1 of the flip-flop 141 and the timer output TOUT2 of the flip-flop 141' are indefinite (i.e., undecided), since they depend on the state of the flip-flops 141 and 141' , respectively. Further, in this state, the values CNT1 and CNT2 of the timer counters 134 and 134' are suspended, since the clock signal does not pass through the AND circuits 139 and 139' . At time to, when the clock enable data CE of the control register 131 is switched from "0" to "1" as shown in Fig.10A, the value CNT1 of the timer counter 134 is cleared by the OR circuit 140, and the timer counter 134 begins counting the selected clock signal via the AND circuit 139, as shown in Fig. 8B. After time t 0 , as shown in Figs. 10A, 10B, and 10C, the timer circuit TM1 operates in the same way as in Figs. 8A and 8B, and the timer output TOUT1 is obtained in the same way as that shown in Fig. 8C is obtained. At time t 1 ' , the value CNT2 of the timer counter 134' reaches the value TC of the comparison register 135' as shown in Fig. 10E, so that the comparator circuit 136' generates a coincidence signal to set the flip-flop 141' . Therefore, the timer output TOUT2 is determined to be "1", as shown in Fig. 10F. At time t 2 ' , the value CNT2 of the timer counter 134' reaches the value TD of the comparison register 135' as shown in Fig. 10E, so that the comparator circuit 138' generates a coincidence signal to reset the flip-flop 141 ' . Therefore, the timer output TOUT2 is switched from "1" to "0", as shown in Fig.10F. Simultaneously, the value CNT2 of the timer counter 134' is cleared by the coincidence signal of the comparator circuit 138' via the OR circuit 140' , as shown in Fig. 10E. At time t 3 ' , the same operation that occurred at time t 1 ' is carried out, and at time t 4 ' , the same operation that occurred at time t 2 ' is carried out. The above-mentioned state is that repeated. That is, as shown in Fig. 10C, a state having a time period corresponding to the value TA of the comparison register 135 where the timer output TOUT1 is "0" and a state having a time period corresponding to the value (TB-TA) corresponding to the difference in value between the comparison registers 135 and 137 where the timer output TOUT1 is "1", are alternately repeated. In addition, when the timer output TOUT1 is active ("1"), a state having a time period corresponding to the value TC of the comparison register 135' where the timer output TOUT2 is "0" and a state having a time period corresponding to the value (TD-TC) corresponding to the difference in value between the comparison registers 135' and 137' where the timer output TOUT2 is "1", are alternately repeated. In Fig. 9, with respect to the phase relationship, the timer output TOUT1 is independent of the timer output TOUT2. In other words, the phase relationship between the two timer outputs TOUT1 and TOUT2 can be adjusted by setting the clock enable data CE and CE' in the control register 131 with the aid of the CPU 11. In Fig. 11, which is another modification of the timer control circuit of Fig. 7 or 9, the timer control circuit 13' of Fig. 7 and the timer control circuit 13" of Fig. 9 are combined into a timer control circuit 13"'. That is, the control register 131 of Fig. 9 is modified to store 1-bit clock selection (CSL) data which is supplied to a selection circuit 143. Also, this clock selection data CSL is written by the CPU 11. The selection circuit 143 is interposed between the timer circuits TM1 and TM2. When the clock selection data CSL is "0", the selection circuit 143 remains in a state as indicated in Fig. 11, and accordingly, the clock enable data CE' is supplied via the AND circuit 139' and the OR circuit 140' to the timer counter 134' . Therefore, in this case, the timer control circuit 13"' of Fig. 11 operates as the timer control circuit 13" of Fig. 9. Conversely, when the clock selection data CSL is "1", the selection circuit 143 remains in an opposite state to the state as indicated in Fig. 11, and accordingly, the timer output TOUT1 is supplied via the AND circuit 139' and the OR circuit 140' to the timer counter 134' . Therefore, in this case, the timer control circuit 13"' of Fig. 11 operates as the timer control circuit 13' of Fig. 7. Thus, the microcomputer including the timer control circuit 13"' of Fig. 11 enhances the flexibility of the circuit as compared with the microcomputer having the timer control circuit 13' of Fig. 7 or the timer control circuit 13" of Fig. 9. Although the timer counter 134(134' ) is formed by a series of binary counters having clear terminals as illustrated in Fig. 7, 9, or 11, the timer counter 134(134' can be formed by a register 1201 which has a clear terminal and a + 1 incrementor 1202 which increments the content of the register 1201 by + 1 when receiving a clock signal via the AND circuit 139(139' ), as illustrated in Fig. 12. As explained hereinbefore, according to the present invention, since use is made of only one single chip microcomputer for generating two kinds of timer outputs, the manufacturing cost thereof can be reduced. Also, since two timer functions incorporated into the single chip microcomputer use the same clock signal, no time lag in operation between the two timer functions exists, and as a result, an accurate phase relationship between the two timer functions can be obtained.

Claims: A single chip microcomputer (1) comprising: a clock signal generating means (12) for generating at least one clock signal having a predetermined frequency; a first counting means (134), operatively connected to said clock signal generating means (12), for counting said clock signal, said first counting means (134) being cleared when a second predetermined value (TB) is reached; a first timer signal generating means (135-138), connected to said first counting means, for generating at a first output a first timer signal (TOUT1) which is set when the value of said first counting means reaches a first predetermined value (TA) and is reset when the value of said first counting means reaches said second predetermined value (TB); a second counting means (134'), operatively connected to said clock signal generating means (12), for counting said clock signal, said second counting means (134') being cleared when a fourth predetermined value (TD) is reached; and a second timer signal generating means (135'-138'), connected to said second counting means and said first output of said first timer signal generating means, for generating a second timer signal (TOUT 2) which is set when the value of said second counting means reaches a third predetermined value (TC) and is reset when the value of said second counting means reaches said fourth predetermined value (TD), said second timer signal being inactive when said first timer signal is being reset. A single chip microcomputer as set forth in claim 1, wherein said second counting means (134') is connected to said first timer signal generating means (135-138), to disable said second counting means when said first timer signal is being reset. A single chip microcomputer as set forth in claim 2, further comprising a selection means (143), connected between said first timer signal generating means (135-138) and said second counting means (134'), for selectively connecting said second counting means (134') to said first timer signal generating means (135-138). A single chip microcomputer as set forth in claim 3, further comprising a selection data storing means, connected to said selection means, for storing selection data, said selection means selectively connecting said second counting means to said first tiner signal generating means in accordance with the selection data stored in said selection data storing means. A single chip microcomputer as set forth in claim 1, further comprising a first enabling means, connected between said clock signal generating means and said first counting means, for enabling and disabling said first counting means. A single chip microcomputer as set forth in claim 5, further comprising a first clock enable data storing means, connected to said first enabling / disabling means, for storing first clock enable data, said first enabling / disabling means enabling and disabling said first counting means in accordance with said first clock enable data. A single chip microcomputer as set forth in claim 6, wherein said first counting means is cleared when the first clock enable data stored in said first clock data storing means is switched from an inactive state to an active state. A single chip microcomputer as set forth in claim 1, further comprising a second enabling / disabling means, connected between said clock signal generating means and said second counting means, for enabling and disabling said second counting means. A single chip microcomputer as set forth in claim 8, further comprising a second clock enable data storing means, connected to said second enabling / disabling means, for storing second clock enable data, said second enabling / disabling means enabling and disabling said second counting means in accordance with said second clock enable data. A single chip microcomputer as set forth in claim 9, wherein said second counting means is cleared when the second clock enable data stored in said second clock data storing means is switched from an inactive state to an active state. A single chip microcomputer as set forth in claim 1, wherein said first timer signal generating means comprises: a first comparison register for storing said first predetermined value; a first comparator circuit, connected to said first comparison circuit and to said first timer counting means, for generating a coincidence signal when the value of said first timer counting means reaches the first predetermined value stored in said first comparison register; a second comparison register for storing said second predetermined value; a second comparator circuit, connected to said second comparison circuit and to said first timer counting means, for generating a coincidence signal when the value of said first timer counting means reaches the second predetermined value stored in said second comparison register; and a first hold circuit, connected to said first and second comparator circuits, for generating said first timer signal, said first hold circuit being set by the coincidence signal of said first comparator circuit and reset by the coincidonce signal of said second comparator circuit. A single chip microcomputer as set forth in claim 11, wherein said first counting means is cleared by the coincidence signal of said second comparator circuit. A single chip microcomputer as set forth in claim 1, wherein said second timer signal generating means comprises: a third comparison register for storing said third predetermined value; a third comparator circuit, connected to said third comparison circuit and to said second timer counting means, for generating a coincidence signal when the value of said second timer counting means reaches the third predetermined value stored in said third comparison register; a fourth comparison register for storing said fourth predetermined value; a fourth comparator circuit, connected to said fourth comparison circuit and to said second timer counting means, for generating a coincidence signal when the value of said second timer counting means reaches the fourth predetermined value stored in the fourth comparison register; a second hold circuit, connected to said third and fourth comparator circuits, for generating said second timer signal, said second hold circuit being set by the coincidence signal of said first comparator circuit and reset by the coincidence signal of said second comparator circuit; and a disabling circuit, connected to said second hold circuit and said first timer signal generating means, for disabling said second hold circuit when the first timer signal of said first timer signal generating means is being reset, thereby said second timer signal being inactive. A single chip microcomputer as set forth in claim 13, wherein said second counting means is cleared by the coincidence signal of said fourth comparator circuit. A single chip microcomputer as set forth in claim 1, further comprising a mode bit storing means, connected to said clock signal generating means, for storing mode bit data, said clock signal generating means selectively generating said clock signal which has a frequency dependent upon said mode bit data. A single chip microcomputer as set forth in claim 1, wherein each of said first and second counting means comprises: a register; and an incremental circuit, connected to said register, for incrementing the value of said register by + 1 when receiving said clock signal.

Inventors: SASAKI YUKO, SASAKI, YUKO, SASAKI, YUKO, NEC IC MICROCOMP.SYSTEM, LTD.
Applicants: NEC ELECTRONICS CORP, NEC ELECTRONICS CORPORATION
Application year: 1992
Main classification: G06F1
IPC codes: G06F1, G06F15