Search

US-12627282-B2 - Microcontroller and control device

US12627282B2US 12627282 B2US12627282 B2US 12627282B2US-12627282-B2

Abstract

A control device coupled to an oscillator circuit and including a first output circuit, a synchronizer circuit, a hysteresis circuit, a stable circuit, and a second output circuit is provided. The first output circuit activates an oscillator circuit according to an activation signal so that the oscillator circuit generates an input clock. The synchronizer circuit synchronizes the activation signal to generate a synchronization signal. The synchronization signal is synchronized with the input clock. The hysteresis circuit directs the first output circuit to disable the oscillator circuit according to the synchronization signal. The stable circuit enables a transmission signal according to the input clock. When the transmission signal is enabled, the second output circuit uses the input clock as an output clock.

Inventors

  • Yung-Chi LAN

Assignees

  • NUVOTON TECHNOLOGY CORPORATION

Dates

Publication Date
20260512
Application Date
20241206
Priority Date
20231222

Claims (20)

  1. 1 . A control device coupled to an oscillator circuit, comprising: a first output circuit enabling a driving signal in response a first activation signal being at a first level, and disabling the driving signal in response to a first clear signal being enabled; a synchronizer circuit synchronizing the first activation signal to generate a synchronization signal, wherein the synchronization signal is synchronized with an input clock; a hysteresis circuit enabling the first clear signal in response to a level of the synchronization signal matching a first predetermined state, and enabling a second clear signal in response to the level of the synchronization signal matching a second predetermined state; a stable circuit enabling a transmission signal according to the input clock; and a second output circuit using the input clock as a first output clock in response to the transmission signal being enabled, and stopping the use of the input clock as the first output clock in response to the second clear signal being enabled, wherein: in response to the driving signal being enabled, the oscillator circuit provides the input clock, and in response to the driving signal being disabled, the oscillator circuit stops providing the input clock.
  2. 2 . The control device as claimed in claim 1 , wherein the synchronizer circuit comprises: a first D-type flip-flop comprising: a first input terminal receiving the first activation signal; a first output terminal providing a first output signal; and a first clock terminal receiving the input clock; a second D-type flip-flop comprising: a second input terminal receiving the first output signal; a second output terminal providing the synchronization signal; and a second clock terminal receiving a first inverted signal; a first inverter inverting the input clock to generate the first inverted signal; a first integrated clock gating cell determining whether to use the first inverted signal as a gating clock signal according to a control signal.
  3. 3 . The control device as claimed in claim 2 , wherein the hysteresis circuit comprises: a counter adjusting a counted value according to the gating clock signal; a first comparator determining whether the counted value has reached a first predetermined value, wherein in response to the counted value reaching the first predetermined value, the first comparator enables the first clear signal; a second comparator determining whether the counted value has reached a second predetermined value, wherein in response to the counted value reaching the second predetermined value, the second comparator enables the second clear signal, wherein the first predetermined value is higher than the second predetermined value.
  4. 4 . The control device as claimed in claim 3 , wherein in response to the first clear signal being enabled, the counted value is reset to an initial value.
  5. 5 . The control device as claimed in claim 2 , wherein the first output circuit comprises: a third D-type flip-flop comprising: a third input terminal receiving a second output signal; a third output terminal providing the driving signal; a third clock terminal receiving the gating clock signal; and a setting terminal receiving a third output signal; a second inverter inverting the first clear signal to generate a second inverted signal; and a first AND gate generating the second output signal according to the second inverted signal and the driving signal.
  6. 6 . The control device as claimed in claim 5 , wherein the first output circuit further comprises: a third inverter inverting the first activation signal to generate a third inverted signal; a delay element delaying the driving signal to generate a delayed signal; and a first OR gate generating the third output signal according to the third inverted signal and the delayed signal.
  7. 7 . The control device as claimed in claim 5 , wherein the second output circuit comprises: a fourth D-type flip-flop comprising: a fourth input terminal receiving a fourth output signal; a fourth output terminal providing a second activation signal; a fourth clock terminal receiving the gating clock signal; a fourth inverter inverting the second clear signal to generate a fourth inverted signal; a second AND gate generating a fifth output signal according to the transmission signal and the fourth inverted signal; a second OR gate generating a selection signal according to the transmission signal and the second clear signal; a multiplexer using the second activation signal or the fifth output signal as the fourth output signal according to the selection signal; and a second integrated clock gating cell determining whether to use the first inverted signal as the first output clock according to the second activation signal.
  8. 8 . The control device as claimed in claim 7 , wherein the second output circuit further comprises: a fifth D-type flip-flop comprising: a fifth input terminal receiving the second activation signal; a fifth output terminal providing a third activation signal; and an inverting clock terminal receiving the gating clock signal; and a third integrated clock gating cell determining whether to use the input clock as a second output clock according to the third activation signal, wherein the second output clock is opposite to the first output clock.
  9. 9 . The control device as claimed in claim 8 , wherein in response to the first activation signal being at a second level, the first and second output clocks are maintained at the second level.
  10. 10 . The control device as claimed in claim 9 , wherein: reset terminals of the first, second, third, fourth, and fifth D-type flip-flops receive a power-on reset signal, in response to the power-on reset signal being enabled, the first output signal, the synchronization signal, the driving signal, the second activation signal, and the third activation signal are at the second level.
  11. 11 . A microcontroller circuit comprising: an oscillator circuit providing an input clock in response to a driving signal being enabled, wherein in response to the driving signal being disabled, the oscillator circuit stops providing the input clock; and a control device coupled to the oscillator circuit and comprising: a first output circuit enabling the driving signal in response to a first activation signal being at a first level and disabling the driving signal in response to a first clear signal being enabled; a synchronizer circuit synchronizing the first activation signal to generate a synchronization signal, wherein the synchronization signal is synchronized with the input clock; a hysteresis circuit enabling the first clear signal in response to a level of the synchronization signal matching a first predetermined state, and enabling a second clear signal in response to the level of the synchronization signal matching a second predetermined state; a stable circuit enabling a transmission signal according to the input clock; a second output circuit using the input clock as a first output clock in response to the transmission signal being enabled, and stopping the use of the input clock as the first output clock in response to the second clear signal being enabled.
  12. 12 . The microcontroller circuit as claimed in claim 11 , further comprising: a first inverter inverting the input clock to generate a first inverted signal; and a first integrated clock gating cell using the first inverted signal as a gating clock signal in response to a control signal being at the first level, and setting the gating clock signal so that the gating clock is at a second level in response to the control signal being at the second level, wherein the first integrated clock gating cell provides the gating clock signal to the hysteresis circuit, the first output circuit, the stable circuit, and the second output circuit.
  13. 13 . The microcontroller circuit as claimed in claim 12 , wherein the hysteresis circuit comprises: a counter adjusting a counted value according to the gating clock signal; a first comparator determining whether the counted value has reached a first predetermined value, wherein in response to the counted value reaching the second predetermined value, the first comparator enables the first clear signal; a second comparator determining whether the counted value has reached a second predetermined value, wherein in response to the counted value reaching the second predetermined value, the second comparator enables the second clear signal, wherein the first predetermined value is higher than the second predetermined value.
  14. 14 . The microcontroller circuit as claimed in claim 13 , wherein the hysteresis circuit further comprises: an adder adding the counted value and a predetermined value to generate an adjustment value; a first multiplexer outputting the counted value or the adjustment value according to a third activation signal; a second multiplexer outputting an output of the first multiplexer or an intimal value to the counter according to a first selection signal; a first OR gate providing the first selection signal according to the first clear signal and the synchronization signal, wherein: in response to the second multiplexer outputting the output of the first multiplexer, the counter sets the counted value so that the counted value is equal to the output of the first multiplexer, in response to the second multiplexer outputting the initial value, the counter sets the counted value so that the counted value is equal to the initial value.
  15. 15 . The microcontroller circuit as claimed in claim 14 , wherein the synchronizer circuit comprises: a first D-type flip-flop comprising: a first input terminal receiving the first activation signal; a first output terminal providing a first output signal; and a first clock terminal receiving the input clock; and a second D-type flip-flop comprising: a second input terminal receiving the first output signal; a second output terminal providing the synchronization signal; and a second clock terminal receiving the first inverted signal.
  16. 16 . The microcontroller circuit as claimed in claim 14 , wherein the first output circuit comprises: a third D-type flip-flop comprising: a third input terminal receiving a second output signal; a third output terminal providing the driving signal; a third clock terminal receiving the gating clock signal; and a setting terminal receiving a third output signal; a second inverter inverting the first clear signal to generate a second inverted signal; and a first AND gate generating the second output signal according to the second inverted signal and the driving signal.
  17. 17 . The microcontroller circuit as claimed in claim 16 , wherein the first output circuit further comprises: a third inverter inverting the first activation signal to generate a third inverted signal; and a first OR gate generating the third output signal according to the third inverted signal and the driving signal.
  18. 18 . The microcontroller circuit as claimed in claim 17 , wherein the second output circuit comprises: a fourth inverter inverting the second clear signal to generate a fourth inverted signal; a second AND gate generating a fifth output signal according to the transmission signal and the fourth inverted signal; a second OR gate generating a second selection signal according to the transmission signal and the second clear signal; a third multiplexer outputting a second activation signal or the fifth output signal according to the second selection signal; and a fourth D-type flip-flop comprising: a fourth input terminal receiving an output of the third multiplexer; a fourth output terminal providing the second activation signal; a fourth clock terminal receiving the gating clock signal; and a second integrated clock gating cell determining whether to use the first inverted signal as the first output clock according to the second activation signal.
  19. 19 . The microcontroller circuit as claimed in claim 18 , wherein the second output circuit further comprises: a fifth D-type flip-flop comprising: a fifth input terminal receiving the second activation signal; a fifth output terminal providing a third activation signal; and an inverting clock terminal receiving the gating clock signal; and a third integrated clock gating cell determining whether to use the input clock as a second output clock according to the third activation signal, wherein the second output clock is opposite to the first output clock.
  20. 20 . The microcontroller circuit as claimed in claim 19 , wherein in response to the first activation signal being at a second level, the first and second output clocks are maintained at the second level.

