Search Terms

Technical Trivia by Dr. FB

Generating “Sawtooth Waves” using
a D/A conversion circuit and a counter IC

Dr. FB

In the previous issue, I manually input a 4-bit digital signal to the R-2R type resistor ladder and measured the output voltage in response to that input signal with a multimeter. (Figure 1). As a result, the 4-bit digital signal starting at 0000 and ending at 1111 and was replaced by an amplitude signal by passing it through a resistor ladder, confirming that a digital-to-analog (D/A) conversion was performed.

This time, I will use ICs to continuously input the input signal to the D/A conversion circuit instead of manually inputting it. The input signal is a 4-bit digital signal starting with 0000 and ending with 1111, the same as the before. I connected an oscilloscope instead of a voltmeter to the output terminal of the D/A conversion circuit and observed the output waveform. I verified that the step-like signal shown in Figure 1 (right) appeared continuously on the screen.

The graph in Figure 1 shows that as the input signal increases from (0000)2 → (0001)2 → (0010)2...→ (1110)2 → (1111)2 and the output voltage also increases from 0 V to 4.68 V by 0.31 V steps. The output voltage is partially stair-stepped, but approximately speaking, it is increasing linearly.

Figure 1. 4-bit Input vs. Output voltage of an resistor ladder

This continuously repeating output voltage is called a "sawtooth wave" because it looks like the teeth of a saw, as shown in Figure 2.

Figure 2. Sawtooth waveform

4-bit binary up-counter IC

In the 4-bit binary counter used in this project, when a clock signal is applied to the input terminal (CK) of the IC, four output terminals QA to QD output binary number from 0000 to 1111 according to the number of clock signals input.

For example, when the first clock signal is input, QA=1, QB=0, QC=0, QD=0, when the second signal is input QA=0, QB=1, QC=0, QD=0, and when the 15th signal is input QA=1, QB=1, QC=1, QD=1. (Here, 1="H" level and 0="L" level.)

The 74HC161 shown in Figure 3 is a 4-bit counter IC. This 74HC161 has four D-FFs (D flip-flops) built into it. The minimum digit of the output terminal is QA and the maximum digit is QD. Each time a clock signal is input, a carry is performed sequentially from QA to QD, changing from 0000 to 1111. The operation of the D-FF is explained in the previous issue of this corner.

Figure 3. Overview of 74HC161

Sawtooth wave generation circuit using 74HC161 and R-2R type resistor ladder

Figure 4 shows the circuit diagram for generating sawtooth waves. IC1 is a 4-bit binary up-counter. IC2a and IC2b are inverters and are composed of the circuit that generate clock signals. In my experiment, I used a 74HC04 inverter. A potentiometer (VR1) is installed to the circuit to vary the oscillation frequency. When a clock signal is input to the CK pin of IC1, a 4-bit signal (0000 to 1111) is output from the QA to QD pins.

By inputting these 4-bit signals from QA to QD into the R-2R type D/A conversion circuit composed of R1 to R8, sawtooth waves appear at this output terminals in accordance with the input-output characteristics of the R-2R type resistor ladder shown in Figure 1 shown above.

Figure 4. "Sawtooth wave" generation circuit using a 4-bit binary counter and an R-2R type resistor ladder.

Experiment circuit

Figure 5 (left) shows the circuit shown in Figure 4 built onto a universal PC board, and Figure 5 (right) shows the waveform observed by connecting an oscilloscope to the output terminals of the D/A conversion circuit. You can see that a sawtooth wave is output on the oscilloscope screen.

Figure 5. Sawtooth wave generator circuit built into a universal board and its output observed on an oscilloscope.

Consideration of the output waveform

The image in Figure 6 (right) is an enlarged version of the image in Figure 5 (right) in the horizontal axis (time axis) direction. Figure 6 (left) shows the result of manually inputting a 4-bit signal and measuring the output voltage with a multimeter. When comparing both (left) and (right) of Figure 6, the results are exactly the same.

Figure 6. Comparison of manual and IC output of resistor ladder.


This time, I conducted an experiment to generate a sawtooth wave using a 4-bit up-counter IC. Many electronic devices that process digital signals also incorporate such D/A conversion circuits. In order to understand the principles of D/A conversion circuits, I think this experiment will be easy to perform since there are not that many parts involved.


Technical Trivia by Dr. FB backnumber

Page Top Home