CN1147789C - Method for detecting clock loss and burr in embedded microprocessor application system - Google Patents

Method for detecting clock loss and burr in embedded microprocessor application system

Info

Publication number
CN1147789C
CN1147789C CNB001168622A CN00116862A CN1147789C CN 1147789 C CN1147789 C CN 1147789C CN B001168622 A CNB001168622 A CN B001168622A CN 00116862 A CN00116862 A CN 00116862A CN 1147789 C CN1147789 C CN 1147789C
Authority
CN
China
Prior art keywords
clock
checked
loss
burr
comparer
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.)
Expired - Fee Related
Application number
CNB001168622A
Other languages
Chinese (zh)
Other versions
CN1317741A (en
Inventor
谢建良
许俊文
文峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CNB001168622A priority Critical patent/CN1147789C/en
Publication of CN1317741A publication Critical patent/CN1317741A/en
Application granted granted Critical
Publication of CN1147789C publication Critical patent/CN1147789C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention provides a method for detecting lock losses and burs in an embedded microprocessor application system. The present invention detects and compares the frequency ratio of a clock to be detected to a system clock so as to detect the loss of the clock to be detected or the burs; the entire process can be achieved inside a programmable logic device. The method is used a multi-channel communication controller (QMC) inside a currently widely used MPC860CPU produced by Motorola and has favorable effect. The method not only omits a chip but also achieves functions and performance that the chip can not achieve.

Description

Loss of clock and burr detection method in the embedded microprocessor application system
The invention belongs to the computer clock detection range, specifically, relate to the detection method of clock quality general in a kind of embedded microprocessor application system.
At present, in embedded microprocessor application system, except that the needs system clock, also has the clock (as distant serial synchronous telecommunications clock, switched circuit clock or the like) of other kind.These clocks will produce burr or temporary transient losing sometimes, and (burr refers to the high frequency clutter that superposes on the clock waveform of standard, temporarily the losing of clock shows as clock signal and presents single high level or low level), these burrs or lose not quite to the influence of total system sometimes therefore often adopt monostable circuit (as 74HC123 etc.) to detect losing of clock and inform microprocessor.But also have in the suitable application, in a single day burr occurs with the situation of losing, will produce serious influence, as in the use of the multichannel communication controller (QMC) of the MPC860 of present widely used Motorola CPU inside, if supply with its clock generating burr or temporarily lose, even the very fast recovery of clock, the multichannel communication controller also can't recover, can carry out the transmitting-receiving of erroneous packets always, cause the forfeiture of multichannel communication controller function.The appearance of this situation is a very serious problem for total system.At this moment can not reach requirement with above-mentioned prior art circuits.
In some patents (is JP02226432A and EP00676695B1 etc. as the patent No.), physical circuit at the clock failure proposition, use in the embedded microprocessor application system, do not exist the controllability of versatility and precision high and be not easy to problems such as enforcement, and still do not have the report of pertinent literature for the burr fault detection method of clock upper frequency.
Therefore, provide the clock detection method of the controllability that a kind of embedded microprocessor application system possesses versatility and precision to be of great practical significance.
The objective of the invention is to the characteristics at present embedded microprocessor application system, proposing a kind of is benchmark with the system clock, and in conjunction with programmable logic device (PLD) losing or method that the burr of clock detects clock.
Design of the present invention is such:
In the embedded microprocessor application system, with system clock as benchmark, when clock to be checked (as the serial type communication clock, synchronous and the bit clock of exchange network) just often, the frequency ratio of system clock and clock to be checked should be certain value n, if allow both error to be arranged frequency ratio, then frequency ratio should be at n 1~n 2Between (n 1<n<n 2), when clock loss of clock to be checked, this moment, clock to be checked presented always for high or be low state, was equivalent to frequency and is zero clock, and both frequency ratios are greater than error upper limit n 2When burr appearred in clock to be checked, this moment, clock to be checked was equivalent to become a high frequency clock, and then both frequency ratios are less than error lower limit n 1
Thus, as long as the frequency ratio of clock to be checked and system clock is detected and compares, can realize to clock to be checked lose or burr detects.
The technical scheme that realizes the object of the invention in turn includes the following steps:
1. preestablish the frequency ratio (n=system clock frequency/clock frequency to be checked) of system clock and clock to be checked, n 1And n 2(n 1<n<n 2), n 1=n-i, n 2=n+j can establish i=1,2 or 3 according to accuracy requirement, j=1,2 or 3.n 1And n 2Value set respectively in clock bur comparer and the loss of clock comparer;
2. by the zero clearing of a system clock counter of pulse signal control, after the zero clearing, counter starts anew system clock is counted;
3. catch the rising edge (being signal is transferred to high level by low level the moment) of clock to be checked by a trigger;
4. the state of trigger being caught by a pulse producer sends corresponding pulse signal;
5. by two comparers, loss of clock comparer and clock bur comparer, with the count value of counter respectively with the n that sets 1, n 2Compare;
6. comparative result is informed CPU.
Whole process can be in the inner realization of programmable logic device (PLD).Said programmable logic device (PLD) can adopt the commercially available prod, as the programmable logic device (PLD) of altera corp.Below in conjunction with accompanying drawing detailed content of the present invention is set forth.
Fig. 1 is clock to be checked wave simulation result just often.
Wave simulation result when Fig. 2 is a loss of clock to be checked.
Wave simulation result when Fig. 3 burr occurs for clock to be checked.
Fig. 4 is a logical flow chart.
Fig. 5 realizes circuit diagram for FPGA (Field Programmable Gate Array).
The meaning of each waveform is in Fig. 1~3: waveform 1 is system clock, is the system works clock in the embedded microprocessor application system; Waveform 2 is a clock to be checked, is the clock that will detect, (as serial type communication synchronization clock, the synchronous and bit clock of exchange network), and waveform 3 is a pulse signal, is by the pulse of pulse producer according to clock generating to be checked, is used for control counter zero clearing etc.; Waveform 4 produces high level when expressing current clock and lose for loss of clock; Signal became high level by low level when waveform 5 was represented burr to occur for clock bur; Waveform 6 is zero clearing control, refers to CPU this clock detection circuit that is used for resetting; Waveform 7 is lost or during the burr generation for being meant to CPU when clock, this testing circuit will produce middle fracture or the I/O mouth of a high level to CPU, after CPU detects this signal, and should be with the zero setting of zero clearing control end to remove this signal, then the zero clearing control end is put height, make that testing circuit continues to detect.
As seen from Figure 1, when clock to be checked just often, pulse signal produces two pulses in the cycle of a clock to be checked;
As seen from Figure 2, when clock transient loss to be checked, clock to be checked shows as high level, and the interval of pulse signal surpasses a normal clock period to be checked;
As seen from Figure 3, when burr appearred in clock to be checked, clock to be checked showed as the high frequency waveforms of a narrower width, and this moment, the interval of pulse signal was lower than a normal clock period to be checked.
As seen from Figure 4, this method may further comprise the steps:
1. start detection circuit;
2. begin system clock is counted by counter 8;
3. catch the rising edge of clock to be checked by trigger 9.Arrive trigger upset, its state input pulse generator 10 as rising edge;
4. pulse producer sends corresponding pulse signal, and order set clock counter 8 zero clearings on the one hand of this pulse signal restart counting; On the other hand with the count value of counter before the zero clearing 8 and the setting value error lower limit n in the clock bur comparer 11 1Compare, the principle of work of clock bur comparer 11 is that the pulse signal of pulse producer is as its enable signal, when having pulse signal, if count value is less than n 1, the output high level, on the contrary be low level.
If loss of clock 5. to be checked, then rising edge can not arrive, this moment by loss of clock comparer 12 at any time with count value and setting value error upper limit n 2Compare.The principle of work of loss of clock comparer 12 is, when count value greater than n 2The time, be output as high level, otherwise be low level;
If 6. the comparative result of loss of clock comparer 12 and clock bur comparer 11 is true, promptly signal becomes high level by low level, then reports and submits the CPU13 explanation to produce loss of clock or clock bur phenomenon;
6. counter 8 constantly carries out under pulse signal control, and therefore whole clock detection is constantly carried out.
This scheme there are 3 explanations:
(1) adopt rising edge as the counting benchmark, be the characteristics of considering burr itself, general burr is narrower, even negative edge occurs earlier, just rising edge can appear subsequently, and be feasible as the counting benchmark therefore with rising edge, as require with the negative edge be the counting benchmark, only need add a phase inverter and get final product, also two kinds of circuit can be joined together, the rising and falling edges with burr during department is the counting benchmark;
(2) for the burr of width less than system clock, still can capture, this is described in the following detailed description;
When (3) reality was used this method, judgement was lost the count value of clock and burr appearance and can be set promptly reasonable specification error lower limit n according to the precision that will control flexibly 1With error upper limit n 2Size, be similar to a bandpass filter, at n 1<count value<n 2The time be normal, n 1And n 2Scope big more, the precision of detection is low more, otherwise then high more.Generally, n can recently determine according to the frequency of system clock and clock to be detected, and n=system clock frequency/clock frequency to be checked detects the clock of 4M as the system clock with 64M, and then n=64/4=16 can select n 1=15, n 2=17, if phase place of allowing the 4MHz clock etc. has than mistake, can suitably relax span, as n 1=14, n 2=18.
Fig. 5 realizes circuit diagram for FPGA (Field Programmable Gate Array).
According to the realization circuit diagram of the concrete FPGA (Field Programmable Gate Array) of scheme block diagram shown in Figure 4 as shown in Figure 5, the MaxPlus II software of this available altera corp of figure is realized.FPGA (Field Programmable Gate Array) realized that circuit finishes in FPGA (Field Programmable Gate Array) design software environment, compiling and burned programmable logic device (PLD) with system clock and clock entering apparatus pin to be checked, can realize this method and output pin linked to each other with CPU.With system clock 64M, clock 4M to be detected is an example among the figure, and then both sides relation is 16 times, and circuit is with greater than 18 with less than 14 as judgment condition in the drawings, judges whether clock is lost or burr occurred.
As seen from Figure 5, this realization circuit comprises:
Pulse producer 22, three inputs or door 23 that the trigger 19 that the clock bur comparer 16 that the d type flip flop 15 of the counter 25 with synchronous clear terminal, loss of clock comparer 14, comparer 26 and a band Enable Pin constitutes, T trigger 17 and d type flip flop 18 constitute, d type flip flop 20 and XOR gate 21 constitute and the state retaining circuit that constitutes with door 24.
The synchronous zero clearing control signal of counter 25 is from pulse producer 22; The signal of loss of clock comparer 14 is from counter 25, and its judgement is worked as count value greater than n 2Greater than 18 o'clock, be output as high level, otherwise be low level; The Enable Pin signal of clock bur comparer 16 is from pulse producer~22;
The T termination VCC that forms the T trigger 17 of trigger 19, therefore as long as the pulse width of coming greater than the trigger Time Created (generally less, as 8ns) of programmable logic device (PLD), just can make 5 upsets of T trigger, thereby detect, this method can reach higher precision and just be this.The effect of d type flip flop 18 is with system clock synchronously once, so that the pulse width that the pulse producer 22 of back produces keeps constant;
Three inputs or door 23 and the high level signal that is used to keep loss of clock or clock bur to produce with door 24 are the interface sections of entire circuit and CPU.The effect of circuit generation herein is among Fig. 5, in case loss of clock or burr occur, just the high level that produces is maintained and be passed to CPU, till the CPU response concurrent goes out reset signal.This part can be made amendment as required to meet the needs of various CPU.
Output signal in the FPGA (Field Programmable Gate Array) realization circuit can directly be linked the interruption pin of CPU, also this output signal can be connected to the general I/O pin of CPU, as shown in Figure 6.Also have an other I/O pin to connect the zero clearing control pin of clock detection circuit among Fig. 6, be used for the zero clearing and the startup of CPU control clock detection circuit.
Foregoing circuit is in when work, and pulse signal produces two pulses in the cycle of a clock to be checked, and the count value of counter is 14 between 18 the time, and clock to be checked is normal; Be greater than or less than 14 or at 18 o'clock, be loss of clock or produce burr.In actual applications, precision is adjusted this two values as requested, thereby can use this method very neatly.
Said method and realization circuit use in several designing boards, as the use in the multichannel communication controller (QMC) of the MPC860 of present widely used Motorola CPU inside, after using this method, in case clock burr occurs or loses, this circuit can notify CPU to handle, be unlikely to the ceaselessly operation under error condition of multichannel communication controller, respond well.Detect clock with the special chip of the use of routine (as monostable circuit) and compare, this Method and circuits has not only omitted chip, and has realized chip irrealizable function of institute and performance.So, in the application of embedded microprocessor system widely, if there is the clock detection problem, as long as use this highly versatile, high-precision Method and circuits, can be very simple and direct, effectively deal with problems.

Claims (4)

1. loss of clock and burr detection method in the embedded microprocessor application system is characterized in that this method in turn includes the following steps:
1. start detection circuit;
2. begin system clock is counted by counter (8);
3. catch the rising edge of clock to be checked by trigger (9); Arrive trigger (9) upset, its state input pulse generator (10) as rising edge;
4. pulse producer (10) sends corresponding pulse signal, and this pulse signal is order set clock counter (8) zero clearing on the one hand, restarts counting; On the other hand with the count value of counter before the zero clearing and the setting value error lower limit n of clock bur comparer 1Compare;
If loss of clock 5. to be checked, then rising edge can not arrive, and loss of clock comparer (12) is at any time with count value and setting value error upper limit n 2Compare;
If 6. the comparative result of loss of clock comparer (12) and clock bur comparer (11) is true, promptly report and submit CPU (13);
7. counter (8) is counted under pulse signal control continuously, and whole clock detection is carried out continuously.
2. the method for claim 1 is characterized in that, n 1=n-i, n 2=n+j, i are 1,2 or 3, and j is 1,2 or 3, and n is a system clock frequency and the ratio of clock frequency to be checked.
3. the method for claim 1 is characterized in that, clock to be checked is the counting benchmark with the negative edge after by a phase inverter.
4. the method for claim 1 is characterized in that, the rising and falling edges with clock to be checked serves as that the counting benchmark is caught rising edge and negative edge burr simultaneously simultaneously.
CNB001168622A 2000-06-29 2000-06-29 Method for detecting clock loss and burr in embedded microprocessor application system Expired - Fee Related CN1147789C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB001168622A CN1147789C (en) 2000-06-29 2000-06-29 Method for detecting clock loss and burr in embedded microprocessor application system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB001168622A CN1147789C (en) 2000-06-29 2000-06-29 Method for detecting clock loss and burr in embedded microprocessor application system

Publications (2)

Publication Number Publication Date
CN1317741A CN1317741A (en) 2001-10-17
CN1147789C true CN1147789C (en) 2004-04-28

Family

ID=4586261

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB001168622A Expired - Fee Related CN1147789C (en) 2000-06-29 2000-06-29 Method for detecting clock loss and burr in embedded microprocessor application system

Country Status (1)

Country Link
CN (1) CN1147789C (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1323337C (en) * 2003-06-23 2007-06-27 华为技术有限公司 Method and circuit for conducting real time test for single chip clock shaking
CN1329789C (en) * 2003-07-30 2007-08-01 华为技术有限公司 Method for preventing total clock output from generating burr at master spare clock switching
CN103365757B (en) * 2013-07-29 2016-02-17 浙江中控技术股份有限公司 Clock detection method and device
CN103728516B (en) * 2014-01-09 2016-05-11 福州瑞芯微电子股份有限公司 Soc chip clock detection circuit
CN105337607B (en) * 2014-06-30 2019-05-17 澜起科技股份有限公司 Device and method for clock signal loss detection
US10379927B2 (en) * 2016-11-01 2019-08-13 Xilinx, Inc. Programmable clock monitor

Also Published As

Publication number Publication date
CN1317741A (en) 2001-10-17

Similar Documents

Publication Publication Date Title
CN1147789C (en) Method for detecting clock loss and burr in embedded microprocessor application system
CN104901657A (en) Full-digital debouncing circuit and method
CN202940829U (en) Avionic full duplex real-time Ethernet fault injection device
CN105656456A (en) High-speed and high-precision digital pulse generating circuit and pulse generating method
CN1924758A (en) Multi-clock domain system reset circuit
CN1251419C (en) Method for realization of fast rearranging main spared device in communication devices
Verdel et al. Duplication-based concurrent error detection in asynchronous circuits: shortcomings and remedies
CN113282134B (en) Device and method for realizing time synchronization of hot backup triple-modular redundancy computer
CN100338875C (en) Clock signal generator
CN209543065U (en) Timing circuit and electronic stopclock
CN1309169C (en) Multipath clock detecting device
CN100337404C (en) Crystal oscillation duplicaltion and its duplicating circuit
CN101937069A (en) Voltage characteristic detection system and method of SOC (System On Chip) intelligent electric meter
CN2559168Y (en) Circuit for detection of clock loss
CN1218488C (en) Double-edge M/N counter
CN2599652Y (en) Entrance guard dog checking circuit
CN1588639A (en) Reset method and reset system for integrated circuit
CN100578244C (en) Loop oscillator start circuit
CN1131592C (en) Signal phase discriminating method in state transferring sequential logic
CN100474265C (en) Microprocessor occupancy rate statistic method
CN102377708A (en) Modem and power supply management method thereof
CN114064332A (en) Clock detection method and device and clock safety system
CN116359864A (en) Radar turntable north-correcting control system
CN205644142U (en) Controlling means is selected to accurate angle of electronic type intelligence
CN2725904Y (en) Clock detector

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: ZTE CO., LTD.

Free format text: FORMER NAME OR ADDRESS: SHENZHENG CITY ZTE CO., LTD.

CP03 Change of name, title or address

Address after: 518004 Zhongxing building, science and technology south road, Nanshan District hi tech Industrial Park, Guangdong, Shenzhen

Patentee after: ZTE Corporation

Address before: 518004 Zhongxing communication A seat, science and technology south road, Shenzhen hi tech Industrial Park, Guangdong

Patentee before: Zhongxing Communication Co., Ltd., Shenzhen City

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20040428

Termination date: 20140629

EXPY Termination of patent right or utility model