New Digitally Controlled Programmable Attenuators for Frequencies Up to 40 GHz

Fairview Microwave recently released a new family of digitally controlled programmable attenuators with performance up to 40 GHz and up to 60 dB attenuation range with 0.03 dB minimum step size. The digitally controlled attenuators adjust the amplitude of signal levels in a variety of applications (e.g., electronic warfare, aerospace communication systems, and test/measurement systems). The designs utilize PIN diode semiconductor technology that generates extremely fast switching performance between attenuation states over wide frequency bands.  Fairview-Attenuators-SQ

Features and specifications:

  • The integrated TTL driver logic control bit circuitry ranges from 5 to 10 binary bits.
  • The command control interface is via a 15-pin female Micro-D socket or USB connector.
  • The circuits are enclosed in environmentally sealed metal packages with epoxy paint finish with either stainless steel SMA or 2.92-mm connectors.
  • Guaranteed operating performance covers a temperature range of –50°C to 85°C.

All the models available in-stock and ready for immediate shipment.

Source: Fairview Microwave

Analog Filter Essentials

Analog frequency-selective filters are useful for noise reduction, antialiasing before digitizing a signal, frequency response correction, and more. In this article, Circuit Cellar columnist Robert Lacoste explains the differences between filters and how to design them with computer-aided tools.

The following article by Robert Lacoste appears in Circuit Cellar 307, 2016.

Welcome back to the Darker Side. I spoke about operational amplifiers (op-amps) in my last few columns. Op-amps shine in plenty of applications—in particular, to build active filters. This month, I’ll focus on filters—more precisely, analog frequency-selective filters, which are used in audio devices, as well as for noise reduction, antialiasing before digitizing a signal, separation of frequency-multiplexed signals, frequency response correction, and so on.

So analog filters must be in the bag of tricks of any designer. Unfortunately, filter design, or even their use, is often perceived as a difficult task close to black magic. This is, well, unfortunate. Filters are definitively useful, simple, and even fun. I bet a textbook about filters full of math would bore you, right? Well, relax. My goal for this article is more pragmatic. I will try to help you to specify a filter, understand the main filter variants, and efficiently use some great computer-aided design tools. I promise, no Laplace transforms or poles or zeros, just electronics.


Let’s start with some vocabulary. By definition, a filter is a circuit that attenuates some signals more than others, depending on their frequency. Figure 1 depicts the most classic filter types. A low-pass filter lets the low frequencies pass through, but attenuates high-frequency signals. It is perfect for removing high-frequency noise on a signal coming from a sensor.

FIGURE 1: Four classic types of frequency filters. Each one attenuates a specific frequency range.

FIGURE 1: Four classic types of frequency filters. Each one attenuates a specific frequency range. Click image to enlarge.

Conversely, a high-pass filter attenuates the low frequencies, and could in particular remove any DC component of a signal. Band-pass filters are a combination of both, and they attenuate all frequencies below or above a given range. For example, any radio frequency receiver is a band-pass filter, providing attenuation of all signals except for frequencies close to its preset frequency. Lastly, a band stop filter, often called a notch filter, does the opposite, and it attenuates a selected range of frequencies. For example, a 50- or 60-Hz notch filter is included in virtually every weight scale to remove EMC perturbations from the surrounding power lines.

Want to specify a filter? Figure 2 illustrates this on a low-pass filter. The first parameter is the filter cut-off frequency, of course. By definition, this is the frequency at which the filter attenuates the power of the signal by 50%. This means that the losses of the filter will be 3 dB at that frequency. Aren’t you fluent with decibels? A decibel is one tenth of a Bel, and a Bel is the base-10 logarithm of the ratio of two powers. Take your calculator and enter 10 × log(0.5), you will get –3.01, which everybody rounds to –3 dB.

FIGURE 2 A filter (low-pass in this case) is specified by its cutoff frequency f3dB, its ripple in the pass-band, and its rejection in the stopband.

FIGURE 2: A filter (low-pass in this case) is specified by its cutoff frequency f3dB, its ripple in the pass-band, and its rejection in the stopband. Click image to enlarge.

But perhaps an attenuation of 3 dB is already too much for your application. The maximum tolerated variation of signal power in the pass-band (here from DC to fPB) is called the ripple of the filter. Lastly, you will very probably want to specify that the filter must provide a given minimum attenuation, called rejection, above some frequency fSB. Of course, these specifications must be established with care. If you decide that you need a filter with 0.01 dB of ripple up to 10 kHz and 100 dB of rejection from 11 kHz upward, you will probably need plenty of time and cash for the design.


I propose to start with the most basic designs: RC filters. The basic low-pass filter is built with one series resistor and one capacitor to ground (see Figure 3). The capacitor impedance gets lower when the frequency increases, and the signal power is attenuated. This filter is called a first-order filter, and it provides an attenuation of 6 dB per octave or 20 dB per decade. (. Simply because 23.33 = 10, and 3.33 × 6 = 20.) That means that, above its cut-off frequency, its attenuation is increased by 6 dB each time the frequency is doubled, or by 20 dB each time it is multiplied by 10. I did the simulation for you with Labcenter Electronics Proteus. Figure 3 shows the result. You can do the same with any Spice-based simulator like the free LT-Spice. The attenuation of this RC filter is –20 dB at 100 kHz, and 20 dB more, meaning –40 dB, at 10 × 100 kHz = 1 MHz as expected.

FIGURE 3 A first-order RC filter (top) provides an attenuation of 20 dB/decade (green curve), whereas a second-order filter provides 40 dB/decade (red).

FIGURE 3: A first-order RC filter (top) provides an attenuation of 20 dB/decade (green curve), whereas a second-order filter provides 40 dB/decade (red). Click image to enlarge.

Such a RC filter can be designed for any cutoff frequency. Just select the proper values for R and C. You might wonder how to calculate the values of the R and C. For a single RC cell, it is really easy. The cutoff frequency is 1/(2pRC).

If you want to increase the steepness of the attenuation, you can chain several RCs. For example, I simulated a second-order RC filter, with two RC cells in series (see Figure 3). As expected, the attenuation is now 12 dB (i.e., 2 × 6) per octave, or 40 dB (i.e., 2 × 20) per decade. Nothing magic. The 3-dB cutoff frequency is pushed downward as compared to a single RC cell, simply because at the 3-dB cutoff of each cell the attenuation is now 6 dB. However, you can see in the graph that even if the falloff in high frequencies is two times better, the drop around the cutoff frequency isn’t improved: it is still “soft.” That’s a limitation of cascaded RC cells. I will present you with a better solution.

Maybe a low-pass filter isn’t what you need. If you prefer a high-pass filter, then just exchange capacitors and resistors. A series capacitor and a resistor to ground would make it. Do you want a band-pass? Just put a low-pass cell in series with a high-pass cell with the appropriate cutoff frequencies. For example, a 10-to-50-kHz band-pass can be built with a 10-kHz high pass and a 50-kHz low pass. And for a notch filter? Do the same with the two filters in parallel. With the same example, a 10-to-50-kHz band stop may be implemented with a 10-kHz low pass and 50-kHz high pass in parallel. Easy.


For a given filter performance, is it possible to build a passive analog filter with fewer parts than a multicell RC filter and with improved performance? Yes, you can use LC filters. Here the filter is made with capacitors and inductors, as illustrated in Figure 4. How steep can be their attenuation profile? Very easy. It is the same in the case of RC filters. Count the number of capacitors, add the number of inductors, and you’ll get the order or the filter. Then multiply by 6 dB to get the attenuation per octave, or by 20 dB for an attenuation per decade! For example, the first filter simulated in Figure 4 has one inductor and one capacitor. Two parts, so it is a second-order filter, with the same 40 dB/octave attenuation as the dual RC example in Figure 3. The bottom example has three capacitors and two inductors; therefore, its attenuation is 100 dB (i.e., 5 × 5) per decade or 30 dB (i.e., 5 × 6) per octave. I promise. It’s simple!

FIGURE 4: This simulation shows the frequency response of three LC filters, respectively, of order two, three, and five from top to bottom. Their outputs are open-ended, which imply some overshoot.

FIGURE 4: This simulation shows the frequency response of three LC filters, respectively, of order two, three, and five from top to bottom. Their outputs are open-ended, which imply some overshoot. Click image to enlarge.

Well, nearly. Let’s now see the small details. If you refer back to Figure 4, you’ll see that such LC filters have a weird response around their cutoff frequencies. There is an overshoot, which means they have a positive gain at some frequencies. Of course, such passive filters can’t “create energy.” This positive gain is due to the fact that their output is open-circuited so no energy actually flows anywhere. Don’t be confused. This is not an artifact of the simulation. This would be exactly the same on an actual circuit. The amplitude of the overshoot is directly linked to the so-called quality factor of the L and C parts, and in particular their series resistance. If the capacitor and inductors are ideal, then the overshoot will be infinite at the frequency where the L and C oscillate. That’s why I added a small 47-Ω series resistor on the simulations. If you change the value of this series resistor, then the shape of the gain curve changes. I illustrated it in Figure 5 (top graph) which shows a series resistor ranging from 5 to 100 Ω.

FIGURE 5: The top simulation shows the frequency response of an open-ended LC filter with varying serial resistor value. The bottom simulation shows that the overshoot disappears when the filter is connected to a matched load. X varies from 5 to 100 Ω.

FIGURE 5: The top simulation shows the frequency response of an open-ended LC filter with varying serial resistor value. The bottom simulation shows that the overshoot disappears when the filter is connected to a matched load. X varies from 5 to 100 Ω. Click image to enlarge.

How do you avoid such oscillations? Simply connect the filter’s output to a proper load. If you are a regular reader of my columns, you won’t be surprised: this load must provide an impedance matching with the source impedance. Look at the second example in Figure 5. I added a load resistor R3 of the same value as the source resistor R2 (denoted X). I then asked the simulator to show the resulting gain versus frequency graph with different values for these resistors X, ranging from 5 to 100 Ω again. The shapes are varying, but there are no overshoots. Moreover a precise resistor value provides a very clean and flat response, linked of course with the values of the L and C parts. This value, here 50 ohm, is the characteristic impedance of the LC filter.

So LC filters must be calculated to get the required frequency response but also taking into account the impedance of the load. For second order filters, using just one inductor and one capacitor, the calculation are straightforward. The cutoff frequency is f3dB = 1/[2p√(LC)], and the characteristic impedance is Z = √(L/C). If you know the required cutoff frequency and designed impedance, then you can easily calculate L and C from these two formulas.

The calculation is not so straightforward for higher-order filters, especially as the design choices are numerous. More on that below. Our ancestors used the abacus; now we can use web-based design tools. (Refer to the Resources section of this article for some links to free LC filter calculators.) There is even a great design tool from Coilcraft that allows you to directly order the samples of the required inductors with a mouse click. Easy, I promised.


Using inductors often isn’t pleasant. They can be heavy and large, and they’re always significantly more expensive than capacitors and resistors. Moreover, inductors are often quite far from ideal components. They can have a high series resistance as well as parasitic capacitance, nasty electromagnetic compatibility behavior, and a couple of other issues. How can you keep the performance of an LC filter without using inductors? With an active filter, usually built around our dear friend the op-amp.

There are basically three ways to build an active filter. The first is to simply add an amplifier to the RC filters I’ve already talked about. For example, you can add a voltage follower after an RC cell in order to reduce its output impedance or to provide some gain. You can also wire an op-amp as a differentiator or integrator, which are first-order filters.

The second solution is to build a switched-capacitor filter circuit. (I devoted my Circuit Cellar 277 column to the subject.) So let’s talk about the third option, which is based on so-called gyrators. What is that? A gyrator is a circuit that mimics the behavior of an inductor, using an op-amp and only resistors and capacitors. You will find plenty of literature on the subject. Of course, this is explained in the bible, Paul Horowitz and Winfield Hill’s The Art of Electronics, but Rod Elliott provides a clear presentation on the subject in “Active Filters Using Gyrators – Characteristics, and Examples,” (Elliott Sound Products, 2014).

Look at Figure 6 where I have illustrated the basic concept. The top part of the schematic is a classic second-order LC high-pass filter with matched source and load impedances. I used a 390-nF capacitor and a 1-mH inductor, resulting in a cutoff frequency of 8 kHz and a characteristic impedance of 50 Ω—here roughly matched with source and load 56-Ω resistors.

FIGURE 6 This simulation shows the transformation of an LC high-pass filter (top) into a gyrator-based circuit (middle), which is really close to the common Sallen Key filter (bottom).

FIGURE 6: This simulation shows the transformation of an LC high-pass filter (top) into a gyrator-based circuit (middle), which is really close to the common Sallen Key filter (bottom). Click image to enlarge.

The response curve shows noting surprising with a 40 dB/decade (i.e., 2 × 20) attenuation in the stopband. Its gain is –6 dB in the passband, as the voltage is divided by two due to the source and load resistors. (The power is divided by 22 = 4, giving –6 dB.) Now look at the middle section of the schematic in Figure 6. The circuit is exactly the same, but I replaced the inductor with an op-amp, a capacitor, and two resistors. That’s a gyrator. If you look now at the resulting graph, you will see that its frequency response is exactly the same as the LC version, at least up to 1 MHz where the characteristics of the op-amp start to be limiting.

Now another magic trick. Compare the gyrator-based schematic with the schematic at the bottom of Figure 6. If you move the parts and the wires around, you will see that they are exactly identical, except the output is now directly connected to the op-amp output. Do you recognize the new schematic? It is a Sallen-Key second-order active high-pass filter. I modified the part values to a more reasonable range, but you can see that the output frequency response is still the same. More precisely, it doesn’t suffer from the 6-dB losses as the signal is taken directly at the output of the op-amp. So Sallen-Key filters, gyrator-based filters, and LC filters are more than cousins.


If you want to design a single-cell filter, either a first-order RC filter, a second-order LC, or an active filter, then you will not have a lot of design choices. You can select the desired filter type, cutoff frequency, and impedance, but nothing more. However, for higher-order filters, the choices are wider. The filter is made of several cells, and you can tune each cell separately. Therefore, you will have a better attenuation curve thanks to the higher order (remember, 6 dB per octave multiplied by the order of the filter), as well as more control on the shape of the filter.

Nothing prevents you from designing your own filter, tweaking each cell however you want. However, mathematicians have already calculated several “optimal” filters for certain applications. Do you want to have a response curve as flat as possible in the passband? Stephen Butterworth calculated it for you in 1930. It’s now called the Butterworth filter, of course. Do you prefer to attenuate as quickly as possible the stop-band even if it implies a higher level of ripple in the pass-band? Use a Chebyshev filter, derived from the Chebyshev polynomials. More precisely, this is a family of filters based on the acceptable ripple (e.g., 0.5 dB). The so-called elliptic filters are close.

The last common variant, the Bessel filter, is a little more complex. A Bessel filter is not a great option both in terms of flatness and attenuation; however, it has a key advantage in the time domain. Its so-called group delay is nearly flat. That brings us a little too far here, but these characteristics preserve the shape of the filtered signals in the time domain. I will tackle that subject in another article.

Of course, each variant has drawbacks. For the same filter complexity, a higher ripple in the passband must be accepted to get a higher attenuation in the stop-band. Similarly, a better phase flatness implies a worse frequency response. Life is difficult, but you are the designer, so you have the control. Figure 7 shows the characteristic responses of each filter variant.[1] For more information, I strongly encourage you to have a look at the “Analog Filters” chapter in Hank Zumbahlen’s Linear Circuit Design Handbook (Analog Devices, 2008).

FIGURE 7: These plots show the typical frequency and time (step and impluse) response of the three most common filter variants. (Source: Linear Circuit Design Handbook, Analog Devices)

FIGURE 7: These plots show the typical frequency and time (step and impluse) response of the three most common filter variants. Click image to enlarge. (Source: Linear Circuit Design Handbook, Analog Devices)


So you have plenty of options when designing a filter. Fortunately, there are great computer-based design tools made for the design engineer. Some are expensive, but plenty are free. In particular, several op-amp suppliers offer filter design tools for their products. I like Analog Devices’s Analog Filter Wizard ( It’s powerful and doesn’t require a PC installation. Other solutions include Texas Instruments’s Webench Filter Designer, Microchip Technology’s FilterLab, Linear Technology’s FilterCAD, and some others.

FIGURE 8 With a tool like the Analog Filter Wizard (Analog Devices), life is easy

FIGURE 8: With a tool like the Analog Filter Wizard (Analog Devices), life is easy. Click image to enlarge.

As an example, Figure 8 shows a typical session with Analog Devices’s Analog Filter Design. Basically, you start by selecting the filter type (here a low-pass), the required gain in the pass-band, the cutoff frequency, and the attenuation you want at a given stop-band frequency. A slider enables you to browse through several designs—namely, Chebyshev, Butterworth, and others. The next window enables you select the desired tolerance for the capacitors and resistors and actually draw the filter’s full schematic (of course using an op-amp from the supplier who offered the tool). Lastly, the resulting frequency, phase, and time plots are generated, taking into account the tolerance of the parts. Other options enable you to calculate the power consumption of the design or its noise figure. Of course, the beauty of such a tool is that you can try tens of designs in minutes and select the most adequate for your specifications and budget.


Here we are. As always, I have only scratched the subject’s surface. Anyway, I hope you grasped the key concepts. Go through the content listed in the Resources section of this article, and don’t forget to practice on your own. Maybe you should stop reading this magazine now (don’t forget to come back to the issue later), download one of the filter design tools, and play with the settings. It would be the best way to really understand the difference between a fourth-order Butterworth filter and a third-order Chebyshev filter. Have fun and don’t be afraid of filters.

Robert Lacoste lives in France, near Paris. He has 25 years of experience in embedded systems, analog designs, and wireless telecommunications. A prize winner in more than 15 international design contests, in 2003 he started his consulting company, ALCIOM, to share his passion for innovative mixed-signal designs. His book (Robert Lacoste’s The Darker Side) was published by Elsevier/Newnes in 2009.

Time-of-Flight IC for Distance Measurement & Object Detection

Intersil Corp.’s low-power ISL29501 time-of-flight (ToF) signal processing IC is an object detection and distance measurement solution when combined with an external emitter (e.g., LED or laser) and photodiode. Intended for Internet of Things (IoT) applications and consumer mobile devices, the ISL29501 offers precision long-range accuracy up to 2 m in both light and dark ambient light conditions. You can select an emitter and photodiode and then configure a custom low-power ToF sensing system. intersil ISL29501

The ISL29501’s on-chip emitter DAC with programmable current up to 255 mA enables you to select the desired current level for driving the external infrared (IR) LED or laser. This feature enables optimization of distance measurement, object detection, and power budget. In addition, the ISL29501 can perform system calibration to accommodate performance variations of the external components across temperature and ambient light conditions.

The ISL29501’s main specs and features:

  • On-chip DSP calculates ToF for accurate proximity detection and distance measurement up to 2 m
  • Modulation frequency of 4.5 MH
  • On-chip emitter DAC with programmable current up to 255 mA a
  • On-chip active ambient light rejection
  • Programmable distance zones
  • Automatic gain control
  • 2.7 to 3.3 V Supply voltage range
  • I2C interface supports 1.8- and 3.3-V bus

The ISL29501 is available in a low profile 4 mm x 5 mm, 24-lead TQFN package for $4.87 USD in 1,000-piece quantities. The ISL29501-ST-EV1Z reference design board costs $250.

What Is Correlation?

Interested in learning about correlation and how to implement it in a digital signal processing system? In Circuit Cellar 299, Robert Lacoste addresses the subject without going overboard with complicated mathematics. He explains how a simple correlation calculation can drastically improve a system’s performance.

Imagine a situation in which you have a noisy signal that includes replications of a given pattern. Each replication is more or less accurate, has a varying amplitude, and could be situated anywhere in the signal (see Figure 1). The pattern is known, even if it could have any shape. Also imagine that your boss or client asked you to find an algorithm that will locate each occurrence of the pattern in the signal and give an estimation of its amplitude. Not obvious, right? Well, it’s actually quite easy. This is a classic situation for which you can apply a simple mathematical operation: correlation.

Figure 1: This figure shows a given pattern (top) replicated two times in a noisy signal at different amplitudes (middle). The goal of the game is to identify the two replications (bottom).

Figure 1: This figure shows a given pattern (top) replicated two times in a noisy signal at different amplitudes (middle). The goal of the game is to identify the two replications (bottom).

Before I define correlation and explain how to implement it in a DSP system, let’s cover a few typical applications first. A radar system includes a transmitter and a receiver. The former sends out some pulses. The receiver must recognize the echoed pulses, which each corresponding to an obstacle. That’s exactly what a correlation is made for! Even if a radar is one of the best examples, there are thousands of other possible applications. Want to improve the performance of a sensor with information about the shape of the signal being detected? Use correlation. Need to identify a given vibration on an accelerometer-based system? Correlation is answer once again. The list is endless.


The good news about correlation is that the calculations are quite simple to explain and even simpler to implement in a software-based project or in an FPGA. Since I’m talking about digital systems, you can safely assume that the signal is digitized (by an analog-to-digital converter) and defined by N successive samples. Similarly, the pattern to be found is a set of M successive samples, which are also some numeric values. Let’s assume that the pattern is shorter than the input signal so that M < N. How should you proceed?

The correlation calculation works as follows. Start by positioning the pattern above the first M points of the signal. For each sample of the pattern, multiply the corresponding pattern and signal values and then sum all the results. You’ve got the first point of the correlation. Then shift the pattern by one sample on the right and do the same calculation again to find the second point of the correlation. Continue up to the end of the signal and you’ve got the correlation of the pattern and signal, which has N – M + 1 points in that case. Refer to Listing 1 if you prefer pseudocode to a description (assuming the index are numbered from 0 to N – 1).

Listing 1: This pseudo-code implements the correlation algorithmtion

Listing 1: This pseudo-code implements the correlation algorithm.

Very simple, right? The process is illustrated on Figure 2. How does this calculation answer to our problem? Very simply: The calculated correlation is higher when the signal and pattern matches.

Figure 2: A correlation works by progressively shifting the pattern (middle relatively to the signal (top). At each position, the two curves are multiplied term-by-term and summed, giving one point on the resulting correlation (bottom).

Figure 2: A correlation works by progressively shifting the pattern (middle relatively to the signal (top). At each position, the two curves are multiplied term-by-term and summed, giving one point on the resulting correlation (bottom).

So you have just to locate peaks on the calculated correlation. The position of the peaks shows where the pattern are located in the signal, and their amplitudes are directly proportional to the amplitude of the replica.—Robert Lacoste (Circuit Cellar 299, 2015)

This article appears in Circuit Cellar 299 (June 2015).

RTG4 Radiation-Tolerant FPGAs for High-speed Signal Processing Applications

Microsemi Corp. today announced availability of its RTG4 high-speed, signal-processing radiation-tolerant FPGA family. The RTG4’s reprogrammable flash technology offers complete immunity to radiation-induced configuration upsets in the harshest radiation environments, requiring no configuration scrubbing, unlike SRAM FPGA technology. RTG4 supports space applications requiring up to 150,000 logic elements and up to 300 MHz of system performance.Microsemi RTG4-  3-4view

Typical uses for RTG4 include remote sensing space payloads, such as radar, imaging and spectrometry in civilian, scientific and commercial applications. These applications span across weather forecasting and climate research, land use, astronomy and astrophysics, planetary exploration, and earth sciences. Other applications include mobile satellite services (MSS) communication satellites, as well as high altitude aviation, medical electronics and civilian nuclear power plant control. Such applications have historically used expensive radiation-hardened ASICs, which force development programs to incur substantial cost and schedule risk. RTG4 allows programs to access the ease-of-use and flexibility of FPGAs without sacrificing reliability or performance.

The flexibility, reliability and performance of RTG4 FPGAs make it much easier to achieve this. RTG4 is Microsemi’s latest development in a long history of radiation-tolerant FPGAs that are found in many NASA and international space programs.

Key product features include:

  • Up to 150,000 logic elements; each includes a four-input combinatorial look-up table (LUT4) and a flip-flop with built-in single event upset (SEU) and single event transient (SET) mitigation
  • High system performance, up to 300 MHz
  • 24 serial transceivers, with operation from 1 Gbps to 3.125 Gbps
  • 16 SEU- and SET-protected SpaceWire clock and data recovery circuits
  • 462 SEU- and SET-protected multiply-accumulate mathblocks
  • More than 5 Mb of on-board SEU-protected SRAM
  • Single event latch-up (SEL) and configuration memory upset immunity
  • Total ionizing dose (TID) beyond 100 Krad

Engineering silicon, Libero SoC development software, and RTG4 development kits are available now. RTG4 FPGAs and development kits have already shipped to some of the 120+ customers engaged in the RTG4 lead customer program. Flight units qualified to MIL-STD-883 Class B are expected to be available in early 2016.

Microsemi will present more information on RTG4 FPGAs in a live webinar on May 6 and will also be hosting Microsemi Space Forum events in the U.S., India and Europe starting in June, presenting information on RTG4 FPGAs and the extensive range of Microsemi space products.

Source: Microsemi Corp.

Bit Banging

Shlomo Engelberg, an associate professor in the electronics department of the Jerusalem College of Technology, is well-versed in signal processing. As an instructor and the author of several books, including Digital Signal Processing: An Experimental Approach (Springer, 2008), he is a skilled guide to how to use the UART “protocol” to implement systems that transmit and receive data without a built-in peripheral.

Implementing serial communications using software rather than hardware is called bit-banging, the topic of his article in Circuit Cellar’s June issue.

“There is no better way to understand a protocol than to implement it yourself from scratch,” Engelberg says. “If you write code similar to what I describe in this article, you’ll have a good understanding of how signals are transmitted and received by a UART. Additionally, sometimes relatively powerful microprocessors do not have a built-in UART, and knowing how to implement one in software can save you from needing to add an external UART to your system. It can also reduce your parts count.”

In the excerpt below, he explains some UART fundamentals:

UART stands for universal asynchronous receiver/transmitter. The last three words in the acronym are easy enough to understand. “Asynchronous” means that the transmitter and the receiver run on their own clocks. There is no need to run a wire between the transmitter and the receiver to enable them to “share” a clock (as required by certain other protocols). The receiver/transmitter part of the acronym means just what it says: the protocol tells you what signals you need to send from the transmitter and what signals you should expect to acquire at the receiver.

The first term of the acronym, “universal,” is a bit more puzzling. According to Wikipedia, the term “universal” refers to the fact that the data format and the speed of transmission are variable. My feeling has always been that the term “universal” is basically hype; someone probably figured a “universal asynchronous receiver/transmitter” would sell better than a simple “asynchronous receiver/transmitter.”

Figure 1: The waveform output by a microprocessor’s UART is shown. While “at rest,” the UART’s output is in the high state. The transmission begins with a start bit in which the UART’s output is low. The start bit is followed by eight data bits. Finally, there is a stop bit in which the UART’s output is high.

Figure 1: The waveform output by a microprocessor’s UART is shown. While “at rest,” the UART’s output is in the high state. The transmission begins with a start bit in which the UART’s output is low. The start bit is followed by eight data bits. Finally, there is a stop bit in which the UART’s output is high.

Before you can use a UART to transfer information from device to device, the transmitter and receiver have to agree on a few things. First, they must agree on a transmission speed. They must agree that each transmitted bit will have a certain (fixed) duration, denoted TBIT. A 1/9,600-s duration is a typical choice, related to a commonly used crystal’s clock speed, but there are many other possibilities. Additionally, the transmitter and receiver have to agree about the number of data bits to be transmitted each time, the number of stop bits to be used, and the flow control (if any).

When I speak of the transmitter and receiver “agreeing” about these points, I mean that the people programming the transmitting and receiving systems must agree to use a certain data rate, for example. There is no “chicken and egg” problem here. You do not need to have an operational UART before you can use your UART; you only need a bit of teamwork.

Using a UART is considered the simplest way of transmitting information. Figure 1 shows the form the transmissions must always make. The line along which the signal is transmitted is initially “high.” The transmissions begin with a single start bit during which the line is pulled low (as all UART transmissions must). They have eight data bits (neither more nor less) and a single stop bit (and not one and a half or two stop bits) during which the line is once again held high. (Flow control is not used throughout this article.)

Why must this protocol include start and stop bits? The transmitter and the receiver do not share a common clock, so how does the receiver know when a transmission has begun? It knows by realizing that the wire connecting them is held high while a transmission is not taking place, “watching” the wire connecting them, and waiting for the voltage level to transition from high to low, which it does by watching and waiting for a start bit. When the wire leaves its “rest state” and goes low, the receiver knows that a transmission has begun. The stop bit guarantees that the line returns to its “high” level at the end of each transmission.

Transmissions have a start and a stop bit, so the UART knows how to read the two words even if one transmits that data word 11111111 and follows it with 11111111. Because of the start and stop bits, when the UART is “looking at” a line on which a transmission is beginning, it sees an initial low level (the start bit), the high level repeated eight times, a ninth high level (the stop bit), and then the pattern repeats. The start bit’s presence enables the UART to determine what’s happening. If the data word being transmitted were 00000000 followed by 00000000, then the stop bit would save the day.

The type of UART connection I describe in this article only requires three wires. One wire is for transmission, one is for reception, and one connects the two systems’ grounds.

The receiver and transmitter both know that each bit in the transmission takes TBIT seconds. After seeing a voltage drop on the line, the receiver waits for TBIT/2 s and re-examines the line. If it is still low, the receiver assumes it is in the middle of the start bit. It waits TBIT seconds and resamples the line. The value it sees is then used to determine data bit 0’s value. The receiver then samples every TBIT seconds until it has sampled all the data bits and the stop bit.

Engelberg’s full article, which you can find in Circuit Cellar’s June issue, goes on to explain UART connections and how he implemented a simple transmitter and receiver. For the projects outlined in his article, he used the evaluation kit for Analog Devices’s ADuC841.

“The transmitter and the receiver are both fairly simple to write. I enjoyed writing them,” Engelberg says in wrapping up his article. “If you like playing with microprocessors and understanding the protocols with which they work, you will probably enjoy writing a transmitter and receiver too. If you do not have time to write the code yourself but you’d like to examine it, feel free to e-mail me at I’ll be happy to e-mail the code to you.”

Real-Time Processing for PCIe Digitizers

Agilent U5303A PCIe 12bit High-Speed DigitizerThe U5303A digitizer and the U5340A FPGA development kit are recent enhancements to Agilent Technologies’s PCI Express (PCIe) high-speed digitizers. The U5303A and the U5340A FPGA add next-generation real-time peak detection functionalities to the PCIe devices.

The U5303A is a 12-bit PCIe digitizer with programmable on-board processing. It offers high performance in a small footprint, making it an ideal platform for many commercial, industrial, and aerospace and defense embedded systems. A data processing unit (DPU) based on the Xilinx Virtex-6 FPGA is at the heart of the U5303A. The DPU controls the module functionality, data flow, and real-time signal processing. This feature enables data reduction and storage to be carried out at the digitizer level, minimizing transfer volumes and accelerating analysis.

The U5340A FPGA development kit is designed to help companies and researchers protect their IP signal-processing algorithms. The FPGA kit enables integration of an advanced real-time signal processing algorithm within Agilent Technologies’s high-speed digitizers. The U5340A features high-speed medical imaging, analytical time-of-flight, lidar ranging, non-destructive testing, and a direct interface to digitizer hardware elements (e.g., the ADC, clock manager, and memory blocks). The FPGA kit includes a library of building blocks, from basic gates to dual-port RAM; a set of IP cores; and ready-to-use scripts that handle all aspects of the build flow.

Contact Agilent Technologies for pricing.

Agilent Technologies, Inc.

DesignCon 2014 in Santa Clara

DesignCon 2014, an educational conference and technology exhibition for electronic design engineers in the high speed communications and semiconductor fields, will be held in late January at the Santa Clara Convention Center in Santa Clara, CA.

DesignCon is the largest gathering of chip, board, and systems designers in the world and focuses on signal integrity at all levels of electronic design, according to the website

The event features the conference, which runs Tuesday through Friday, January 28–31, and the expo on Wednesday and Thursday, January 29–30.

To see the schedule of planned speakers, tutorials, panel discussions, and other events, click here. Information about passes, prices, and registration can be found here.
For more details or assistance, call (415) 947-6135 or (888) 234-9476 or e-mail

DSP vs. RISC Processors (EE Tip #110)

There are a few fundamental differences between DSP and RISC processors. One difference has to do with arithmetic. In the analog domain, saturation, or clipping, isn’t recommended. But it generally comes with a design when, for example, an op-amp is driven high with an input signal. In the digital domain, saturation should be prevented because it causes distortion of the signal being analyzed. But some saturation is better than overflow or wrap-around. Generally speaking, a RISC processor will not saturate, but a DSP will. This is an important feature if you want to do signal processing.

Let’s take a look at an example. Consider a 16-bit processor working with unsigned numbers. The minimum value that can be represented is 0 (0x0000), and the maximum is 65535 (0xFFFF). Compute:

out = 2 × x

where x is an input value (or an intermediate value in a series of calculations). With a generic processor, you’re in trouble when x is greater than 32767.

If x = 33000 (0x80E8), the result is out = 66000 (0x101D0). Because this value can’t be represented with 16 bits, the out = 2 × x processor will truncate the value:

out = 2 × 333000 = 464(0x01D0)

From that point on, all the calculations will be off. On the other end, a DSP (or an arithmetic unit with saturation) will saturate the value to its maximum (or minimum) capability:

out = 2 × 333000 = 65535(0xFFFF)

In the first case, looking at out, it would be wrong to assume that x is a small value. With saturation, the out is still incorrect, although it accurately shows that the input is a large number. Trends in the signal can be tracked with saturation. If the saturation isn’t severe (affecting only a few samples), the signal might be demodulated correctly.

Generic RISC processors like the NXP (Philips) LPC2138 don’t have a saturation function, so it’s important to ensure that the input values or the size of the variable are scaled correctly to prevent overflow. This problem can be avoided with a thorough simulation process.—Circuit Cellar 190, Bernard Debbasch, “ARM-Based Modern Answering Machine,” 2006.

This piece originally appeared in Circuit Cellar 190, 2006. 

CC279: What’s Ahead in the October Issue

Although we’re still in September, it’s not too early to be looking forward to the October issue already available online.

The theme of the issue is signal processing, and contributor Devlin Gualtieri offers an interesting take on that topic.

Gualtieiri, who writes a science and technology blog, looks at how to improve Improvig Microprocessor Audio microprocessor audio.

“We’re immersed in a world of beeps and boops,” Gualtieri says. “Every digital knick-knack we own, from cell phones to microwave ovens, seeks to attract our attention.”

“Many simple microprocessor circuits need to generate one, or several, audio alert signals,” he adds. “The designer usually uses an easily programmed square wave voltage as an output pin that feeds a simple piezoelectric speaker element. It works, but it sounds awful. How can microprocessor audio be improved in some simple ways?”

Gualtieri’s article explains how analog circuitry and sine waves are often a better option than digital circuitry and square waves for audio alert signals.

Another article that touches on signal processing is columnist Colin Flynn’s look at advanced methods of debugging an FPGA design. It’s the debut of his new column Programmable Logic in Practice.

“This first article introduces the use of integrated logic analyzers, which provide an internal view of your running hardware,” O’Flynn says. “My next article will continue this topic and show you how hardware co-simulation enables you to seamlessly split the verification between real hardware interfacing to external devices and simulated hardware on your computer.”

You can find videos and other material that complement Colin’s articles on his website.

Another October issue highlight is a real prize-winner. The issue features the first installment of a two-part series on the SunSeeker Solar Array Tracker, which won third SunSeekerplace in the 2012 DesignSpark chipKit challenge overseen by Circuit Cellar.

The SunSeeker, designed by Canadian Graig Pearen, uses a Microchip Technology chipKIT Max32 and tracks, monitors, and adjusts PV arrays based on weather and sky conditions. It measures PV and air temperature, compiles statistics, and communicates with a local server that enables the SunSeeker to facilitate software algorithm development. Diagnostic software monitors the design’s motors to show both movement and position.

Pearen, semi-retired from the telecommunications industry and a part-time solar technician, is still refining his original design.

“Over the next two to three years of development and field testing, I plan for it to evolve into a full-featured ‘bells-and-whistles’ solar array tracker,” Pearen says. “I added a few enhancements as the software evolved, but I will develop most of the additional features later.”

Walter Krawec, a PhD student studying Computer Science at the Stevens Institute of Technology in Hoboken, NJ, wraps up his two-part series on “Experiments in Developmental Robotics.”

In Part 1, he introduced readers to the basics of artificial neural networks (ANNs) in robots and outlined an architecture for a robot’s evolving neural network, short-term memory system, and simple reflexes and instincts. In Part 2, Krawec discusses the reflex and instinct system that rewards an ENN.

“I’ll also explain the ‘decision path’ system, which rewards/penalizes chains of actions,” he says. “Finally, I’ll describe the experiments we’ve run demonstrating this architecture in a simulated environment.”

Videos of some of Krawec’s robot simulations can be found on his website.

Speaking of robotics, in this issue columnist Jeff Bachiochi introduces readers to the free robot control programming language RobotBASIC and explains how to use it with an integrated simulator for robot communication.

Other columnists also take on a number of very practical subjects. Robert Lacoste explains how inexpensive bipolar junction transistors (BJTs) can be helpful in many designs and outlines how to use one to build an amplifier.

George Novacek, who has found that the cost of battery packs account for half the DIY Battery Chargerpurchase price of his equipment, explains how to build a back-up power source with a lead-acid battery and a charger.

“Building a good battery charger is easy these days because there are many ICs specifically designed for battery chargers,” he says.

Columnist Bob Japenga begins a new series looking at file systems available on Linux for embedded systems.

“Although you could build a Linux system without a file system, most Linux systems will have some sort of file system,” Japenga says. “And there are various types. There are files systems that do not retain their data (volatile) across power outages (i.e., RAM drives). There are nonvolatile read-only file systems that cannot be changed (e.g., CRAMFS). And there are nonvolatile read/write file systems.”

Linux provides all three types of file systems, Japenga says, and his series will address all of them.

Finally, the magazine offers some special features, including an interview with Alenka Zajić, who teaches signal processing and electromagnetics at Georgia Institute of Technology’s School of Electrical and Computer Engineering. Also, two North Carolina State University researchers write about advances in 3-D liquid metal printing and possible applications such as electrical wires that can “heal” themselves after being severed.

For more, check out the Circuit Cellar’s October issue.



Prevent Embedded Design Errors (CC 25th Anniversary Preview)

Attention, electrical engineers and programmers! Our upcoming 25th Anniversary Issue (available in early 2013) isn’t solely a look back at the history of this publication. Sure, we cover a bit of history. But the issue also features design tips, projects, interviews, and essays on topics ranging from user interface (UI) tips for designers to the future of small RAM devices, FPGAs, and 8-bit chips.

Circuit Cellar’s 25th Anniversary issue … coming in early 2013

Circuit Cellar columnist Robert Lacoste is one of the engineers whose essay will focus on present-day design tips. He explains that electrical engineering projects such as mixed-signal designs can be tedious, tricky, and exhausting. In his essay, Lacoste details 25 errors that once made will surely complicate (at best) or ruin (at worst) an embedded design project. Below are some examples and tips.

Thinking about bringing an electronics design to market? Lacoste highlights a common error many designers make.

Error 3: Not Anticipating Regulatory Constraints

Another common error is forgetting to plan for regulatory requirements from day one. Unless you’re working on a prototype that won’t ever leave your lab, there is a high probability that you will need to comply with some regulations. FCC and CE are the most common, but you’ll also find local regulations as well as product-class requirements for a broad range of products, from toys to safety devices to motor-based machines. (Refer to my article, “CE Marking in a Nutshell,” in Circuit Cellar 257 for more information.)

Let’s say you design a wireless gizmo with the U.S. market and later find that your customers want to use it in Europe. This means you lose years of work, as well as profits, because you overlooked your customers’ needs and the regulations in place in different locals.

When designing a wireless gizmo that will be used outside the U.S., having adequate information from the start will help you make good decisions. An example would be selecting a worldwide-enabled band like the ubiquitous 2.4 GHz. Similarly, don’t forget that EMC/ESD regulations require that nearly all inputs and outputs should be protected against surge transients. If you forget this, your beautiful, expensive prototype may not survive its first day at the test lab.

Watch out for errors

Here’s another common error that could derail a project. Lacoste writes:

Error 10: You Order Only One Set of Parts Before PCB Design

I love this one because I’ve done it plenty of times even though I knew the risk.

Let’s say you design your schematic, route your PCB, manufacture or order the PCB, and then order the parts to populate it. But soon thereafter you discover one of the following situations: You find that some of the required parts aren’t available. (Perhaps no distributor has them. Or maybe they’re available but you must make a minimum order of 10,000 parts and wait six months.) You learn the parts are tagged as obsolete by its manufacturer, which may not be known in advance especially if you are a small customer.

If you are serious about efficiency, you won’t have this problem because you’ll order the required parts for your prototypes in advance. But even then you might have the same issue when you need to order components for the first production batch. This one is tricky to solve, but only two solutions work. Either use only very common parts that are widely available from several sources or early on buy enough parts for a couple of years of production. Unfortunately, the latter is the only reasonable option for certain components like LCDs.

Ok, how about one more? You’ll have to check out the Anniversary Issue for the list of the other 22 errors and tips. Lacoste writes:

Error 12: You Forget About Crosstalk Between Digital and Analog Signals

Full analog designs are rare, so you have probably some noisy digital signals around your sensor input or other low-noise analog lines. Of course, you know that you must separate them as much as possible, but you can be sure that you will forget it more than once.

Let’s consider a real-world example. Some years ago, my company designed a high-tech Hi-Fi audio device. It included an on-board I2C bus linking a remote user interface. Do you know what happened? Of course, we got some audible glitches on the loudspeaker every time there was an I2C transfer. We redesigned the PCB—moving tracks and adding plenty of grounded copper pour and vias between sensitive lines and the problem was resolved. Of course we lost some weeks in between. We knew the risk, but underestimated it because nothing is as sensitive as a pair of ears. Check twice and always put guard-grounded planes between sensitive tracks and noisy ones.

Circuit Cellar’s Circuit Cellar 25th Anniversary Issue will be available in early 2013. Stay tuned for more updates on the issue’s content.





CC267: Continuity of Embedded Tech Content

The October issue features articles on topics ranging from FAT cache to IIR digital filters to a quadcopter that uses a mechanical gyro. Let’s review.

Jeff’s quadcopter uses a mechanical gyro that is “an inexpensive yet elegant attempt to counteract wind gusts.” With its protective shield removed, you can see the motorized spinning rotor that sustains equilibrium as its frame moves.

On page 16, Stuart Oliver details how to use math routines that include the dsPIC hardware features, such as the accumulators and barrel shifter. He uses the math for implementing Assembler routines.

Turn to page 30 to learn how Kerry Imming uses FAT cache for SD card access. You can implement his cache technique in a variety of other applications.

Before you start a new project, familiarize yourself George Novacek’s tips on managing project risk (p. 34). He explains how to define, evaluate, and handle risk. Better yet, why not just reduce risk by avoiding as many problems as possible?

Bob Japenga addresses this issue as well (p. 38). In the third part of his series on concurrency in embedded systems, he details how to avoid concurrency-related problems, which can be difficult because the more concurrency you add to a project, the more complicated it becomes.

Ed Nisley presented a MOSFET tester in his August 2012 article, “MOSFET Channel Resistance.” In this issue, Ed covers temperature measurement, the control circuitry, the firmware’s proportional integral control loop, and more (p. 42).

A fan under the black CPU heatsink keeps it near ambient temperature, so that the Peltier module under the aluminum block can control the MOSFET temperature. The gray epoxy block holds a linearized thermistor circuit connected to the Arduino microcontroller under the PCB. (Source: E. Nisley)

Check out Robert Lacoste’s article on page 58 for an introduction to IIR digital filters. You’ll learn about the differences between IIR filters, FIR filters, and analog filters.

WinFilter allows you to calculate and simulate all kind of IIR filters just by entering their key characteristics (left). The plots shows you the resulting frequency and time behavior. (Source: R. Lacoste)

Working with an unstable mechanical gyro? As Jeff Bachiochi explains, a MEMS system is the solution (p. 68).

Lastly, check out the interview with Helen Li on page 54. You’ll find her impressive research exciting and inspirational.

DIY Solar-Powered, Gas-Detecting Mobile Robot

German engineer Jens Altenburg’s solar-powered hidden observing vehicle system (SOPHECLES) is an innovative gas-detecting mobile robot. When the Texas Instruments MSP430-based mobile robot detects noxious gas, it transmits a notification alert to a PC, Altenburg explains in his article, “SOPHOCLES: A Solar-Powered MSP430 Robot.”  The MCU controls an on-board CMOS camera and can wirelessly transmit images to the “Robot Control Center” user interface.

Take a look at the complete SOPHOCLES design. The CMOS camera is located on top of the robot. Radio modem is hidden behind the camera so only the antenna is visible. A flexible cable connects the camera with the MSP430 microcontroller.

Altenburg writes:

The MSP430 microcontroller controls SOPHOCLES. Why did I need an MSP430? There are lots of other micros, some of which have more power than the MSP430, but the word “power” shows you the right way. SOPHOCLES is the first robot (with the exception of space robots like Sojourner and Lunakhod) that I know of that’s powered by a single lithium battery and a solar cell for long missions.

The SOPHOCLES includes a transceiver, sensors, power supply, motor
drivers, and an MSP430. Some block functions (i.e., the motor driver or radio modems) are represented by software modules.

How is this possible? The magic mantra is, “Save power, save power, save power.” In this case, the most important feature of the MSP430 is its low power consumption. It needs less than 1 mA in Operating mode and even less in Sleep mode because the main function of the robot is sleeping (my main function, too). From time to time the robot wakes up, checks the sensor, takes pictures of its surroundings, and then falls back to sleep. Nice job, not only for robots, I think.

The power for the active time comes from the solar cell. High-efficiency cells provide electric energy for a minimum of approximately two minutes of active time per hour. Good lighting conditions (e.g., direct sunlight or a light beam from a lamp) activate the robot permanently. The robot needs only about 25 mA for actions such as driving its wheel, communicating via radio, or takes pictures with its built in camera. Isn’t that impossible? No! …

The robot has two power sources. One source is a 3-V lithium battery with a 600-mAh capacity. The battery supplies the CPU in Sleep mode, during which all other loads are turned off. The other source of power comes from a solar cell. The solar cell charges a special 2.2-F capacitor. A step-up converter changes the unregulated input voltage into 5-V main power. The LTC3401 changes the voltage with an efficiency of about 96% …

Because of the changing light conditions, a step-up voltage converter is needed for generating stabilized VCC voltage. The LTC3401 is a high-efficiency converter that starts up from an input voltage as low as 1 V.

If the input voltage increases to about 3.5 V (at the capacitor), the robot will wake up, changing into Standby mode. Now the robot can work.

The approximate lifetime with a full-charged capacitor depends on its tasks. With maximum activity, the charging is used after one or two minutes and then the robot goes into Sleep mode. Under poor conditions (e.g., low light for a long time), the robot has an Emergency mode, during which the robot charges the capacitor from its lithium cell. Therefore, the robot has a chance to leave the bad area or contact the PC…

The control software runs on a normal PC, and all you need is a small radio box to get the signals from the robot.

The Robot Control Center serves as an interface to control the robot. Its main feature is to display the transmitted pictures and measurement values of the sensors.

Various buttons and throttles give you full control of the robot when power is available or sunlight hits the solar cells. In addition, it’s easy to make short slide shows from the pictures captured by the robot. Each session can be saved on a disk and played in the Robot Control Center…

The entire article appears in Circuit Cellar 147 2002. Type “solarrobot”  to access the password-protected article.

Modify & Test a Phase Meter Calibrator

Charles Hansen described a DIY phase meter calibrator using all-pass, phase-shift filters in a November 2006 article published in audioXpress magazine. Being able to measure phase angle is often helpful, so I’ll begin by quoting from the beginning of his article:

“A phase angle meter is useful in audio work to determine the phase angle between a reference signal and a phase shifted signal, both having identical time periods. Typical uses include: Finding the phase angle between voltage and current to determine the phase shift and impedance of a loudspeaker over its frequency range. Finding the phase shift between the input and output of a tube amplifier to establish the HF (high frequency) and LF (low frequency) cutoff points needed to avoid instability in feedback amplifiers.”

In addition to these, there are other uses—for example, measuring the phase shift through any active or passive filter which includes equalization networks.

In his design, he chose a set of five calibrations frequencies: 10 Hz, 100 Hz, 1000 Hz, 10 kHz, and 100 kHz. He relied on an external oscillator to drive the calibrator at these input frequencies. I first built the calibrator as described, and then I made some modifications that better suited my needs. But first I will describe how the calibrator works. I think it’s best to just provide a bit more  from Hansen’s article:

“The Phase Angle Calibrator makes use of an op amp filter circuit called the all-pass circuit, which takes a sine-wave input and produces a constant amplitude phase-shifted sine wave output. The lag output version was used in Fig. 1. The theory behind the all-pass filter is available in many reference books and texts, but I found one by Walt Jung [1] that I believe is the easiest for a novice to understand. The phase shift angle is varied by the parallel combination of R3 and R9 through R19 with C3 through C7 in accordance with the formula:

θ = -2 arctan (2ΠRC)

where θ is the phase angle, and f is the frequency. After selecting a suitable value for C, you can solve for R by rearranging the formula:

R = tan(-θ/2) / 2ΠfC

This is hardly a linear relationship. Large changes in resistor value produce very little change in phase angle as you approach 0 or 180 degrees. It’s much easier to apply the input signal to both inputs of the phase angle meter for zero degrees, and use an op-amp inverter to generate the 180 degree signal.”


I added an internal Wein-bridge oscillator to simplify using the calibrator and I changed the set of frequencies to cover just the audio range: 20 Hz, 100 Hz, 1000 Hz, 10 kHz, and 20 kHz. (This range is also easier to cover with a single-range oscillator, the capacitor values stay reasonable.) The actual frequencies, shown in Table 1, vary somewhat from the ideal frequencies because I used standard 1% resistors and 5% capacitors.

Table 1: These are phase calibrator phase-shift measurements. The column labeled “305” refers to the Dranetz model 305 phase meter with 305-PA-3007 plug-in. The column labeled “5245L” refers to the Hewlett-Packard model 5245L frequency counter with a model 5262A time interval unit plug-in. Phase shift measurements at 19.6 kHz are not useful from the HP-5245L counter because the 10-MHz timebase does not provide enough significant figures.

Selecting and matching the capacitors would give closer results, but it’s more important to know what the frequencies are. Because I had already built a circuit board for the calibrator circuit, I used a second circuit board for the oscillator. Figure 1 and Figure 2 are the two circuit diagrams.

Figure 1: Phase angle calibrator using all-pass phase-shift filters. This is a Charles Hansen design, 2005, with circuit board design by the author (PHASECAL.PCB).

Figure 2: Wein-bridge oscillator with lamp amplitude stabilization. Adjust R6 for minimum harmonic distortion. (MAIN115.PCB)

Tables 2 and Table 3 are the parts lists. Please note that the calibrator circuit is unchanged from Hansen’s design, except for the values of the capacitors C3 and C7. In the original, C3 was 470 nF (for 10 Hz) and C7 was 47 pF (for 100 kHz). I put both circuit boards and a ±15-VDC power supply (any regulated supply will suffice) in a Wolgram MC-9 enclosure.

Table 2: Calibrator parts list

Table 3: Wein-bridge oscillator parts list

The completed calibrator is shown in Photo 1 with a Dranetz Phase meter. (More about this later.) The unlabeled knob, lower left in the photo, is an oscillator output level control (R8 in Figure 2), which I added after making the front panel label.

Photo 1: A Dranetz automatic phase meter, model 305, is at the top. The phase meter calibrator is below. The calibrator, a Charles Hansen design, is not a TDL product, but construction details are included in this article.

Wein-bridge oscillator theory is discussed in many textbooks and is rather mathematical. I will describe it as simply as possible. In Figure 2 the oscillation frequency is set by the value of R and C connected between the op-amp non-inverting input (pin 3), the op-amp output (pin 6), and common. For a frequency of 1,000 Hz, C = 22 nF (C3 and C10) and R = 7235 Ω (the series combination of R1 + R2 and R3 + R4). The equation is:

f = 1/(2ΠRC) = 1/(2Π(22 x 10-9) (7235)) = 1000 Hz

For amplitude-stable oscillation to occur, the gain of the op-amp circuit must be 1/3. This is set by the impedance of the RC network and resistors R5, R6 and R7 and the incandescent lamp. The lamp is important because it stabilizes the gain at 1/3. If the output voltage (pin 6) tries to increase, the lamp’s resistance decreases and the output voltage decreases. This works very well, but it takes the output amplitude a small of amount of time to stabilize, especially at low frequencies. The CM6833 lamp is very small, so its thermal time constant is very low and stability happens very quickly. The trimmer pot, R6, is adjusted for minimum distortion in the output signal. You can get rather close by looking at the waveform with a scope, but it’s better to use a distortion analyzer or spectrum analyzer. Spectrum analysis software on a PC is fine, just adjust R6 to minimize the height of the sidebands or use a program that directly displays harmonic distortion.

At 1000 Hz, TrueRTA shows the second harmonic (2000 Hz) down 80 dB (0.01% distortion) with the higher harmonics even lower. AudioTester shows a total harmonic distortion of 0.0105% using the first ten harmonics.

TrueRTA is a spectrum analysis program available from True Audio. Demo versions and a free version (level 1) are available on its website. AudioTester is another spectrum analysis program.


The calibrator should be reasonably accurate when built using the 1% resistors and 5% capacitors in the parts list. But as with any other piece of test equipment, it would be satisfying to make some measurements to be sure. I will describe two methods that I used: all the measured values are presented in Table 1. As you can see, the calibrator is very satisfactory.

One method is to use a calibrated phase meter with an accuracy better than the calibrator. I used a Dranetz model 305 (five-digit phase angle display) with a model 305-PA-3007 plug-in.(The Dranetz phase meter is no longer manufactured but used units may be found on eBay or from used electronic instrument dealers.) This plug-in provides automatic operation for input amplitudes of 50 mV RMS to 50 V RMS and frequencies from 2 Hz to 70 kHz. Automatic operation means there are no operating controls. The plug-in scales the input voltage to the mainframe and provides the correct frequency compensation.

Another method is to use a time interval counter to measure the time between an amplitude zero crossing of the reference signal to the amplitude zero crossing of the phase shifted signal. Phase shift can be calculated from the time interval as:

θ = 360τf/1000

where θ is the phase shift in degrees, time delay τ is in milliseconds, and f is the frequency in hertz.

I used a Hewlett-Packard (HP) model 5245L frequency counter with a model 5262A time interval unit plug-in (see Photo 2).

Photo 2: Hewlett-Packard model 5245L frequency counter with a time interval plug-in unit below and my dual zero-crossing detector above.

The 10-MHz counter timebase gives a time resolution of 0.1 ms. The time interval plug-in has trigger-level controls for each channel but they are not calibrated and can’t accurately set the zero crossing with a sine wave input. The smaller “box” above the counter in the photo is a two-channel zero crossing detector. I designed and built this detector to output a pulse whose leading edge coincides in time with the input zero crossing. The counter measures the time between the leading edges of the two pulses: the reference and the phase shifted signal. The detector circuit diagram (see Figure 3) and parts list (see Table 4) are included. I packaged the Detector circuit board with a simple ±5-V regulated power supply in a Wolgram MC-7A enclosure.

Figure 3: The ual zero-crossing detector circuit board

Table 4: The two-channel zero crossing detector's parts list

Looking at one of the detector’s channels in Figure 3, U1 is an input buffer. Resistors R5, R6, and D1 clip the negative-going half of the input sine wave. The comparator circuit (U2) outputs a very short pulse at the input zero crossing. This pulse is “stretched” by the monostable multivibrator in U3 to about 12 ms as set by the time-constant of C1 and R19. Two front panel toggle switches select either the positive-going or negative-going output pulses. The reference and shifted pulses—45° at 10 kHz—are shown in Photo 3.

Photo 3: The digital storage scope display of reference pulse (above) and phase shifted pulse (below) for 45 degrees of shift at 10 kHz. The pulse width is 12 us. The pulse amplitude is 5 V. Pulse baselines are shifted for clarity.


New phase meters are expensive but used models can sometimes be found on eBay or from used electronic test equipment dealers, just try a Google search. In addition to the Dranetz 305 (which I found on eBay), other useful models include:

  • Aerometrics model PM720 phase meter, 5 Hz to 500 kHz, analog meter display. Aerometrics  denies any association with this unit but it is often listed under this name.
  • Hewlett-Packard model 3575A gain-phase meter, 1 Hz to 13 MHz, four-digit display
  • Wavetek model 750 phase meter, 10 Hz to 2 MHz, four-digit display

In addition, you can find application notes and magazine articles that describe how to build your own phase meter. These are usually fairly simple designs. The following appear to be useful: Intersil Application Note AN9637 (This is identical to Design Idea #1890 that was published in the July 4, 1996 issue of EDN); Elliott Sound Products Project 135; and Salvati, M. J., “Phase Meter Profits From Improvements,” Design Idea, Electronic Design magazine, April 11, 1991.


I sent a copy of this article to Hansen for comments. He agreed that having the oscillator built-in is a good feature. He also commented as follows:

“A problem with my phase meter calibrator design is that the distortion increases with phase shift, and the amplitude drops as well. It might be possible that the zero-crossing detector might be fooled by the higher order distortion harmonics. I’d be interested in what you find out in this regard.”

So, I measured the amplitude drop and distortion at 150°, which should be worst case. I set the 20-Hz variable output to an arbitrary 2.00 V. Keeping the output level control unchanged, I measured what you see in Table 5. This amount of drop seems acceptable.

Table 5: I set the 20-Hz variable output to 2 V, and I kept the output level control unchanges as I measured these.

I used a Hewlett-Packard model 3581A wave analyzer to measure the harmonics. Refer to Table 6. These numbers look acceptable and the zero-crossing detector output at 20 kHz and 150 degrees measures 22 ms on an oscilloscope with a calculated 21.5 ms at the actual frequency of 19.61 kHz.

Table 6: I used a Hewlett-Packard 3581A wave analyzer to measure the harmonics. These numbers are acceptable and the zero-crossing detector output at 20 kHz and 150 degrees measures 22 ms on an oscilloscope with a calculated 21.5 ms at the actual frequency of 19.61 kHz.

I am very satisfied that the calibrator is suitable to troubleshoot and calibrate any phase meter you are likely to find, either new or used. Without overdoing the math, there is enough design information here to allow you to tailor the design to a specific frequency range, keeping in mind the 1000:1 practical frequency range of the Wein-bridge oscillator, without using range switching.

The circuit board designs listed in the parts lists are available in CIRCAD format and are posted on the TDL website. (CIRCAD is a circuit board design program available from Holophase. The boards in the file were designed with Version 4, a free download of which is available on the Holophase website.) The physical boards are not available.

Ron Tipton lives in Las Cruces, NM. Visit the TDL Technology website for more information about his audio designs and services.


[1] Jung, W. and Sams, H., Audio IC Op-Amp Applications, 2nd Edition, Sams Publishing, 1978.

Editor’s note: audioXpress, like, is an Elektor International Media publication.

Laser TV Project: BASCOM Programmers Wanted

Do you have sound programming skills and an interest in assisting a fellow electronics designer with an creative image projection project? If so, the Laser TV Project posted on the “Elektor Projects” website is for you.

The Laser TV Project (Source:

Website editor Clemens Valens writes:

Some people use electronics to build something they need, others just want to find out if something can be done. These projects are often the most fun to read about because of their unusual character and the creativity needed to accomplish the (sometimes bizarre) goal. The laser TV project posted on Elektor Projects is such a project. It is an attempt to project an image by means of 30 rotating mirrors mounted on a VHS head motor. Why you would want to do such a thing is not important, can it be done is the thing that matters.

According to the author the main challenge is the phase synchronization of the top plate on which the mirrors are mounted, and the author is looking for interested BASCOM programmers to develop the motor PLL (or a similar software solution). The motor rotates at 750 rpm and must be precisely synchronized to a pulse, which is available once per revolution.

Do you want to help with this project? Have you done something similar with Atmel and BASCOM? If so, go to and help “hpt” with the project. You can also review other projects and vote. Your vote counts! and are Elektor International Media publications.