Sunday, November 18, 2007

Picking The Right A/D Converter For Your Design

The analog to digital converter is a bridge between the analog and digital world, which is used in a wide range of applications where there is a need to convert the analog signal into the digital data. Based on fundamental architectures, there are several A/D converters. They are:

--> Successive Approximation
--> Sigma-Delta
--> Flash
--> Subranging (Pipelined)
--> Bit-per-stage (Ripple)

There are several factors to consider while selecting an A/D converter for your design. The most important parameters to consider are:

--> Resolution
--> Through-put (Speed)
--> Errors (offset, gain & linearity errors)
--> Monotonacity
--> AC Specifications: Such as Signal To Noise And Distortion (SINAD), Effective Number Of Bits (ENOB), Bandwidth

Let's now recapitulate the definitions of some of these factors as we studied during our engineering. Some of the important specifications of ADC are presented below:

Resolution is the smallest analog increment/decrement corresponding to a 1 LSB converter code change. We express resolution in number of bits.

Throughput Rate is the maximum continuous conversion rate of an ADC. This specification indicate the speed of an ADC. This is often expressed in KSPS (Killo samples per second), MSPS (Mega samples per second).

Offset Error is the difference between ideal LSB transition to the actual transition point. This specification is expressed in LSBs.

Gain Error is the difference between the input voltage just causing a transition to positive fullscale and (Vref - 1.5LSB). This specification is expressed in LSBs or % Full Scale.

Differential Non-Linearity (DNL) is the measure of the maximum deviation from the ideal step size of 1 LSB. DNL is commonly measured at the rated clock frequency with a ramp input and expressed in LSBs.

Intigral Non-Linearity (INL) is a measure of the deviation of each individual code from a line drawn from zero scale or negative full scale (1⁄2 LSB below the first code transition) through positive full scale (1⁄2 LSB above the last code transition). The deviation of any given code from this straight line is measured from the center of that code value. The end point test method is used. INL is commonly measured at rated clock frequency with a ramp input and expressed in LSBs.

Related to DNL are two critical figures of merit used in defining ADC operation They are:

Missing Code are those output codes that are skipped or will never appear at the ADC outputs. These codes cannot be reached by any input value.
Monotonicity - An ADC is monotonic if it continually increases conversion result with an increasing voltage (and vice versa). A nonmonotonic ADC may give a lower conversion result for a higher input voltage, which may also mean that the same conversion may result from two separate voltage ranges. Often, the transfer function will completely miss the lower code until after the higher code is converted (on an increasing input voltage).

Now, some of the important AC (dynamic) specifications of ADC are presented below:

Analog Input Bandwidth is a measure of the frequency at which the reconstructed output fundamental drops 3 dB below its low frequency value for a full scale input. The test is performed with fIN equal to 100 kHz plus integer multiples of fCLK. The input frequency at which the output is −3 dB relative to the low frequency input signal is the full power bandwidth.

Signal To Noise Plus Distortion (SINAD) is the ratio, expressed in dB, of the rms value of the input signal at the output to the rms value of all of the other spectral components below half the clock frequency, including harmonics but excluding dc.

Spurious Free Dynamic Range (SFDR) is the difference, expressed in dB, between the rms values of the input signal at the output and the peak spurious signal. where a spurious signal is any signal present in the output spectrum that is not present at the input.

Intermodulation Distortion (IMD) is the creation of additional spectral components as a result of two sinusoidal frequencies being applied to the ADC input at the same time. It is defined as the ratio of the power in the intermodulation products to the total power in the original frequencies. IMD is usually expressed in dB.

Keeping the above parameters in mind, we are ready to examine various applications for which ADCs are used and then we can sort out the most important parameters relevant to the application areas. Most of the A/D converter applications can be categorized into the following major application areas:
  • Audio
  • Communication (voice band)
  • Data Acquisition & Control
  • Precision Measurement (e.g. Oscilloscope)
  • Image Processing
Now the question arises, how to choose the appropriate A/D converter for a particular application? We can find this out if we can map the ADC parameters relevant to each of the above application areas. The following table shows a relationship between the application areas and the A/D converter parameters important for the respective application areas.

From the Table 1, it can be observed that one parameter of ADC important for one particular application may not be important for other applications. For example, in some of the communication type applications, you're really interested in inter- modulation distortion, whereas in an industrial control loop, that might not factor in as much. You're more interested in the actual linearity or the monotonicity of the converter.

Based on their working principles, each type of ADC has certain advantages, i.e. one ADC category can be superior when compared to their peers based on certain specifications and can be inferior for other parameters. Based on the guidance provided in Table 1 we can concentrate only on the specific parameters important to the respective application area.


On a high level we can classify ADCs according to their suitability for the application categories based only on resolution and sampling rate as depicted in Figure 1. This can serve as a basic guideline for choosing the type of ADC architecture best suitable for the application. Next we can narrow down our choise based on the specifications mentioned in Table 1.

P.S. Kindly post your comments and suggestions for improving the quality of information presented in this article.

Sunday, November 11, 2007

Designing With Digital Logic Families: Basics

The designers of complex digital boards generally deal with multiple supply voltages on their boards. While interfacing the IOs of one device to the other, the designer should make sure that the IO type of the driver is compatible to that of the receiver and the right part is chosen for the right application.

While working with the digital ICs, the first set if parameters we would look at, are the input & output voltage level parameters VOH and VIH. The Figure 1 illustrates the IO voltage levels of some popular logic families. For example, we can directly connect a 5-V CMOS output to a 5-V TTL input, but the vice-versa is not permitted. Again, we can connect a 5-V TTL output to a 3.3-V TTL input, provided the 3.3-V input is 5-V tolerant. Also note that, the families such as AHCT, HCT, ACT, (omitted in Figure 1) can accept 5-V TTL input levels, but drives 5-V CMOS levels. Hence these families can act like bridge between 5-V TTL and 5-V CMOS logic levels. The table 1 below presents a summery of the compatibility chart between the popular logic families.

Please note that '*' mark indicates that the compatibility is possible only if the input stage is tolerant to the maximum voltage output level provided by the driver. The designer also need to calculate the noise margin as below:

Noise Margin Output High = VOH (driver) - VIH (receiver)
Noise Margin Output Low = VIL (receiver) - VOL (driver).

Higher noise margin indicates higher noise immunity. Also note that, negative noise margin indicates a sign of incompatibility.

The next set of important parameters we would like to examine are the "fan-in" and "fan-out". These numbers indicate the sinking and sourcing capabilities of input and output stages. These parameters are calculated as below:

Fan-out Output High = IOH (driver) / IIH (receiver)
Fan-out Output Low = IOL (driver) / IIH (receiver)
As we can see, the above calculations must be made for each of the two logic levels. Naturally, the smaller the resulting numbers determines the actual fan-out. The fan-out calculations can be used not only for the gates of a particular family, but also among different families.

Another important parameter to consider while choosing a logic family is the "propagation delay" or more generically known as speed. This parameter helps in analyzing whether the output timings meet the set-up and hold-up time requirements of the input stage satisfactorily. Again, as the speed increases (i.e. lesser the propagation delay), the power dissipation increases. Hence the "speed-power" product is also important to select the right logic family for the right application.

Some More Things To Remember While Using Digital Logic Families:

  • Connections between ICs and other devices must be kept as short as possible. As the operating frequency increases, the inductance of the long traces plays an important role to induce distortion on the digital signals. If the frequency is high enough, the long traces between these ICs acts like transmission line. Phenomenons such as reflections and ringing can be controlled by using proper termination resistors.
  • Proper decoupling capacitors should be used as close to the VCC pin as possible. This is to avoid power supply glitches due to digital switching.
  • The unused input pins must not be left floating to avoid high current drawn due to oscillation of the floating gates, and possible damage of the IC. Connect the unused inputs to either VCC or ground preferably using resistors in series.
  • Timing analysis must be done to check if set-up/hold-up parameters are violated or met.

P.S. I would like to request to the readers of this article to share their comments, suggestions or correction about this topic in order to enrich this article.



Tuesday, November 6, 2007

Latest Version Of Software Tool May Not be The Best!!!

In the world of programmable logic development tools, the latest may not be the greatest!!!...Do you agree with me? Recently I went through a horrible experience working with Lattice CPLDs & their development tool. A couple of years back, some old CPLD devices were replaced with new CPLDs and the old ABEL codes were re-synthesized using ispLEVER software from Lattice. The re-compiled codes worked fine with the new devices. The designers did not bother to preserve the version of the ispLEVER software tool they used to compile the ABEL codes, since they were only concerned about archiving the source codes and other inout information to the tool.

In the recent past, there was a need to make a minor modification to some of these CPLD codes. By this time, we no more had the version of the ispLEVER software that was used to compile the ABEL codes a couple of years back. I downloaded the latest ispLEVER Classic software from the Lattice website and compiled the same ABEL code with out any changes in it. I downloaded the .jed file to the respective CPLD and to my surprise, the board did not work.

After a lots of hard work, debugging with a logic analyser, I found the root of the problem lied in the new version of the compiler, which mis-interpreted some portion of the ABEL code related to the bi-directional signals. After that, it took a while to fix this by adding some extra pins, board revision etc.

This incident taught me a lesson. When ever I finish a design, I would keep the version of the development tool used for development, archived along with the tool. This would consume more storage space, but would save some time spent in re-work. Again, in a big organization, it may not be always possible to archive each version of tool used for designs. In that case the designer has to be foresighted to be able to write a device architecture independent & synthesis tool independent code using popular HDLs such as VHDL/Verilog or other high level languages such as System C.