Summary of the invention
For the frequency band adjustment time that solves existing phase-locked loop long, and the frequency band switch speed waits problem slowly, originally the invention provides a kind of frequency band changing method for phase-locked loop, described method comprises:
The voltage controlled oscillator initial oscillation is therein on the heart frequency band; Whether the current output frequency count value of judging voltage controlled oscillator is the count value first time, if, then judge the magnitude relationship of described current output frequency count value and expected frequency count value, calculate the difference of described expected frequency count value and current output frequency count value, in the voltage controlled oscillator frequency band distribution table that sets in advance, find corresponding frequency band according to described difference, current output band is switched to the frequency band that finds, again counting;
Judge the current output frequency count value and the magnitude relationship of expected frequency count value of voltage controlled oscillator, and according to described magnitude relationship, adjust current output band, two frequency bands up and down of the frequency-splitting minimum between the definite and described expected frequency;
More described expected frequency count value and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and described expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band, and described current output band is switched to described switch of frequency band.
Described according to described magnitude relationship, the step of adjusting current output band is specially:
If described current output frequency count value is big, then calculate the difference between described current output frequency count value and the expected frequency count value, be labeled as first difference, and current output band value is added one, again counting.
Described expected frequency count value and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and described expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band step is specially:
If described current output frequency count value is little, then calculate the difference between described expected frequency count value and the current output frequency count value, be labeled as second difference, more described second difference and first difference, if described first difference is little, then current output band value is subtracted one and be defined as switch of frequency band, if described first difference is big, then current output band is defined as switch of frequency band.
Described according to described magnitude relationship, the step of adjusting current output band is specially:
If described current output frequency count value is little, then calculate the difference between described expected frequency count value and the current output frequency count value, be labeled as the 3rd difference, and current output band value is subtracted one, again counting.
Described expected frequency count value and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and described expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band step is specially:
If described current output frequency count value is big, then calculate the difference between described current output frequency count value and the expected frequency count value, be labeled as the 4th difference, more described the 4th difference and the 3rd difference, if described the 3rd difference is little, then current output band is added one and be defined as switch of frequency band, if described the 3rd difference is big, then current output band is defined as switch of frequency band.
The present invention also provides a kind of frequency band switched system for phase-locked loop, and described system comprises:
Pulse generator was used for output duty cycle and was 50% time pulse control signal time rating;
Counter is used under the high level control of described pulse generator output time rating the frequency behind the voltage controlled oscillator frequency division being counted;
First counting judge module, be used for judging whether the current output frequency count value of voltage controlled oscillator is the count value first time, if, then judge the magnitude relationship of described current output frequency count value and expected frequency count value, calculate the difference of described expected frequency count value and current output frequency count value, in the voltage controlled oscillator frequency band distribution table that sets in advance, find corresponding frequency band according to described difference, the described frequency band that finds is sent to described logic controller;
Logic controller, for the current output frequency count value of the voltage controlled oscillator of exporting according to described counter and the magnitude relationship of expected frequency count value, adjust current output band, determine and described expected frequency between two frequency bands up and down of frequency-splitting minimum, more described expected frequency count value and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and described expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band, export described switch of frequency band.
Described logic controller comprises:
Judge module is used for current output frequency count value and the expected frequency count value of the voltage controlled oscillator of the described counter output of reception, and judges the magnitude relationship of described current output frequency count value and expected frequency count value, sends judged result;
Adjust determination module, be used for the judged result that sends according to described judge module, adjust current output band, determine with described expected frequency between two frequency bands up and down of frequency-splitting minimum, send described about two frequency bands;
Compare determination module, be used for receiving described two frequency bands up and down, more described expected frequency count value and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and described expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band, send described switch of frequency band;
Handover module is used for current output band is switched to the frequency band that receives.
Described logic controller also comprises the inspection module, be used for to check that whether the absolute value of difference of frequency band of the current output band value of described voltage controlled oscillator and initial decision is greater than 2.
The present invention utilizes expectation frequency count and the count difference value of voltage controlled oscillator center frequency-band between the frequency of oscillation under the fixing control voltage, put in place frequency band one step of voltage controlled oscillator is whole, save many unnecessary comparisons and adjustment, save frequency band switching time greatly, improved the frequency band switch speed.
Embodiment
In order to understand the present invention in depth, the present invention is described in detail below in conjunction with drawings and the specific embodiments.
The count value of the present invention elder generation inspection center frequency band in the fixing control following stipulated time of voltage compares itself and expected frequency count value, and difference is taken out; Control information between the frequency band of recycling voltage controlled oscillator post-simulation, search uniformly-spaced frequency band of the ideal corresponding with this error, thereby realized switch of frequency band rapidly and accurately, shortened the start-up time of phase-locked loop, reduced the startup power consumption, can be widely used in the wide band receive-transmit system.
Referring to Fig. 6 and Fig. 7, the embodiment of the invention provides a kind of frequency band changing method for phase-locked loop, and this method comprises the steps:
Step 101: after the enabling signal high level arrives, trigger the frequency band commutation circuit and start working;
The frequency switching circuit original frequency is selected in the voltage controlled oscillator centre frequency, and control voltage of voltage-controlled oscillator is made as fixed value in whole frequency is switched; After time rating, pulse generator was triggered, the Fractional-N frequency device sum counter of voltage controlled oscillator was triggered under the time pulse control signal that time rating, pulse generator produced simultaneously; Time rating, the pulse generator output duty cycle was 50% time pulse control signal, when control signal begins counting for the high level hour counter, when control signal became low level, rolling counters forward finished, and will handle in the count results input logic controller;
Step 102: logic controller reads in the count value that counter produces, and checks whether be to read in count value for the first time, if then execution in step 103, otherwise execution in step 105;
Step 103: count value and the expected frequency count value of reading in are for the first time compared, if equate that then execution in step 110, if unequal, then execution in step 104;
If logic controller is to read in count value for the first time, mean that then this count value is the count value of the output frequency of voltage controlled oscillator centre frequency under fixed voltage in the regulation gate time; The cycle of supposing pulse generator output signal time rating is T, and the voltage controlled oscillator frequency divider divides frequency domain N, and then the computing formula of expected frequency count value is as follows:
Step 104: calculate the poor of expected frequency count value and the count value of reading in for the first time, this difference searched in voltage controlled oscillator frequency band distribution table search, after finding the frequency band corresponding with this difference, the initial output band of voltage controlled oscillator is switched to this frequency band, and counter is counted again;
Voltage controlled oscillator frequency band distribution table be by a plurality of be that the count value of tolerance constitutes with the binary code corresponding with frequency band with the difference on the frequency count value, tolerance-difference on the frequency count value sets in advance according to the voltage controlled oscillator post-layout simulation results exhibit;
Step 105: logic controller reads in the count value of counter output, relatively the size of the current output frequency count value of voltage controlled oscillator and expected frequency count value;
Step 1051: if equate that then execution in step 110;
Step 1052: if current output frequency count value is big, illustrate that expected frequency is present in the frequency band under the current output band, then calculate the difference between current output frequency count value and the expected frequency count value, preserve this difference, and current output band added one, counter is counted again, execution in step 106;
Step 1053: if current output frequency count value is little, illustrate that expected frequency is present in the frequency band on the current output band, then calculate the difference between expected frequency count value and the current output frequency count value, preserve this difference, and current output band subtracted one, counter is counted again, execution in step 106;
Step 106: relatively expect frequency count and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and expected frequency between a frequency band of frequency counting difference minimum be switch of frequency band;
Logic controller reads in the count value of counter output again, compares the size of the current output frequency count value of voltage controlled oscillator and expected frequency count value again:
Step 1061: if equate that then execution in step 110;
Step 1062: if current output frequency count value is big, illustrate that expected frequency also is present in certain frequency band under the current output band, execution in step 107; If current output frequency count value is little, illustrate that expected frequency just in time is present in the frequency band of current output band and step 1052 judgement, then calculate the difference between expected frequency count value and the current output frequency count value, the difference of this difference and step 1052 storage is made comparisons, if the difference of step 1052 storage is little, the frequency band that description of step 1052 is judged and the frequency-splitting minimum between the expected frequency, then current output band is subtracted one and be defined as switch of frequency band, carrying out frequency band switches, execution in step 110, if the difference of step 1052 storage is big, frequency-splitting minimum between current output band and the expected frequency is described, then current output band is defined as switch of frequency band, carries out frequency band and switch execution in step 110;
Step 1063: if current output frequency count value is little, illustrate that expected frequency also is present in certain frequency band on the current output band, then execution in step 108; If current output frequency count value is big, illustrate that expected frequency just in time is present in the frequency band that current output band and step 1053 judge, then calculate the difference between current output frequency count value and the expected frequency count value, the difference of this difference and step 1053 storage is made comparisons, if the difference of step 1053 storage is little, the frequency band that description of step 1053 is judged and the frequency-splitting minimum between the expected frequency, then current output band value is added one and be defined as switch of frequency band, carrying out frequency band switches, execution in step 110, if the difference of step 1053 storage is big, frequency-splitting minimum between current output band and the expected frequency is described, then current output band is defined as switch of frequency band, carries out frequency band and switch execution in step 110;
Step 107: current output band is added one, execution in step 109;
Step 108: current output band is subtracted one, execution in step 109;
Step 109: whether the absolute value of the difference of the current output band of inspection voltage controlled oscillator and initial switching output band if then execution in step 111, otherwise again counts execution in step 106 greater than 2;
Step 110: the frequency band search finishes;
Step 111: according to the post-layout simulation results exhibit of voltage controlled oscillator, select the difference on the frequency count value, execution in step 101 again.
In actual applications, present embodiment can be realized by software program, if program does not find switch of frequency band, the meeting output error message, include the reason of makeing mistakes in this information, can search for again according to the adjust frequency estimated value of poor count value of the reason of makeing mistakes.Because present embodiment has certain tolerance to the estimated value of difference on the frequency count value, the estimated value of difference on the frequency count value has taken into account the factor that frequency interval changes in addition, so the estimated value of difference on the frequency count value in very large range all is suitable for.
Present embodiment utilization expectation frequency count and the voltage controlled oscillator centre frequency count difference value between the frequency of oscillation under the fixing control voltage, put in place frequency band one step of voltage controlled oscillator is whole, save many unnecessary comparisons and adjustment, save frequency band switching time greatly, improved the frequency band switch speed.
Referring to Fig. 7, the embodiment of the invention also provides a kind of frequency band switched system for phase-locked loop, and this system comprises:
Pulse generator was used for output duty cycle and was 50% time pulse control signal time rating;
Counter is used under the high level control of pulse generator output time rating the frequency behind the voltage controlled oscillator frequency division being counted;
Logic controller, for the current output frequency count value of the voltage controlled oscillator of exporting according to counter and the magnitude relationship of expected frequency count value, adjust current output band, determine and expected frequency between two frequency bands up and down of frequency-splitting minimum, relatively expect frequency count and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band, the output switch of frequency band.
This system also comprises first counting judge module, be used for judging whether the current output frequency count value of voltage controlled oscillator is the count value first time, if, then judge the magnitude relationship of current output frequency count value and expected frequency count value, calculate the difference of expected frequency count value and current output frequency count value, in the voltage controlled oscillator frequency band distribution table that sets in advance, find corresponding frequency band according to difference, the frequency band that finds is sent to logic controller.
Logic controller comprises:
Judge module is used for current output frequency count value and the expected frequency count value of the voltage controlled oscillator of count pick up device output, and judges the magnitude relationship of current output frequency count value and expected frequency count value, sends judged result;
Adjust determination module, be used for the judged result that sends according to judge module, adjust current output band, determine and expected frequency between two frequency bands up and down of frequency-splitting minimum, send two frequency bands up and down;
Compare determination module, be used for receiving two frequency bands up and down, relatively expect frequency count and the frequency count difference size of two frequency bands under fixed voltage up and down, determine and expected frequency between a frequency band of frequency-splitting minimum be switch of frequency band, send switch of frequency band;
Handover module is used for current output band is switched to the frequency band that receives.
Logic controller also comprises the inspection module, be used for to check that whether the absolute value of difference of frequency band of the current output band value of voltage controlled oscillator and initial decision is greater than 2.
Present embodiment utilizes logic controller, putting in place frequency band one step of voltage controlled oscillator is whole, saves many unnecessary comparisons and adjustment, has saved frequency band switching time greatly, has improved the frequency band switch speed.
The embodiment of the invention can utilize software to realize, for example utilizes C language, assembler language to realize, corresponding software can be stored in the storage medium that can read, for example in the hard disk of computer, the internal memory.
Above-described specific embodiment further describes purpose of the present invention, technical scheme and beneficial effect.Will be appreciated that above said content is the specific embodiment of the present invention only, is not limited to the present invention.All within essence of the present invention and basic principle, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.