13.3 Single Chip Oscillators and Frequency Generators
The generation of signals is a basic requirement for a wide variety of applications, thus a number of manufacturers produce a selection of single IC oscillators and frequency generators. Some of these tend to work in the range below 1 MHz and usually require some form of external resistor/capacitor network to set the operating frequency. Other, highly specialized circuits for targeted applications are also available. In this section we shall examine a few of the ICs that are generically referred to as clock generators, voltage-controlled oscillators, phase-locked loops and timers.
Square Wave/Clock Generator
The need for stable, low cost, easy-to-use integrated circuits to generate square waves for clocking needs is widespread. Several companies manufacture such devices. One example is the LTC6900 from Linear Technology. A description sheet with a basic programming formula is shown in Figure 9.3.1 .
The LTC6900 is a 5 volt low power circuit available in an SOT-23 (5 pin) package. It operates from 1 kHz to 20 MHz. The output frequency is programmable via a single resistor and the connection to its divider pin (labeled DIV). The frequency of the master oscillator is given by the equation
(9.3.1)
π π ππ‘ is connected from the power supply pin to the SET pin. Acceptable values range between 10 k Ξ© and 2 M Ξ© . If the DIV pin is grounded, the output frequency will be as calculated. If the DIV pin is left unconnected, the output frequency will be divided by 10 and if the DIV pin is connected to +5 volts, the output frequency will be reduced by a factor of 100. This is summarized graphically in Figure 9.3.2 .
Example 9.3.1
Using the LTC6900, design a 10 kHz square wave oscillator.
10 kHz is well within the range of this IC. To achieve this comfortably, we will need a divide-by-100 setting based on the graph of Figure 9.3.2 . This will require us to tie the DIV pin to +5 volts. The value of π π ππ‘ can be approximated from the graph or computed directly.
Voltage-Controlled Oscillator
A voltage-controlled oscillator (usually abbreviated as VCO) does not produce a fixed output frequency. As its name suggests, the output frequency of a VCO is dependent on a control voltage. There is a fixed relationship between the control voltage and the output frequency. Theoretically, just about any oscillator can be turned into a VCO. For example, if a resistor is used as part of the tuning circuit, it could be replaced with some form of voltage-controlled resistor, such as an FET or a light-dependent resistor/lamp combination. By doing this, an external potential can be used to set the frequency of oscillation. This is very useful if the frequency needs to be changed quickly or accurately swept through some range.
A classic example of the usefulness of a VCO is shown in Figure 9.3.3 . This is a simplified schematic of an analog monophonic musical keyboard synthesizer. The keys on the synthesizer are little more than switches. These switches tap potentials off a voltage divider. As the musician plays up the keyboard, the switches engage higher and higher potentials. These levels are used to control a very accurate VCO. The higher the control voltage, the higher the output frequency or pitch will be.
VCOs can be used for a number of other applications, including swept frequency spectrum analyzers, frequency modulation and demodulation, and control systems. It is also an integral part of the phase-locked loop, as we will see later in this chapter.
An example of a VCO is the LTC6990. It is part of Linear Technology’s TimerBlox series of timer/counter/clock ICs. The series includes clock sources that operate in excess of 100 MHz and timers that switch at multi-hour rates. The LTC6990 operates in the range of just under 500 Hz to 2 MHz. While it can be used for fixed frequency applications, it also makes for a flexible VCO. An overview is shown in Figure 9.3.4 .
Like the LTC6900, the LTC6990 is programmed with as little as one resistor and has a frequency divider option. Unlike its brother, the divider capabilities are much more broad, spanning eight power-of-two settings versus just three decade settings. A basic fixed frequency oscillator is shown at the bottom left of Figure 9.3.4 where the master oscillation frequency is controlled by π π ππ‘ . Standard VCO operation is shown at the bottom right. The LTC6990 also has the option of a high impedance output state, making a total of 16 divider/output possibilities. This set up is programmed typically through the use of two external resistors. The programming table is reproduced in Figure 9.3.5 .
The output state depends on the combination of the Output Enable pin (OE) and the Hi-Z logic. When OE is high, the output will be active. If OE is low and Hi-Z is low, then the output will be held low. Finally, if OE is low and Hi-Z is high, then the output will go to a high impedance state.
The voltage present at the DIVCODE pin sets the frequency divider and the impedance mode. This voltage is interpreted by an internal 4 bit analog-to-digital converter (AD converters are the topic of Chapter Twelve). While it is possible to feed this pin with some external source, the more practical method is to simply create a voltage divider with a pair of 1% tolerance resistors; one tied from the power supply to the DIVCODE pin, and the second connected from DIVCODE to ground.
The master oscillator of the LTC6990 is controlled by the current at the SET pin. Internally, the voltage at this pin is maintained at 1 volt, therefore the frequency can be set by a single resistor, π π ππ‘ , connected from this pin to ground. It can then be divided down to lower frequency. This is essentially the same situation we found with the LTC6900. A 20 π A current (i.e., 50 k Ξ© ) will produce the top rate of 1 MHz. Lower currents (higher resistances) will produce proportionately lower frequencies.
The DIVCODE value will divide this base frequency down further by powers of two. We can express this relation with the following formula,
(9.3.2)
where ππ·πΌπ is found from the table in Figure 9.3.5
The design process starts by identifying the appropriate frequency range. It is best if the desired oscillation frequency is not located at the extremes of any given range. Once a range is determined, the corresponding value for ππ·πΌπ is found, and along with it, the required divider resistor values, π 1 and π 2 . From there it is a simple matter to solve Equation 9.3.2 in terms of π π ππ‘ .
Example 9.3.2
An LTC6990 is connected as shown in Figure 9.3.6 . It is being used as a light-to-frequency converter. That is, the output frequency will be controlled by the amount of light hitting a sensor. The sensor is a CdS (Cadmium Sulfide) cell that is connected in the position of π π ππ‘ . Under low light conditions the cell will produce a high resistance and as the light level increases the resistance drops. Assuming that the cell varies from 500 k down to 60 k, determine the range of output frequencies. First, determine the DIVCODE value. This can be found by computing the voltage divider ratio of π 1 and π 2 , but in this circuit recommended values have been used from the DIVCODE table. By observation, ππ·πΌπ=16 .
Next, we calculate the limit frequencies.
Note that as light levels increase, frequency increases in proportion.
When used in VCO mode, the most important element to remember is that the master oscillator frequency is set by the current coming out of the SET pin, πΌπ ππ‘ , as expressed by the following formula
ππ ππ‘ is kept to 1 volt internally so this reduces to
(9.3.3)
πππ π is then divided down by ππ·πΌπ . The final oscillation frequency may be expressed as
(9.3.4)
Note that πΌπ ππ‘ is exiting the chip. Further, note the frequency of oscillation and πΌπ ππ‘ are directly proportional. Also, keep in mind that the πΌπ ππ‘ variation, and hence, the frequency variation, should be kept to 16:1 for best performance, where the maximum value of πΌπ ππ‘ is 20 π A. A simple method for obtaining voltage control is shown in Figure 9.3.4 . There are some potential issues here. First, the range of voltage from the control circuit may not be able to achieve the desired frequency with that circuit. Second, note that higher control voltages will produce lower output frequencies, that is, an inverse relation. This can be an issue in some applications. Consequently, we shall examine a more generic method of controlling the circuit through the use of an external op amp for scaling and offsetting.
The circuit of Figure 9.3.7 presents a method of mapping the existing control voltage onto the LTC6990 or any similar VCO. In this circuit a simple summing amplifier is used for scaling and offsetting. The control voltage, ππΆ , is scaled by one channel of the weighted summer. This signal is offset by a DC voltage, πππππ ππ‘ , fed through another channel. The voltage at the output of the op amp is used to sink current from the VCO via the control resistor, π πΆ . Recall that the SET pin of the IC produces 1 volt internally and it is the exiting current, πΌπ ππ‘ , that sets the master oscillator frequency, as expressed in Equation 9.3.3 . Obviously, the op amp output voltage must be less than 1 volt in order for the op amp to sink current (i.e., in order for πΌπ ππ‘ to be exiting the LTC6990). The voltage difference between the op amp’s output and the 1 volt at the SET pin drops across π πΆ and this is what creates πΌπ ππ‘ . Note that as the control voltage grows more positive at the op amp’s input, its output, and hence πΌπ ππ‘ , also increases. Thus, frequency increases as control voltage increases.
Example 9.3.3
Using Figure 9.3.7 as a guide, design a VCO circuit that will produce output frequencies from 20 kHz through 50 kHz when driven by control voltages from 6 to 8 volts (i.e., 6 volts will produce 20 kHz, 7 volts will produce 35 kHz, 8 volts will produce 50 kHz, etc.)
First, note that the frequency range is 2.5:1. As the LTC6990 can always cover any 8:1 span (as high as 16:1) and the maximum frequency of 50 kHz is well below the LTC6990’s maximum, we know this IC is a good candidate for the design. We now need to determine the divider resistor values. Consulting Figure 9.3.5 shows that we can achieve this range using an ππ·πΌπ of 4, 8 or 16. Choosing the middle value, and assuming we don’t care about Hi-Z state, we arrive at DIVCODE=3 with π 1 =1 M Ξ© and π 2 =280 k Ξ© .
Our frequency range is 2.5:1 which means that our πΌπ ππ‘ range must also be 2.5:1. For convenience, choose the op amp’s output to be 0 volts for the minimum frequency. This will yield 1 volt across π πΆ and occurs when the control voltage into the op amp is at its 6 volt minimum. When the control voltage is at its maximum of 8 volts we’ll need 2.5 volts across π πΆ (i.e., 2.5 times the prior πΌπ ππ‘ ). This means that the op amp’s output must go to -1.5 volts. Note that a 2 volt change in the input control voltage will produce a 1.5 volt change at the op amp’s output. Thus, the gain of this channel is -0.75. If we choose π π =100 k Ξ© then π π =75 k Ξ© .
At this point we need to add an offset. With only the gain scaling, the 6 volt ππΆ produces -0.75 times 6, or -4.5 volts, and a ππΆ of 8 volts similarly produces -6 volts. Consequently, we need to add a +4.5 volt offset to the output. If we tie πππππ ππ‘ to the op amp’s -15 volt power rail then we will need a gain of 4.5/(-15), or -0.3. With an π π of 100 k Ξ© , π π must be 333.3 k Ξ© (the nearest 1% standard value is 332 k Ξ© ).
Finally, to determine π πΆ , refer to Equation 9.3.4 and solve for πΌπ ππ‘
Using the minimum fosc of 20 kHz yields
This occurs with 1 volt across π πΆ . Therefore π πΆ = 312.5 k Ξ© . Crosschecking, when ππΆ = 8 V, we see 2.5 volts across π πΆ for a current of 8 π A. Inserting this into Equation 9.3.4 yields 50 kHz, our desired maximum frequency.
In closing, note that the way in which the frequency sweeps depends on the wave shape of ππ . If a sinusoid is used, the output frequency will vary smoothly between the stated limits. On the other hand, if the wave shape for ππ is a ramp, the output frequency will start at one extreme and then move smoothly to the other limit as the ππ ramp continues. When the ramp resets itself, the output frequency will jump back to its starting point. An example of this is shown in Figure 9.3.8 . Finally, if the control wave shape is a square, the output frequency will abruptly jump from the minimum to the maximum frequency and back. This effect is shown in Figure 9.3.9 , and can be used to generate FSK (frequency shift key) signals. FSK is used in the communications industry to transmit binary information.
Phase-Locked Loop
One step up from the VCO is the Phase-Locked Loop, or PLL. The PLL is a selfcorrecting circuit; it can lock onto an input frequency and adjust to track changes in the input. PLLs are used in modems, for FSK systems, frequency synthesis, tone decoders, FM signal demodulation, and other applications. A block diagram of a basic PLL is shown in Figure 9.3.10 .
In essence, the PLL uses feedback in order to lock an oscillator to the phase and frequency of an incoming signal. It consists of three major parts; a phase comparator, a loop filter (typically, a lag network of some form), and a VCO. An amplifier may also exist within the loop. The phase comparator is driven by the input signal and the output of the VCO. It produces an error signal that is proportional to the phase difference between its inputs. This error signal is then filtered in order to remove spurious high-frequency signals and noise. The resulting error signal is used as the control voltage for the VCO, and as such, sets the VCO’s output frequency. As long as the error signal is not too great, the loop will be selfstabilizing. In other words, the error signal will eventually drive the VCO to be in perfect frequency and phase synchronization with the input signal. When this happens, the PLL is said to be in lock with the input. The range of frequencies over which the PLL can stay in lock as the input signal changes is called the lock range. Normally, the lock range is symmetrical about the VCO’s free-running, or center, frequency. The deviation from the center frequency out to the edge of the lock range is called the tracking range, and is therefore one-half of the lock range. This is illustrated in Figure 9.3.11 .
Although a PLL may be able to track changes throughout the lock range, it may not be able to initially acquire sync with frequencies at the range limits. A somewhat narrower band of frequencies, called the capture range, indicates frequencies that the PLL will always be able to lock onto. Again, the capture range is usually symmetrical about ππ . The deviation on either side of ππ is referred to as the pull-in range. For a PLL to function properly, the input frequency must first be within the capture range. Once the PLL has locked onto the signal, the input frequency may vary throughout the larger lock range. The VCO center frequency is usually set by an external resistor or capacitor. The loop filter may also require external components. Depending on the application, the desired output signal from the PLL may be either the VCO’s output, or the control voltage for the VCO.
One way to transmit binary signals is via FSK. This may be used to allow two computers to exchange data over telephone lines. Due to limited bandwidth, it is not practical to directly transmit the digital information in its normal pulse-type form. Instead, logic high and low can be represented by distinct frequencies. A square wave, for example, would be represented as an alternating set of two tones. FSK is very easy to generate. All you need to do is drive a VCO with the desired logic signal. To recover the data, the reception circuit needs to create a high or low level, depending on which tone is received. A PLL may be used for this purpose. The output signal will be the error signal that drives the VCO. The logic behind the circuit operation is deceptively simple. If the PLL is in lock, the output frequency of its VCO must be the same as the input signal. Remembering that the incoming FSK signal is itself derived from a VCO, for the VCOs to be in lock, they must be driven with identical control signals. Therefore, the control signal that drives the PLL’s internal VCO must be the same as the control signal that originally generated the FSK signal. The PLL control signal can then be fed to a comparator in order to properly match the signal to the following logic circuitry.
Along the same lines as the FSK demodulator is the standard FM signal demodulator. Again, the operational logic is the same. In order for the PLL to remain in lock, its VCO control signal must be the same as the original modulating signal. In the case of typical radio broadcasts, the modulating signal is either voice or music. The output signal will need to be AC coupled and amplified further. The PLL serves as the intermediate frequency amplifier, limiter, and demodulator. The result is a very cost-effective system.
Another usage for the PLL is in frequency synthesis. From a single, accurate signal reference, a PLL may be used to derive a number of new frequencies. A block diagram is shown in Figure 9.3.12 . The major change is in the addition of a programmable divider between the VCO and the phase comparator. The PLL can only remain in lock with the reference oscillator by producing the same frequency out of the divider. This means that the VCO must generate a frequency π times higher than the reference oscillator. We can use the VCO output as desired. In order to change the output frequency, all that needs to be changed is the divider ratio. Normally, a highly accurate and stable reference, such as a quartz crystal oscillator, is used. In this way, the newly synthesized frequencies will also be very stable and accurate.
One example of an advanced digital PLL is the LTC6950. This device operates at up to 1.4 GHz and has five outputs. Each of the outputs has an independently programmable divider and VCO clock cycle delay. The input reference frequency is set between 2 MHz and 250 MHz. Due to the multiple outputs and syncing capabilities, this device can be used for large distributed systems that require precisely controlled multiple clocks. Indeed, one device can be used to control several other LTC6950s for very large systems. An example of this would be a system making use of several high-speed high-resolution analog-to-digital or digitalto-analog converters. The accuracy of these devices depends greatly on very accurate and stable clock sources. We will examine analog-to-digital-to-analog conversion in Chapter Twelve.
555 Timer
The 555 timer is a versatile integrated circuit first introduced in the early 1970’s by Signetics. It has remained a popular building block in a variety of applications ranging from simple square wave oscillators to burglar alarms to pulse-width modulators and beyond. In its most basic forms, the one-shot, or monostable, and the astable oscillator, the 555 requires only a handful of external components. Usually, only two capacitors and two resistors are needed for basic functions. The 555 is made by different manufacturers and in a few forms. The 556, for example, is a dual 555. The 555 can produce frequencies up to approximately 500 kHz. The output current is specified as 200 mA, although this entails fairly high internal voltage drops. A more reasonable expectation would be below 50 mA. The circuit may be powered from supplies as low as 5 volts and as high as 18 volts. This makes the 555 suitable for both TTL digital logic and typical op amp systems. Rise and fall times for the output square wave are typically 100 ns.
A block diagram of the 555 is shown in Figure 9.3.13 . It is comprised of a pair of comparators tied to a string of three equal-valued resistors. Note that the upper, or Threshold, comparator sees approximately 2/3 of πππ at its inverting input, assuming no external circuitry is tied to the Control pin. (If the Control pin is unused, a 10 nF capacitor should be placed between the pin and ground.) The lower, or Trigger, comparator sees approximately 1/3 of πππ at its noninverting input. These two comparators feed a flip-flop, which in turn feeds the output circuitry and Discharge and Reset transistors. If the flip-flop output is low, the Discharge transistor will be off. Note that the output stage is inverting, so that when the flip-flop output is low, the circuit output is high. In contrast, if the input to the Reset transistor is low, this will inhibit the output signal. If Reset capabilities are not needed, the Reset pin should be tied to πππ .
Returning to the comparators, if the noninverting input of the Threshold comparator were to rise above 2/3 πππ , the comparator’s output would change state, triggering the flip-flop and producing a low out of the 555. Similarly, if the input to the inverting input of the Trigger comparator were to drop below 1/3 πππ , the comparator’s output would change, and ultimately, the 555 output would go high.
555 Monostable Operation
The basic monostable circuit is shown in Figure 9.39. In this form, the 555 will produce a single pulse of predetermined width when a negative going pulse is applied to the trigger input. Note that the three input components, π ππ , πΆππ , and π· serve to limit and differentiate the applied pulse. In this way, a very narrow pulse will result which reduces the possibility of false triggers. To see how the circuit works, refer to the waveforms presented in Figure 9.40.
Assume that the output of the 555 is initially low. This implies that the Discharge transistor is on, shorting the timing capacitor πΆ . A narrow low pulse is applied to the input of the circuit. This will cause the Trigger comparator to change state, firing the flip-flop, which in turn will cause the output to go high and also turn off the Discharge transistor. At this point, πΆ begins to charge toward πππ through π . When the capacitor voltage reaches 2/3 πππ , the Threshold comparator fires, setting the output low and turning on the Discharge transistor. This drains the timing capacitor, and the circuit is ready for the application of a new input pulse. Note that without the input waveshaping network, the trigger pulse must be narrower than the desired output pulse. The Equation for the output pulse width is
An interesting item to note is that the value of πππ does not enter into the equation. This is because the comparators are always comparing the input signals to specific percentages of πππ rather than to specific voltages.
Example 9.3.4
Determine values for the timing resistor and capacitor to produce a 100 π s output pulse from the 555.
A reasonable choice for π would be 10 k Ξ© .
The nearest standard value would be 10 nF, so a better choice for π might be 9.1 k Ξ© (also a standard value). This pair would yield the desired pulse width quite accurately.
555 Astable Operation
Figure 9.3.16 shows the basic astable, or free-running form, for a square wave generator. Note the similarities to the monostable circuit. The obvious difference is
that the former trigger input is now tied into the resistor-capacitor timing network. In effect, the circuit will trigger itself continually. To see how the circuit works,
refer to Figure 9.3.17 for the waveforms of interest.
Assume initially that the 555 output is in the high state. At this point, the Discharge transistor is off and capacitor C is charging toward Vcc through RA and RB. Eventually, the capacitor voltage will exceed 2/3 Vcc causing the Threshold comparator to trigger the flip-flop. This will turn on the Discharge transistor and make the 555 output go low. The Discharge transistor effectively places the upper end of RB at ground, removing RA and Vcc from consideration. C now discharges through RB toward 0. Eventually, the capacitor voltage will drop below 1/3 Vcc. This will fire the Trigger comparator, which will in turn place the circuit back to its initial state, and the cycle will repeat.
The frequency of oscillation clearly depends only on C, RA, and RB. The time periods are
This results in a frequency of
The duty cycle is normally defined as the high time divided by the period. The 555 documentation often reverses this definition, but we will stick with the industry norm.
A quick examination of the duty cycle Equation shows that there is no reasonable combination of resistors that will yield 50% duty cycle, let alone anything smaller. There is a simple trick to solve this problem, though. All you need to do is place a diode in parallel with RB as illustrated in Figure 9.3.18 . The diode will be forward biased during the high time period and will effectively short out RB. During the low time period the diode will be reverse-biased, and RB will still be available for the discharge phase. If RA and RB are set to the same value, the end result will be 50% duty cycle. Of course, due to the non-ideal nature of the diode, this will not be perfect, so some adjustment of the resistor values may be in order. Further, note that if π π΄ is also replaced with a potentiometer (and perhaps a series limiting resistor) a tunable square wave generator will result.
Example 9.3.5
Determine component values for a 2 kHz square wave generator with an 80% duty cycle. First, note the period is the reciprocal of the desired frequency, or 500 π s.
For an 80% duty cycle, that yields
Choosing π π΅=10πΞ© ,