Description

CROSS REFERENCE TO RELATED APPLICATIONS This application claims priority of Taiwan Patent Application No. 112150258, filed on Dec. 22, 2023, the entirety of which is incorporated by reference herein. BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a control device, and, in particular, to a control device that controls oscillator circuits. Description of the Related Art Digital circuits require a clock signal as a driving source, and the clock signal is usually generated by an analog circuit. When the analog circuit is first turned on, the clock signal provided by the analog circuit is not yet stable. If an unstable clock signal is directly provided to the digital circuit, it will cause the digital circuit to malfunction. Furthermore, the analog circuit usually starts to generate a clock signal according to a driving signal. When the driving signal has glitches or experiences noise interference, the analog circuit may be turned off so that it is unable to provide clock signals to the digital circuit. BRIEF SUMMARY OF THE INVENTION In accordance with an embodiment of the disclosure, a control device is coupled to an oscillator circuit and comprises a first output circuit, a synchronizer circuit, a hysteresis circuit, a stable circuit, and a second output circuit. The first output circuit enables a driving signal in response a first activation signal being at a first level, and disables the driving signal in response to a first clear signal being enabled. The synchronizer circuit synchronizes the first activation signal to generate a synchronization signal. The synchronization signal is synchronized with an input clock. The hysteresis circuit enables the first clear signal in response to the level of the synchronization signal matching a first predetermined state, and enables a second clear signal in response to the level of the synchronization signal matching a second predetermined state. The stable circuit enables a transmission signal according to the input clock. The second output circuit uses the input clock as a first output clock in response to the transmission signal being enabled, and stopping the use of the input clock as the first output clock in response to the second clear signal being enabled. In response to the driving signal being enabled, the oscillator circuit provides the input clock. In response to the driving signal being disabled, the oscillator circuit stops providing the input clock. In accordance with another embodiment of the disclosure, a microcontroller circuit comprises an oscillator circuit and a control device. The oscillator circuit provides an input clock in response to a driving signal being enabled. In response to the driving signal being disabled, the oscillator circuit stops providing the input clock. The control device is coupled to the oscillator circuit and comprises a first output circuit, a synchronizer circuit, a hysteresis circuit, a stable circuit, a second output circuit. The first output circuit enables the driving signal in response to a first activation signal being at a first level and disables the driving signal in response to a first clear signal being enabled. The synchronizer circuit synchronizes the first activation signal to generate a synchronization signal. The synchronization signal is synchronized with the input clock. The hysteresis circuit enables the first clear signal in response to the level of the synchronization signal matching a first predetermined state, and enables a second clear signal in response to the level of the synchronization signal matching a second predetermined state. The stable circuit enables a transmission signal according to the input clock. The second output circuit uses the input clock as a first output clock in response to the transmission signal being enabled, and stops using the input clock as the first output clock in response to the second clear signal being enabled. BRIEF DESCRIPTION OF THE DRAWINGS The present invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein: FIG. 1 is a schematic diagram of an exemplary embodiment of a microcontroller circuit according to various aspects of the present disclosure. FIG. 2 is a schematic diagram of an exemplary embodiment of a control device according to various aspects of the present disclosure. FIG. 3 is a schematic diagram of an exemplary embodiment of a synchronizer circuit, a hysteresis circuit, and an output circuit according to various aspects of the present disclosure. FIG. 4 is a schematic diagram of an exemplary embodiment of a stable circuit and an output circuit according to various aspects of the present disclosure. FIG. 5 is a waveform diagram of an exemplary embodiment of a microcontroller circuit when the activation signal is enabled. FIG. 6 is a waveform diagram of an exemplary embodiment of the microcontroller circuit when th