A method of generating an output signal m response to an external signal and a first reference signal, as well as a digital phase-locked circuit having a voltage-con¬ trolled oscillator
The invention concerns a method of generating an output signal in response to an external signal and a first ref¬ erence signal, wherein an internal signal is currently generated to replace the external signal if the external signal drops out.
In many branches of the electronics industry there is a need for circuits m which an output signal has a prede- termmed relation to an input signal. The output signal may e.g. originate from a circuit whose output voltage is to match a constant input voltage. To achieve this, the voltage is usually fed back from the output of the cir¬ cuit to a comparator circuit which compares the input signal and the signal fed back. In the event that the voltage of the output signal changes, the output signal from the comparator circuit will ensure that the output signal is adjusted.
If the input signal disappears for some reason, the out¬ put signal from the connected circuit cannot be kept con¬ stant .
SE C2 501 385 discloses a circuit intended for coupling an internal reference frequency m a phase-locked circuit if the reference frequency used drops out. The document describes a method wherein the reference frequency used is currently stored, and if it drops out, the stored value is coupled to control a voltage-controlled oscilla- tor. This known method is not sufficiently accurate in all cases, since the coupling of the internal reference
frequency will cause phase errors m the phase-locked circuit.
The same document describes a method using a separate synthesis circuit for generating an internal signal. Of course, this method requires much technical equipment in¬ volving the risk of introducing error sources.
Thus, an ob ect of the invention is to provide a method of the type mentioned m the opening paragraph, wherein an output signal to be maintained in relation to an input signal, can be generated with very great accuracy if the input signal drops out.
This object is achieved according to the invention m that the difference between the internal signal and the external signal is currently monitored to calculate an adjustment signal, and that, if the external signal drops out, the output signal is generated by means of the feed- back loop in response to the internal signal and the sig¬ nal fed back, adjusted by the calculated adjustment sig¬ nal .
The absent input signal may hereby be replaced by a new input signal, a reference signal generated on the basis of the original input signal being used for adapting the circuit conditions in accordance with what they were prior to the drop-out of the input signal.
This general principle may advantageously be used in con¬ nection with so-called SDH communications equipment, m which a so-called STM-1 frame may be transferred between network elements. The frame consists of 270 columns with 9 bytes in each column. The first 9 columns m a frame contain overhead functions, frame loci, etc. A frame is transferred from one network element to another with a
period of 125 μsec. This means that all bits in the frame, which are transmitted serially, e.g. through an optical fibre, must have been transmitted after 125 μsec., which means m turn that the bits must be trans- ferred with 155.520 megabits/sec, since a total of 19,940 must be transferred m 125 μsec.
As will be appreciated, the transfer of data bits in such a data transmission system with STM-1 frames will be most unproblematic, if the read-out rate of the data bits in the frame is synchronized/locked to the transfer rate of the frame itself.
A so-called phase-locked loop may be used for this pur- pose, adapted so that an output signal maintains a con¬ stant value m relation to an input signal. In other words, m connection with the transfer of STM-1 frames where a receiver receives an input signal in 125 μsec., a phase-locked loop may be arranged to emit an output sig- nal which has a frequency corresponding to the transfer of 155,520 megabits per second. Of course, if the input signal drops out for some reason, it is desirable that another signal which is very close to the signal dropped out can be connected very rapidly, so that the output frequency may be kept at a stable value.
According to the invention, this wish is fulfilled by a method in connection with a digital voltage-controlled oscillator which is characterized in that the output sig- nal from the voltage-controlled oscillator is counted in a counter circuit which is latched by the external sig¬ nal, said latched value being then used for controlling the voltage-controlled oscillator, that the external sig¬ nal and the internal signal are currently monitored to calculate an adjustment value, and that, in case of drop¬ out of the external signal, the output signal from the
voltage-controlled oscillator is adjusted by the adjust¬ ment value and the counter circuit is latched instead by the internal signal, said latched value being then used for controlling the voltage-controlled oscillator.
Hereby, it will constantly be monitored how great the de¬ viation is between the external signal and the internal signal, so that any differences in frequency between the signals may rapidly be compensated by means of an adjust- ment value, if it is necessary to connect an internal signal .
It is expedient according to the invention that the out¬ put signal of the voltage-controlled oscillator, while being locked to the external frequency, is supplied to an 11-bit counter whose contents are latched with a period determined by the internal frequency, and that the re¬ sulting value is used in the calculation of the adjust¬ ment value.
This ensures constant provision of a new adjustment value which may be applied at the moment when the external fre¬ quency possibly drops out.
According to the invention, another advantage is that, in case of drop-out of the external frequency, the adjust¬ ment value last calculated is supplied to a third counter which counts with a frequency derived from the output frequency of the voltage-controlled oscillator, and, each time the third counter has counted to a value calculated on the basis of the adjustment value, a clock pulse will be removed from or added to the output signal of the voltage-controlled oscillator before said signal is sup¬ plied to the counter circuit, as the internal frequency will have resulted in one clock period too many or too
few in relation to what it would if the external fre¬ quency was still present.
This provides the advantage that the error difference ex- isting between the external frequency and the internal frequency is constantly taken into consideration when the phase-locked circuit is locked to the new internal fre¬ quency, as the third counter constantly causes transmis¬ sion of adjustment signals to the phase detector, so as to currently compensate for the difference which existed between the external frequency which dropped out and the internal frequency now used.
Finally, it is an advantage that at the time when the m- ternal signal would latch the counter circuit the first time after the drop-out of the external signal, the value last latched is maintained unchanged to control the volt¬ age-controlled oscillator, and that the counter circuit is simultaneously set to this value, following which the counter circuit continues to count like before.
It is hereby ensured that also the difference which will always exist m the phase between the external signal and the internal signal, can be taken into consideration. Even though the frequencies of the two signals will be very close to each other, it cannot be expected that this also applies to the phases of the signals. A phase dif¬ ference would mean that the regulation circuit would re¬ ceive a transient that might disturb the stable regula- tion. Therefore, it is important that this, too, may be taken into account.
The invention also concerns a digital phase-locked cir¬ cuit having a voltage-controlled oscillator whose output signal is locked to an external signal, and wherein a counter, whose output is adapted to be latched with a
latch signal determined by the external signal, is adapted to count the output signal from the voltage-con¬ trolled oscillator, which is adapted to be controlled by the latched value, and moreover comprising an adjustment circuit.
This circuit is characterized in that the adjustment cir¬ cuit is adapted to calculate an adjustment value in re¬ sponse to the external signal and an internal signal and, m case of drop-out of the external signal, to adjust the output signal of the oscillator by the adjustment value before said signal is supplied to the counter input of the counter circuit so as to compensate for the differ¬ ence between the external signal and the internal signal.
Accordingly, a digital phase-locked circuit is provided, enabling insertion of an internal signal, if the external signal drops out, while supplying to the phase detector a compensation signal which ensures that the phase lock op- erates substantially without changes relative to what it did before the external signal dropped out.
Expediently, the adjustment circuit comprises an 11-bit counter whose output is connected to the input on a cal- culating circuit.
The invention will be explained more fully below with reference to an example shown in the drawing, in which
fig. 1 shows a basic structure of a circuit according to the principles of the invention, and
fig. 2 shows an example of an embodiment of a digital phase-locked circuit of the invention.
Fig. 1 basically shows a circuit which may be used in a regulation circuit from a process where an output signal having a predetermined relation to an external input signal is to be generated. This situation is shown in fig. 1, where switches 1 and 2 controlled by a detector circuit 3 are in the position shown in the figure. The external input signal and a first feedback signal are connected to a comparator circuit 4 adapted to generate an output signal, which controls a signal generator 5 generating the output signal. The first feedback signal is generated by means of the output signal via a circuit 6 having a predetermined transfer function. The matter described above corresponds closely to a well-known regu¬ lation loop.
The invention relates to the situation where the external input signal drops out for some reason, it being impor¬ tant that the output signal continues to be generated es¬ sentially as if nothing had happened on the input side. For the output signal to be maintained, an internal func¬ tion generator 7 being provided, emitting an input signal which is very close to the external signal. Since the ex¬ ternal input signal constantly varies slightly with time, the internal input signal, of course, usually does not correspond completely to the external signal, and there¬ fore it does not suffice to replace the external input signal by an internal input signal merely by switching in the event that the detector circuit 3 detects that the external input signal has disappeared.
To compensate for the differences which invariably exist between the external input signal and the internal input signal, these signals are currently monitored in a cir¬ cuit 8. On the basis of this, the circuit 8a calculates an adjustment signal which corresponds to the difference between the internal input signal and the external input
signal. This adjustment signal is supplied to an adjust¬ ment circuit 9 capable of adjusting the first feedback signal by a value which corresponds precisely to the dif¬ ference between the two input signals.
When the external input signal disappears, the switches 1 and 2 controlled by the detector circuit 3 switch to the position shown m dashed line, so that the internal input signal instead of the external one is now supplied on one input of the comparator circuit, while the other input of the comparator circuit receives a signal which differs just as much from the original feedback signal as the difference between the two input signals. Thus, the com¬ parator circuit 4 will not see any direct change m its input signals, and nor will the output signal from the signal generator 5 be directly by affected by the disap¬ pearance of the external input signal.
In fig. 2, the numeral 10 designates a digital phase- locked loop, while 12 represents an adjustment circuit for use in the adjustment of the phase-locked circuit 10. Since the invention does not address the actual digital phase-locked loop, this circuit will ust be explained briefly, but sufficiently to understand how the adjust- ment circuit 12 operates.
The phase-locked circuit 10 has a voltage-controlled os¬ cillator 17, whose output signal is fed back to a counter 13 which currently counts pulses from the output of the voltage-controlled oscillator 17. The counter 13 is a free-running counter whose value is latched in a latching circuit 23 so as to latch with a period of 125 μsec., corresponding to 8 kHz in the input signal. The output signal from the latching circuit 23 is fed to a compensa- tion unit 14 which staggers the count in the latch 23 m an expedient manner to provide even regulation values,
which are fed to an integrator 15, 18 and from there to a digital-to-analog converter 16 which controls the volt¬ age-controlled oscillator 17.
In the event that the 8 kHz signal disappears on the latching circuit input 23, an internal signal will be connected, having a frequency which is very close to the disappeared 8 kHz frequency, as the output signal from the adjustment circuit 12 ensures that any difference be- tween the two signals will be compensated in the phase detector. The adjustment circuit 12 has an 11-bit counter 26 which counts pulses from the output of the voltage- controlled oscillator, said counter 26 being periodically latched by an internal signal with a period of about 1 second derived from the frequency of the internal signal. Hereby, the counter circuit 26 can constantly compare the external signal with the internal signal, and any differ¬ ence will be reflected by a signal on the output of the counter 26. Thus, the difference between the external signal and the internal signal may be determined very ac¬ curately m periods of about 1 second. If the 8 kHz sig¬ nal drops out, the counter 26 instantaneously stores the value latched last and supplies a signal in response thereto to a third counter 22, which currently counts up or down from this fixed value with a frequency synchro¬ nous with the output frequency of the voltage-controlled oscillator 10, e.g. by 1/8 of this frequency.
The counter 22 is dimensioned such that when it has counted a plurality of pulses corresponding to the said value, it will apply a signal to a circuit 25 which adds a clock pulse to or subtracts a clock pulse from the os¬ cillator 17, which corresponds to compensation for the difference that existed between the external signal and the internal signal at the time when the external signal dropped out. In other words, the circuit constantly cor-
rects for the difference that existed between the exter¬ nal signal and the internal signal, so that the circuit does not change its output signal.
Thus, the circuit 12 provides for correction of frequency differences between the external signal and the internal signal .
However, also the moment of connection involves some as- pects which have to be taken into consideration.
Clearly, the external signal and the internal signal can¬ not have the same phase at the moment when the internal signal is connected. This means that if the internal sig- nal was connected directly, without taking any steps to allow for the phase differences, the circuit would no longer be phase-locked. The reason is that the latching circuit is latched by the pulses which are supplied by the external signal. If, e.g., the external signal sud- denly disappears, and a value exactly corresponding to a pulse m the external signal has been latched, an inter¬ nal signal with a temporally different pulse will latch by another value m the latching circuit, which would correspond to the difference between the phases of the internal and external signals. To avoid this error, the circuit is adapted such that the first time the circuit is latched by the new signal, the last-latched value from before the disappearance of the external signal is main¬ tained, and this value is moreover entered into the counter which will proceed with its count from there. Then, the internal signal latches the counter m the sub¬ sequent periods .
Although a preferred embodiment of the present invention has been described and illustrated, the invention is not restricted to this, but may be embodied in many different
ways within the scope of the subject-matter defined in the following claims.