CN104834581B - A kind of failure of oscillation observation circuit of crystal oscillator - Google Patents
A kind of failure of oscillation observation circuit of crystal oscillator Download PDFInfo
- Publication number
- CN104834581B CN104834581B CN201510236134.8A CN201510236134A CN104834581B CN 104834581 B CN104834581 B CN 104834581B CN 201510236134 A CN201510236134 A CN 201510236134A CN 104834581 B CN104834581 B CN 104834581B
- Authority
- CN
- China
- Prior art keywords
- failure
- oscillation
- crystal oscillator
- clock
- observation circuit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
Disclosed herein is a kind of design method of the failure of oscillation observation circuit of crystal oscillator, after the control of the start and stop condition of observation circuit, observation circuit including oscillator, the blocking of oscillator to after the processing of system clock, the blocking of oscillator to the clock failure signal that processing sends out interrupt signal, observation circuit is sent out.Whether this monitoring circuit monitors crystal oscillator works normally, when failure of oscillation failure occurs in crystal oscillator, the corresponding clock of chip is switched to standby clock, and interrupt signal is sent out to processor, observation circuit sends out clock failure signal simultaneously, handles and uses for other special events.This observation circuit can be controlled whether to open by software, using flexible, take full advantage of the clock of piece internal oscillator output, have the characteristics that switching clock is fast;Meanwhile this observation circuit sends out different failure of oscillation signals for different modules, improves the precision controlled modules.
Description
Technical field
A kind of design method of the failure of oscillation observation circuit of crystal oscillator is related to Design of Digital Circuit in integrated circuit, belongs to
In microelectric technique and application field.
Background technology
Oscillator can be divided into RC oscillators, LC oscillators and crystal oscillator, in the chips it is common have RC oscillators and
Crystal oscillator.RC oscillators performance is stablized, and is generally not in failure of oscillation failure, but accuracy is low;Crystal oscillator is accurate
Degree is high, but performance is unstable, it may appear that failure of oscillation failure.Generally in integrated circuit design, crystal oscillator is used as shaking outside piece
Device is swung, RC oscillators are used as piece internal oscillator, and software can be selected using the RC oscillations in the crystal oscillator or piece outside piece
Device.Since crystal oscillator performance is unstable, it may appear that failure of oscillation failure, in order to enable the chip to failure of oscillation occur in crystal oscillator
It can still be worked normally after failure, need to design a failure of oscillation observation circuit in the chip, whether monitoring crystal oscillator works
Normally, if crystal oscillator is used, there is failure of oscillation phenomenon in crystal oscillator, and failure of oscillation observation circuit can send out failure of oscillation letter
Number, clock is then automatically switched into the clock that RC oscillators export in piece.
Circuit designed by this paper mainly monitors the failure of oscillation failure of crystal oscillation and failure of oscillation failure occurs in crystal oscillator
When processing to clock.
Invention content
A kind of design method of the failure of oscillation observation circuit of crystal oscillator, the monitoring method including oscillator, failure of oscillation monitoring
The start and stop condition of circuit controls, believes after the blocking of oscillator sending out interruption to processing after the processing of system clock, the blocking of oscillator
Number and the clock failure signal that sends out of failure of oscillation observation circuit.
Preferred failure of oscillation observation circuit, it is characterised in that using in high-frequency generator OSC1 in the piece in piece and piece during low frequency
Clock OSC2 monitors whether crystal oscillator XO works normally, when the frequency of oscillator OSC1 is higher than OSC2 and crystal oscillator XO
2 times of the sum of clock frequency.
In failure of oscillation observation circuit, the clock exported using high-frequency generator OSC1 in piece is to low-frequency oscillator OSC2 in piece
It is sampled with the clock of crystal oscillator XO, as oscillator OSC2 and crystal oscillator XO normal oscillations, obtains saltus step
Clock edge.One register is set in failure of oscillation observation circuit, and register is set as by the rising edge of the clock of oscillator OSC2
Low level, the clock falling edge of crystal oscillator XO will be posted
Storage is set as high level, in the value of the clock falling edge monitoring register of OSC2, if register is high electricity at this time
It puts down, then crystal oscillator normal operation, if register is low level at this time, crystal oscillator stopped oscillation.
The start-up and shut-down control of preferred failure of oscillation observation circuit, it is characterised in that can opening for failure of oscillation observation circuit be controlled by software
Stop.Only after software activation failure of oscillation observation circuit and crystal oscillator output clock stable, failure of oscillation observation circuit just starts
Whether working properly monitor crystal oscillator, software control increases the flexibility that failure of oscillation observation circuit uses, without using crystal
During oscillator, failure of oscillation observation circuit can be closed, power consumption can be reduced.
Processing after preferred crystal oscillator XO failure of oscillations to system clock, it is characterised in that when crystal oscillator XO stops
After oscillation, the crystal oscillator XO clocks provided are quickly switched into oscillator OSC1 or oscillator OSC2 by clock switchover module
The clock of output.
The interrupt requests sent out after preferred crystal oscillator failure of oscillation to processor, it is characterised in that:When failure of oscillation signal becomes
Application is interrupted to generate CPU after high level, CPU carries out corresponding interrupt processing.
Failure of oscillation observation circuit sends out clock failure event, which can be used for the processing of special event.Than
Such as in some contain the chip of PWM module, PWM can be avoided to be in using this clock turkey as the brake signal of PWM
Mix and cause to burn out other devices.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or it will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments described in application, for those of ordinary skill in the art, without creative efforts,
It can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the clock security system block diagram in the specific embodiment of the invention;
Fig. 2 is the crystal oscillator failure of oscillation observation circuit structure chart in the specific embodiment of the invention;
Fig. 3 is that the crystal oscillator in the specific embodiment of the invention generates the circuit structure for interrupting application when stopping oscillation
Figure;
Fig. 4 is the circuit knot that clock failure signal is generated when the crystal oscillator in the specific embodiment of the invention stops oscillation
Composition;
Specific embodiment
The clock accuracy of crystal oscillator output is high, can be that chip 200 provides high-precision clock, but crystal shakes
It is unstable to swing device performance, it may appear that failure of oscillation failure, so the failure of oscillation for increasing crystal oscillator is needed to monitor when chip 200 designs
Circuit, when failure of oscillation failure occurs in crystal oscillator, failure of oscillation observation circuit sends out failure of oscillation signal, and clock is switched to by chip 200
The clock of standby oscillator output, such chip 200 can continue to work normally.
The failure of oscillation observation circuit of crystal oscillator and corresponding clock processing module may be collectively referred to as clock security system,
As shown in Figure 1.Clock security system includes crystal oscillator XO100, the failure of oscillation observation circuit 304 of crystal oscillator, at interruption
Manage module 301, other special event processing modules 305, clock switchover module 303, in piece in high-frequency generator OSC1302 and piece
Low-frequency oscillator OSC2306.Entire clock security system completes the processing of crystal oscillator failure of oscillation failure jointly.
Failure of oscillation observation circuit is as shown in Fig. 2, circuit is made of three parts:Clock sets electricity along detection circuit 401, register
Road 402 and failure of oscillation signal generating circuit 403.Wherein clock includes in piece inner sheet along detection circuit on low-frequency oscillator OSC2 clocks
It rises along failure of oscillation observation circuit 501 and crystal oscillator XO clock falling edge failure of oscillations observation circuit 502.It is set in failure of oscillation observation circuit
A register R503 is put, the clock of OSC2 clocks and crystal oscillator XO is adopted using the oscillator OSC1 clocks exported
Sample, obtains the hopping edge of crystal oscillator XO and oscillator OSC2 clocks, and the rising edge of oscillator OSC2 clocks sets register R
Low level is set to, register R is set as high level by the clock falling edge of crystal oscillator XO.403 generate letter for failure of oscillation signal
Number, the value of register R503 is monitored in the low-frequency oscillator OSC2 clock low half periods in piece inner sheet, if register R at this time
For low level, then crystal oscillator normal operation, if register R is high level at this time, crystal oscillator, which stopped, to shake
It swings, if the failure of oscillation observation circuit of software activation at this time, generates the failure of oscillation signal of crystal oscillator XO.
In order to more easily control the start and stop of failure of oscillation observation circuit, software switch is increased, if being deposited by software configuration
Device closes failure of oscillation observation circuit, then failure of oscillation observation circuit does not work, and no matter crystal oscillator is either with or without failure of oscillation, failure of oscillation monitoring electricity
Road will not all send out failure of oscillation signal.
If the output clock of crystal oscillator is used as clock source in chip 200, when crystal oscillator breaks down
During failure of oscillation, the clock of modules stops oscillation in chip 200, corresponding in order to make using the module from service of this clock
Module can resume work automatically, the clock that failure of oscillation observation circuit is automatically exported the clock source of corresponding module by crystal oscillator XO
Switch to the clock of oscillator OSC1 or OC2 output.
When crystal oscillator XO failure of oscillations, clock switching the specific steps are:
1. failure of oscillation signal is set to significant level by failure of oscillation observation circuit;
2. the crystal oscillator XO clocks exported are switched to after clock switch circuit detects effective failure of oscillation signal
The clock of oscillator OSC1 or OSC2 output;
3. after completing clock switching, clock source selection register is revised as oscillator OSC1 or OSC2 output clock by CPU
Option, prevent after failure of oscillation invalidating signal by clock switching crystal oscillator XO clock;
4. failure of oscillation signal is set to inactive level after the completion of clock switching, system is used for standby clock at this time.
When crystal oscillator failure of oscillation, failure of oscillation observation circuit also sends out interrupt requests, the production of failure of oscillation observation circuit to processor
The circuit of raw interrupt requests is as shown in figure 3, including the synchronization of failure of oscillation signal and rising edge detection circuit 601 and interruption application generation electricity
The step of road 602, failure of oscillation observation circuit sends interrupt requests, is as follows:
1. after crystal oscillator XO stops oscillation, failure of oscillation signal is set to significant level by failure of oscillation observation circuit;
2. after system clock completes switching, failure of oscillation signal is synchronized to cpu clock by cpu clock to failure of oscillation signal sampling
Domain 601;
3. the failure of oscillation signal in CPU clock domain is synchronized 601;
4. after synchronizing, interrupt signal is set as significant level by the rising edge of failure of oscillation signal in CPU clock domain, to
CPU sends out interruption application 602;
5. interruption is set as inactive level after CPU completion interrupt processings.If crystal oscillator is used in chip 200
Clock is exported as clock source, when crystal oscillator occurs
During failure failure of oscillation, the clock of corresponding module stops oscillation in chip 200, and failure of oscillation observation circuit sends out clock mistake
Event is lost, which can be used for the processing of special event, such as in some contain the chip 200 of PWM module, can be with
Using this clock turkey as the brake signal of PWM, the output of PWM module is set as preset value or reset
Value, the circuit that failure of oscillation observation circuit generates clock failure event are as shown in Figure 4.
Failure of oscillation observation circuit to PWM module export brake signal the step of be:
1. after stuck fault occurs in crystal oscillator, failure of oscillation signal is set as significant level 701 by failure of oscillation observation circuit,
Meanwhile failure of oscillation signal is sent to PWM module as brake signal by failure of oscillation observation circuit;
2. after clock completes switching, failure of oscillation signal is synchronized to CPU clock domain by failure of oscillation observation circuit, is obtained
Failure of oscillation signal 702,703,703 in CPU clock domain, meanwhile, failure of oscillation observation circuit is by the failure of oscillation in CPU clock domain
Signal is sent to PWM module as brake signal;
3. failure of oscillation signal of the failure of oscillation observation circuit in CPU clock domain generates interrupt signal 705, monitoring electricity
Interrupt signal is sent to PWM module as brake signal by road;
4. treating that CPU completes interrupt processing, interrupt signal is set in vain, then brake signal stops, and PWM module is according to software
Setting is restored to normal mode of operation.
It can be seen that after crystal oscillator stops oscillation, failure of oscillation observation circuit sends brake letter to PWM module immediately
Number, PWM module is made to be in braking state, during system clock source switching, interrupting generation and interrupt processing, PWM module one
Directly in braking state, after CPU completes interrupt processing, PWM is just restored to normal working condition.
The preferred embodiment of the present invention has shown and described in above description, but as previously described, it should be understood that the present invention is not
Form disclosed herein is confined to, should not be construed as the discharge to other embodiment, and can be used for various other combinations, repair
Change and environment, and can in the scope of the invention is set forth herein, by the above teachings or related fields of technology or knowledge into
Row change.And changes and modifications made by those skilled in the art do not depart from the spirit and scope of the present invention, then it all should be in the present invention
In the protection domain of appended claims..
Claims (5)
1. a kind of failure of oscillation monitoring method of crystal oscillator, it is characterised in that:
Failure of oscillation observation circuit based on crystal oscillator XO, the failure of oscillation observation circuit of the crystal oscillator XO are used for start and stop condition
To sending out interruption letter to processor after the processing of system clock, crystal oscillator XO failure of oscillations after control, crystal oscillator XO failure of oscillations
Number and the clock failure event signal that sends out of failure of oscillation observation circuit;
Monitor whether crystal oscillator XO works normally using low-frequency oscillator OSC2 in high-frequency generator OSC1 in piece and piece,
The frequency of high-frequency generator OSC1 is higher than the 2 of the sum of low-frequency oscillator OSC2 in piece and crystal oscillator XO clock frequencies in piece
Times,
The clock exported using high-frequency generator OSC1 in piece is to the clock of low-frequency oscillator OSC2 and crystal oscillator XO in piece
It is sampled, as low-frequency oscillator OSC2 in piece and crystal oscillator XO normal oscillations, the clock edge of saltus step is obtained, in failure of oscillation
One register is set in observation circuit, and register is set as low electricity by the rising edge clock of low-frequency oscillator OSC2 in piece
It is flat, register is set as high level in the clock falling edge of crystal oscillator XO, the clock of low-frequency oscillator OSC2 in piece
Failing edge monitor register value, if at this time register be high level, crystal oscillator XO normal operations, if register at this time
For low level, then crystal oscillator XO stopped oscillation.
2. the failure of oscillation monitoring method of crystal oscillator as described in claim 1, it is characterised in that:By software control failure of oscillation monitoring
After the start and stop of circuit, only software activation failure of oscillation observation circuit, failure of oscillation observation circuit just start to monitor crystal oscillator XO is
It is no working properly;During without using crystal oscillator XO, the failure of oscillation observation circuit is closed.
3. the failure of oscillation monitoring method of crystal oscillator as described in claim 1, which is characterized in that when crystal oscillator XO stops
After oscillation, the crystal oscillator XO clocks provided are quickly switched into high-frequency generator OSC1 in piece by clock switchover module
Or the clock that low-frequency oscillator OSC2 is exported in piece.
4. the failure of oscillation monitoring method of crystal oscillator as described in claim 1, it is characterised in that:When failure of oscillation signal becomes high electricity
CPU is generated after flat and interrupts application, CPU carries out corresponding interrupt processing.
5. the failure of oscillation monitoring method of crystal oscillator as described in claim 1, it is characterised in that:Failure of oscillation observation circuit is to outgoing
Go out clock failure event signal, which is used for the processing of special event, is included in the core containing PWM module
In piece, using this clock turkey signal as the brake signal of PWM, PWM is avoided to tanglewrack and causes to burn out other
Device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510236134.8A CN104834581B (en) | 2015-05-11 | 2015-05-11 | A kind of failure of oscillation observation circuit of crystal oscillator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510236134.8A CN104834581B (en) | 2015-05-11 | 2015-05-11 | A kind of failure of oscillation observation circuit of crystal oscillator |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104834581A CN104834581A (en) | 2015-08-12 |
CN104834581B true CN104834581B (en) | 2018-07-06 |
Family
ID=53812487
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510236134.8A Active CN104834581B (en) | 2015-05-11 | 2015-05-11 | A kind of failure of oscillation observation circuit of crystal oscillator |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104834581B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105320211B (en) * | 2015-11-06 | 2022-06-03 | 北京智芯微电子科技有限公司 | Burr-free switching clock management circuit considering clock oscillation stop condition |
CN106066817B (en) * | 2016-05-30 | 2023-04-07 | 珠海市一微半导体有限公司 | Clock monitoring circuit and method thereof |
CN108089631B (en) * | 2017-12-11 | 2023-10-27 | 深圳市博巨兴微电子科技有限公司 | Clock detection circuit for micro-controller chip |
CN108491286B (en) * | 2018-01-16 | 2023-04-11 | 深圳市博巨兴微电子科技有限公司 | MCU chip protection method |
CN110739911B (en) * | 2019-11-04 | 2023-04-11 | 湖南品腾电子科技有限公司 | Crystal oscillator circuit with stable oscillation starting |
CN115248608B (en) * | 2021-04-26 | 2023-05-09 | 华润微集成电路(无锡)有限公司 | Low-power consumption hygrothermograph circuit structure and measurement control method thereof |
CN113282133A (en) * | 2021-06-15 | 2021-08-20 | 西安微电子技术研究所 | Internal and external clock switching circuit and method for time correction of satellite-borne system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1248823A (en) * | 1998-08-24 | 2000-03-29 | 日本电气株式会社 | Phase-locked loop circuit and control method |
CN101694997A (en) * | 2009-10-27 | 2010-04-14 | 华东光电集成器件研究所 | Oscillator with automatically switching dual-mode oscillating source |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101711373A (en) * | 2007-04-30 | 2010-05-19 | 阿兰·阿纳迪·马特利 | Light modulation device and system |
-
2015
- 2015-05-11 CN CN201510236134.8A patent/CN104834581B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1248823A (en) * | 1998-08-24 | 2000-03-29 | 日本电气株式会社 | Phase-locked loop circuit and control method |
CN101694997A (en) * | 2009-10-27 | 2010-04-14 | 华东光电集成器件研究所 | Oscillator with automatically switching dual-mode oscillating source |
Also Published As
Publication number | Publication date |
---|---|
CN104834581A (en) | 2015-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104834581B (en) | A kind of failure of oscillation observation circuit of crystal oscillator | |
US9489213B2 (en) | Shutdown method, startup method, and communication terminal | |
US7183825B2 (en) | State retention within a data processing system | |
US8086890B2 (en) | Virtual machine monitor, virtual machine system and clock distribution method thereof | |
US9423852B2 (en) | Selecting a startup condition of an electronic device corresponding to available power | |
US6986074B2 (en) | Integrated circuit selective power down protocol based on acknowledgement | |
US8212601B2 (en) | Method and apparatus for providing system clock failover | |
JP6441619B2 (en) | Semiconductor device | |
US9513690B2 (en) | Apparatus and method for adjusting operating frequencies of processors based on result of comparison of power level with a first threshold and a second threshold | |
JP2010154294A (en) | Synchronization circuit | |
EP2804076A2 (en) | Adaptively Limiting a Maximum Operating Frequency in a Multicore Processor | |
CN103488532A (en) | Method and equipment for adjusting processor frequency | |
US10719331B2 (en) | Stand-by mode of an electronic circuit | |
EP4033332A1 (en) | Power management method and device | |
US10222823B2 (en) | Computing apparatus with real time clock without a battery | |
WO2016110000A1 (en) | Adjustment method, device and system for power-down reboot of single plate | |
WO2022135060A1 (en) | Terminal device, nfc clock control method, nfc module, and medium | |
KR20140026308A (en) | Apparatus and method for managing power in multi-core system | |
US7817769B2 (en) | Real time clock rate checker and recovery mechanism | |
CN109614153A (en) | Multi core chip and system | |
WO2024031932A1 (en) | Storage server startup detection method, system and apparatus, device, and storage medium | |
US20150067363A1 (en) | Clock generator circuit with automatic sleep mode | |
CN105840387B (en) | It is a kind of to prevent the method and device that start and stop motor temperature is excessively high in idling start stop system | |
CN108089631A (en) | A kind of clock circuit for detecting for microcontroller chip | |
CN107179911A (en) | A kind of method and apparatus for restarting management engine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |