Abstract:
A digital circuit for detecting a phase lock condition of a phase locked loop (PLL) circuit includes a pair of counters respectively receiving a digital signal produced by the PLL circuit, and a digital reference signal that is also received by the PLL circuit. A digital comparator is connected to the pair of counters for comparing count values contained therein at an end of a counting cycle, and for generating a first logic signal when the count values are the same and a second logic signal when the count values are different. A resettable memory receives the logic signals generated by the digital comparator and has a capacity sufficient to store a plurality of the logic signals resulting from successive comparisons. The resettable memory generates a third logic signal for asserting a phase lock condition of the PLL circuit when an uninterrupted sequence of the first logic signals have been input to the resettable memory during the successive comparisons, and generates a fourth logic signal for asserting a loss of a phase lock condition of the PLL circuit when an uninterrupted sequence of the second logic signals have been input to the resettable memory during the successive comparisons.

Description:
FIELD OF THE INVENTION  
         [0001]    The present invention relates to integrated digital systems, and in particular, to a circuit for generating a clock signal from a frequency stable reference signal. More specifically, the invention relates to a phase-locked loop (PLL) for generating a clock signal at a frequency that is generally higher than the reference frequency.  
         BACKGROUND OF THE INVENTION  
         [0002]    Phase-locked loops (PLL) are increasingly used in digital systems integrated on silicon for generating a clock signal. Starting from a stable external reference signal generated by a quartz crystal or a ceramic resonator) having a relatively low frequency, the PLL provides to the integrated system a highly stable clock signal, at a frequency higher than that of the reference signal. Very often the frequency value may be readily programmed. From the same reference it is possible to obtain different clock frequencies simply by reprogramming the characteristics of the loop.  
           [0003]    The use of a PLL for generating a synchronization signal and/or a relatively high frequency clock signal allows a reduction of electromagnetic emissions at the system level. This results in a savings of additional components used for filtering or noise suppression.  
           [0004]    In electronic applications, particularly when exposed to high noises levels and in which the stability of the timing signal is fundamental for the functioning of digital electronic circuits, the control of the state of the phase-locked loop is very important. The output signal of the PLL is considered locked to the reference signal when the ratio between the respective frequencies (the reference input signal and the output signal from the PLL) is kept constant.  
           [0005]    Stability is ensured by the architecture of the phase-locked loop, which implements a negative feedback loop used for detecting any temporary shift of the frequency of the output signal from the expected value. This information is reentered as quickly as possible. The parameters of the circuit are automatically varied in order to align again the two signals according to the desired frequency ratio.  
           [0006]    Electronic devices used in different applications (for instance in automotive, aeronautics, etc.) are subject, during functioning, to particularly high noise levels that disturb analog circuits such as the PLL. These disturbances often cause loss of the locked condition, to which the PLL reacts in long response times. This reaction depends on the architecture and the parameters of the loop, i.e., characteristics of the filter. A block diagram of a typical analog phase-locked loop is depicted in FIG. 1 (VCO stands for Voltage Controlled Oscillator).  
           [0007]    The presence of an auxiliary circuit for verifying instant after instant the locked condition of the PLL becomes indispensable in the above mentioned situations. This is because the system must have the possibility of reacting properly whenever the noise reaches a level such that the execution of the functions required from the integrated device may be in jeopardy, or, even worse, an incorrect functioning may occur at the system level compromising safety. For instance, in the automotive field safety is very important in airbag electronic controls and in the ABS.  
           [0008]    An important problem to be solved in defining the architecture of such a monitoring circuit is to strike the best compromise between the requirement of adequate sensitivity in detecting the locked condition or the loss of it, and that of filtering out momentary loss of locking that are not significant for a correct functioning of the system.  
           [0009]    In general the following criteria are defined:  
           [0010]    Detection of a Locked Condition:  
           [0011]    The system is defined as locked when such a condition remains stable in time. Overshoots in reaching a phase-locked state could be misinterpreted as if the locked condition had been reached. It may just be a temporary coincidence that the successive detection may not be confirmed causing an anomalous functioning of the system. For example, exceptions and/or interrupts may be generated, emergency and/or resume routines may start, and the like.  
           [0012]    Detection of a Loss of Locking:  
           [0013]    Desirably, the system should filter events having a loss of locking with a very short duration, and signal only persistent losses of locking. This later allows emergency and resume routines to be started only when they are really necessary. This avoids causing false functioning exceptions at any minimal noise injection.  
           [0014]    The above mentioned conditions are particularly relevant when the circuit for monitoring the locked condition is digital, wherein the stochastic effects relative to the conditions that occur at the instant in which the decision is taken (PLL locked or not) have a fundamental role. A digital circuit is intrinsically more robust than an equivalent analog circuit, and therefore more suitable in case of particularly noisy environments.  
           [0015]    Referring to the basic diagram of FIG. 1, a typical digital approach contemplates implementation of two counters respectively driven by the two signals to be compared in frequency, that is, the reference signal (input signal of the PLL) and the output signal (properly divided) that is fed-back to the input to the analog comparator circuit of the PLL (Phase Comparator). When one of the two counters reaches the end count value, the instantaneous contents of the two counters are compared, producing the result. If the two counters are aligned, the PLL is assumed to be locked, and vice-versa. Any difference between the compared values of the two counters is considered to verify an absence of a locking condition. There are drawbacks that are often unacceptable for applications particularly exposed to noise, and where safety has a fundamental role.  
           [0016]    False Detection of a Locked Condition:  
           [0017]    When the circuit is turned on, during an initial transient period, the PLL generates an output signal that approximates as much as possible the steady state value, defined by the ratio between the reference frequency and the set multiplication factor. The greater the speed of the circuit, the larger the overshoots in frequency about the expected value.  
           [0018]    As depicted in FIG. 2, the two counters, depending on the end count value carry out substantially an average on the effective value of the frequency. While the reference signal is stable (by definition), the signal generated by the PLL, suitably scaled, oscillates in frequency with a mean value detected from the associated counter. As a consequence, during the transient turn on phase, it may happen that the two counters are aligned, notwithstanding that the output signal of the PLL is unstable and should not be used by the application as a signal for timing and synchronizing all logic operations.  
           [0019]    False Detection of a Loss of Locking:  
           [0020]    Starting from a condition of locking, a perturbation may lead temporarily to a condition in which the output of the PLL differs (in frequency) from the expected value. The feed-back loop reacts immediately trying to compensate the variation, generating a slight overshoot. This temporary situation is in general filtered by the relative long length of the counting, as depicted in FIG. 3 a . The probability that the injection of a disturbance takes place when the counters are almost at the end of a count is smaller as the period of counting is longer. Unfortunately, such a probability is never null. This implies that even a small disturbance, if injected at the moment when the two counters are almost terminating the counting, could make the filtering action of the counters ineffective. This causes the generation of a loss of a locking signal, as depicted in FIG. 3 b.    
           [0021]    Critical Choice of the End Count Signal:  
           [0022]    The choice of the end count signal for the two counters determines the sensitivity of the detection circuit. If, on one hand, a short counting period ensures a most immediate reaction of the system to a perturbation of the equilibrium condition (locking). On the other hand, it makes the system excessively sensitive to occasional short lived events that could be neglected. Often, in some applications, the two opposite requirements have both a vital importance for the functionality of the whole system. For example, there is the need of reacting promptly to an eventual failure of the device that generates the frequency reference signal by triggering emergency routines. On the contrary, a momentary injection of high level noise may cause a temporary condition of a loss of locking that a system may be perfectly able to operate without triggering dedicated procedures for managing the event.  
         SUMMARY OF THE INVENTION  
         [0023]    An object of the present invention is to overcome the above mentioned critical points and drawbacks of the known circuits for monitoring a phase-locked condition, and to provide an improved system for generating a clock signal based on a frequency stable reference signal.  
           [0024]    The phase lock detecting circuit of the invention is based on the use of a resettable memory with a capacity (in terms of number of bits) sufficient to store a certain number of signals or logic values. These signals or logic values result from a sequence of as many successive comparisons of the values contained in the two counters of a common digital circuit for phase lock detection of the prior art, and of logic circuits for generating a certain logic signal confirming a locked condition upon the occurrence of an uninterrupted sequence of a certain number of logic signals all confirming a locked condition and a different logic signal. This is indicative of a loss of a lock condition upon the occurrence of an uninterrupted sequence of a certain number of logic signals having different values at the input of the resettable memory.  
           [0025]    In other words, the circuit exploits a resettable memory suitable to register, at each end count of a common digital circuit for the detection of a phase lock condition of the prior art, the result of the comparison between the content of the two counters of the phase lock detection circuit. A confirmation signal of the detection of a phase lock condition or of a loss of a lock condition is provided to the system only after the memory has stored an uninterrupted series of identical signals either of locking or of loss of locking. The number of which may be pre-defined in the design stage or programmed by the user, even in a dynamically variable fashion depending on one or more operation parameters of the system, which are purposely monitored.  
           [0026]    The depth of the resettable memory (that is, the number of successive comparisons that are required for confirming either a locking condition or a loss of a locking condition) may be set by the user himself. Moreover, the sensitivity of detection of a locked condition and of a loss of locking may be set even with different depths independently from one another, depending on the application, and the settings may even be dynamically modified to adapt to changing operating conditions.  
           [0027]    The invention is more precisely defined in the annexed claims. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0028]    The various aspects and advantages of the invention will be even more easily understood through the following detailed description and by referring to the attached drawings, wherein:  
         [0029]    [0029]FIG. 1 is a basic diagram of a phase-locked loop (PLL) having a lock detection circuit according to the prior art;  
         [0030]    [0030]FIG. 2 depicts a possible mechanism of false detection of a phase lock condition in the circuit illustrated in FIG. 1;  
         [0031]    [0031]FIG. 3 depicts two possible effects that a momentary injection of noise may cause in the circuit illustrated in FIG. 1;  
         [0032]    [0032]FIG. 4 is a basic diagram of the phase lock detection circuit according to the present invention;  
         [0033]    [0033]FIG. 5 is a basic diagram of implementing of software programmability for the sensitivity of the phase lock detection circuit according to the present invention; and  
         [0034]    [0034]FIG. 6 is a basic diagram for automatically regulating the sensitivity of the phase lock detection circuit according to the present invention.  
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0035]    With reference to the basic diagram of FIG. 4, the functioning of the circuit of the invention is described below. In the depicted example the resettable memory includes a resettable shift register (for instance, 8 bits). Any other storage structure for a certain number of bits (buffer), operating in a FIFO mode (first-in-first-out) and resettable at the end of each counting cycle, may be used instead of a shift register.  
         [0036]    Referring to FIG. 4, upon the turning on of the device (low PON signal−PON=Power−ON), all the bit cells are reset and the register outputs a signal that is not locked. When the supply voltage stabilizes, the signal PON is high and the shift register may be loaded.  
         [0037]    Detection of the Locking Condition:  
         [0038]    The counters A and B produce a succession of end counts, and a resulting sequence of comparisons. The logic data (bit) that results from each comparison is input to the shift register. When the two counters at an end count contain the same value, a logic 1 is stored in the shift register, otherwise a 0 is stored.  
         [0039]    Whenever a logic 0 is input to the shift register, the whole register is reset. This allows restart of the accumulation sequence in order to eventually produce a signal of a verified phase locking only when the whole register (or at least the most significative portion of it, depending on the programming) is filled with a logic 1.  
         [0040]    In this way, if events for equality of the contents of the two counters occurs, but soon followed by inequality events, the circuit filters these equality of counts occurrences by continuing to signal to the system that a not verified locking condition exists.  
         [0041]    Only once the output signal of the PLL has attained a true stability, the phase lock detection circuit generates an uninterrupted sequence of a logic 1. This guarantees that the clock signal is finally valid, and that a steady state has been reached. The phase lock assertion signal is produced by ANDing a programmable number of bits of the shift register. Only when all the selected bits are logically all 1, is the PLL is considered locked.  
         [0042]    By referring to FIG. 4, the bistable stage (flip-flop or Set-Reset circuit) raises its output to the logic level 1, thus indicating to the system that operation may be started. In the example of FIG. 4, only 5 bits of the shift register are used (ANDed) for generating a phase lock assertion signal.  
         [0043]    Detection of the Locking Loss:  
         [0044]    Once the phase lock condition has been reached (the flip-flop or Set-Reset circuit having its output at a logic 1), should a disturbance determine an inequality event between the contents of the two counters at an end count cause the feeding of a logic 0 to the first element (bit cell) of the shift register, such a single inequality event will not change the state of the output of the detection circuit confirming a locked PLL condition.  
         [0045]    Contrary to what happens during a phase of locking for the attainment of a phase lock condition, the inputting of a logic 0 does not cause a reset of the whole shift register. Only when all the significant bits in the shift register for the determination of the loss of the locking condition are a logic 0, the bistable output stage (flip-flop or Set-Reset circuit) is reset. This signals to the system a persistent loss of a phase lock condition that cannot be filtered any longer.  
         [0046]    At this point the system returns to a state similar to that existing upon the turning on of the device (the shift register is reset). In the example of FIG. 4, only 3 bits are used to discriminate a situation of loss of locking, and generates the relative signal. Though retaining unchanged the structure of known phase lock detection circuits based on a pair of counters and on a comparator, the circuit of this invention overcomes the noted drawbacks of the known circuits.  
         [0047]    In particular, the depth of the single counting assumes a relative importance. This is no longer an essential importance for the detection of the locking condition or of the loss of locking condition, by virtue of the crucial filtering function performed by the resettable memory (shift register).  
         [0048]    The risk of considering locked the PLL by mistake, while in reality it is still evolving toward a steady state condition is completely eliminated (or at least its probability becomes negligible). Theoretically, this could still happen that the overshoots last long enough, producing a sequence of comparisons all with equalities between the contents of the two counters, but with the PLL not yet stabilized, thus prematurely asserting a phase-locked condition.  
         [0049]    The risk of excessive sensitivity of the circuit in determining a loss of locking in case of momentary noise injections is practically prevented. The system is informed of a loss of locking only if the condition persists.  
         [0050]    The flexibility enhancement is immediately recognizable because the independent programmability of the circuits for the detection of phase lock condition, and for the detection of the loss of phase lock allows the PLL to adapt even dynamically the sensitivity of the two circuits. This depends on the characteristics of the application, and of the environment in which the system operates (variability of temperature conditions, noise level, supply voltage, frequency, etc.).  
         [0051]    The flexibility of the circuit of the invention may be fully exploited by associating to the base circuit, circuits for setting via software or even circuits for automatic regulation in a dynamic mode of the sensitivity of the detection and assertion circuits of a verified locking condition, and of a verified loss of a locking condition. The improved device of this invention may offer two enhanced modes.  
         [0052]    These modes include software programmability and automatic regulation. Software programmability allows the user to define the number of countings that make up a detection sequence for a verified locking, and independently the number of countings that compose a detection sequence for a verified loss of locking. Automatic regulation is carried out as a function of the level of noise injection. To this end, particular operating conditions are identified for which the noise level on the internal supply rails is particularly high. This is confirmed by measuring an excessively high noise level on the supply lines of the analog section of the PLL.  
         [0053]    Programmability via Software of the Sensitivity of the Circuit:  
         [0054]    [0054]FIG. 5 depicts the basic diagram of a circuit that allows programming of the sensitivity of the phase lock detection circuit in the PLL. Through respective registers, LOCK COUNTS REGISTER and UNLOCK COUNTS REGISTER, it is possible to program the minimum number (value) of respective consecutive counting cycles necessary for the assertion of a locking and of a locking loss. A minimum number is fixed because automatic regulation (if enabled) may increment dynamically the number of counting cycles for asserting a locking and for asserting a locking loss.  
         [0055]    The default value of the program registers may be a hardware option defined in laying down the specification of the device, whereby at power on such a pre-defined minimum value is loaded in the register. The register is not reset at each reset, in order to retain, even during the reset phase, the parameters previously set by the user. The register is formed in a dedicated zone of a flash memory (non volatile). The default value is pre-defined at the test level of the product (in the factory), for being eventually redefined by the user. Even in this case, the pre-established parameters are retained even after a reset and even a power-on event does not affect the default values that are loaded in the non-volatile memory.  
         [0056]    Obviously the minimum value that may be set is 1 counting cycle (0 would be insignificant). Respective decoders, a 3 to 8 decoder for example, of the number programmed in the two registers generate respective buses of logic values. Each bus has with a number of lines corresponding to the number of logic signals (bits) that may be stored in the resettable memory, such as, in the shift register.  
         [0057]    The multiplexers of a first array are controlled by the logic value present on the respective line of the bus that is produced depending on the value contained in the register LOCK COUNTS REGISTER. Each multiplexer has a first input to which is applied the logic signal corresponding to the value contained in a respective stage (bit) of the resettable shift register. A second input receives the logic signal having a value corresponding to the case of identity of the values contained in the two counters at an end count, and an output coupled to an input of a logic AND gate for driving the set input of the bistable output stage.  
         [0058]    The multiplexers of a second array are controlled by the logic value present on a respective line of the bus that is produced depending on the value stored in the register UNLOCK COUNTS REGISTER, and each multiplexer has a first input to which the logic signal corresponding to the value stored in a respective stage (bit) of the resettable shift register is applied. A second input receives the logic signal having a value corresponding to the case of non-identity of values stored in the two counters at an end count. An output is coupled to an input of a logic NOR gate for driving the reset input of the bistable output circuit.  
         [0059]    Automatic Dynamic Regulation:  
         [0060]    Software programmability may sometimes be burdening in terms of the level of interrupt of the application, and even more it may not imply an immediate reaction of the system to unexpected noisy conditions unmanageable in a deterministic manner by the application. It is therefore particularly effective to enable the function of automatic regulation of the sensitivity parameters of the detection circuit for a locking and locking loss.  
         [0061]    An effective implementation scheme of this function is depicted in FIG. 6. The circuit may be based, for instance, on monitoring (measuring) the instantaneous value of the supply voltage of the PLL circuit. A channel of an analog/digital converter A/D Converter that may exist in the integrated device for other purposes may be periodically (period defined by a dedicated counter programmable by the user) assigned to measuring the supply voltage of the circuits of the PLL that are more sensitive to noise (for example, a Voltage Controlled Oscillator VCO).  
         [0062]    The digital output of the converter is compared with respective look up tables: ROM/FLASH LOCK TABLE and ROM/FLASH UNLOCK TABLE, pre-defined and stored in a dedicated area of flash memory of the integrated device (pre-configured in the factory by the device manufacturer, but re-definable and controllable by the final user).  
         [0063]    When certain thresholds are overcome, the value present in the registers lock counts register and unlock counts register that define the minimum number of successive counting cycles necessary for detecting a locking and a locking loss, is incremented or decremented depending on what is best suited to the situation.  
         [0064]    In particular, the following functions are implemented. During a phase of searching for a phase lock condition an excessively high noise level could lead a system based on a relatively high number of successive countings to never assert a locking condition. Therefore, during this phase, the circuit that monitors the noise level may consent to progressively shortening the sequence of equality countings, as far as to obtain assertion of the attained locking. Of course, a minimum threshold will ensure that the system confirms an absence of locking in case of extreme operating conditions, which may include possible defects of the device that impede the generation of a stable reference frequency signal of the PLL.  
         [0065]    Once the locking has been reached, in presence of relatively high noise levels, the sequence of successive countings for detecting a loss of locking is prolonged, in order to make the system less sensitive to disturbances that may be considered acceptable. Should the noise level decrease, the sequence is shortened in order for the system to regain sensitivity to sudden disturbances for preventing typical problems of de-synchronization of the serial communication channels (typically of CAN lines in automotive applications).  
         [0066]    The above embodiment is particularly suited for applications wherein the noise level that is injected in the system from external circuits and/or generated in the device, often combine in a deterministic (expectable) manner (tied to the peculiarities of the application itself), and seldom in such a manner to produce generally unexpected effects.  
         [0067]    This happens in automotive applications. Any electronic circuitry located in the engine compartment is subjected to a high noise levels when the engine is being started, noise that persists though changing its characteristics and intensity in the successive phases, such as when the engine is running, in acceleration/deceleration phases, in case of an impact (for instance an electronic circuitry (integrated system) for controlling the ABS, airbag, and the like).  
         [0068]    When the engine is off, other circuitries continue their activity for a relatively long time, detecting and measuring signals coming from sensors of various kind and tracking the evolution in time of several parameters. Therefore, they operate in an environment that has become much less noisy but where many operations still require communication between distinct modules, and thus a good sensitivity and reactivity in case of unexpected events (such as, for instance, the turning on of the engine by the user).  
         [0069]    In all these situations, the sensitivity of the system for generating a stable clock signal (system clock) assumes a vital importance for the proper functioning of the circuitries. In automotive applications this often implies safety of the driver and of the passengers.  
         [0070]    Even the microprocessors that regulate the activity of the various systems are responsible for the generation of noise. In particular, the systems that control the opening and closing of the valves of the motor (typically by pulse width modulated or PWM signals) with relative synchronous power circuits. Another example are the devices that control small electric motors used in dashboard indicators. Even in this case they generate synchronous signals having non-negligible power, that may cause the injection of noise of relatively high level in the internal system (single integrated device) and also in the external system (car) that disturbs especially the analog circuits present on the same integrated device, among which the PLL is one of the most critical and sensitive.  
         [0071]    The novel circuit of the invention provides an outstanding flexibility that may count on a software programmability for all the conditions that are fairly expectable or that least are manageable in a critical manner in terms of response times, and on an automatic programmability whenever it is safer that the system regulates itself dynamically without intervention of the software that may thus continue in the execution of the main functions of the application that it is managing, without periodically interrupting itself for controlling the noise level and adjusting sensibilities.