BI Technologies R2R Resistor Ladder Networks 8-Bit and 10-Bit R2R resistor ladder networks for DAC and ADC applications. • • • • Auto calibration circuits Slope generators Function generators Motor speed control Model BCN31Ladder 628 Ladder 2512 SO-M 10 Terminal 16 Leads 1K to 100K 1K to 100K Operating Temperature Range oC ± 100 -40oC to +125oC ± 100 -55oC to +125oC Ladder Accuracy 8 Bit: ± 1/2 LSB 8 Bit: ± 1/2 LSB Body Style Number of Leads / Terminals Resistance Range, Ohms Temp. Coefficient, ppm/oC Power Rating Resistor Power 25mW 40mW Package Power 400mW 8-Bit Ladder Networks in dual in line and single in line packages. 10-Bit Ladder Networks in dual in line, single in line and moulded surface mount packages. Please consult factory. Ordering Information BCN 31 Ladder 628 Ladder BCN 31 Ladder 628 Ladder Schematics 640mW Introduction Real world signals are analogue. Digital systems that interface with the real world do so using analogue-to-digital converters (ADC). Conversion back to analogue is accomplished using digital-toanalogue converters (DAC). The R2R ladder network is commonly used for Digital to Analogue conversion and Analogue to Digital conversion by successive approximations. This application note discusses the important parameters that should be considered when implementing DAC designs using an R2R resistor ladder. R2R ladder functional description A basic N bit R2R resistor ladder network is shown in Figure 1. The digital inputs or bits range from the most significant bit (MSB) to the least significant bit (LSB). The bits are switched between either 0V or VREF and depending on the state and location of the bits VOUT will vary between 0V and VREF. The MSB causes the greatest change in output voltage and the LSB causes the smallest. The R2R ladder is inexpensive and relatively easy to manufacture since only two resistor values are required. It is fast and has fixed output impedance R. The R2R ladder operates as an array of voltage dividers whose output accuracy is solely dependent on how well each resistor is matched to the others. The resistors in the R2R network are printed directly onto a single substrate using a single film so they share similar electrical characteristics they are also laser trimmed to provide the necessary precision. These monolithic networks have an inherent accuracy advantage over discrete solutions because of the tight ratio tolerances and low temperature coefficient of resistance tracking. LSB MSB Bit N Bit N - 1 Bit N - 2 Bit 3 Bit 2 Bit 1 2R 2R 2R 2R 2R 2R R 2R R R R R V out R term ination Figure 1. N Bit R2R Resistor Ladder The termination resistor is always connected to ground and insures that the Thevenin resistance of the network, as measured to ground looking towards the LSB (with all bits grounded), is R. The Thevenin resistance of an R/2R ladder is always R regardless of the number of bits in the ladder. Figure 2 shows a common implementation of the R2R resistor ladder network as a Digital to Analogue Converter using an op amp output.This type of DAC is know as a multiplying converter. The output voltage is linearly proportional to the digital input and the range can be adjusted by changing the reference voltage VREF. The source impedance as seen by the op amp is always constant and equal to R regardless of the digital input. The value of R can be made low to charge up the op amp input capacitance quickly and achieve V ref D0 D2 D1 D4 D3 D7 D6 D5 Rf 2R 2R R 2R 2R 2R 2R R 2R R 2R R 2R R 2R V out R R term ination V out =- Rf R ( D0 2 + D1 4 + D2 8 + D3 16 + D4 32 + D5 64 + D6 128 + D7 256 Figure 2. Multiplying converter ) D = 0 or 1 the required bandwidth. As a general rule the op amp bandwidth should be as small as possible (i.e. a low pass filter) to pass only the expected changes in the digital input, any excess bandwidth only adds noise to the output. The op amp should have good stability against temperature changes and supply voltage variations. The digital input is connected to the 2R resistances sometimes by means of a high-speed analogue switch. The digital input voltage at D7 has twice the gain of the digital input at D6, and so on. This can be demonstrated by using a repeated application of Thevenin’s theorem as follows. Consider an input of 1 LSB that is D7 D6 D5 D4 D3 D2 D1 D0 = 00000001 and VREF = 5V. Neglecting the source resistance of the 5V input, Thevenin’s theorem applied to the 5V source and the bottom two 2R resistors replaces them with a 2.5V source in series with a single (Thevenin) resistance of R as shown in Figure 3. Repeated application of Thevenin’s theorem yields the result. The 8-bit resistor ladder network used in this example has an output voltage of 0.0039V for a digital input of 1 LSB. D7 2R D6 2R D5 2R D4 2R D3 2R D2 2R D1 2R D0 2R 2R R R 2R R R R R R R R R R R 2R R 0.625V 2R R 2R R R 2R 2R 2R R R 2R 2R 2R R 2R 2R 2R R 2R 2R 2R R 5V 2R R 2R R 2R R 2R 2.5V 2.5V Figure 3. Repeated application of Thevenin’s theorem Resolution Resolution is the smallest standard incremental change in output voltage of a DAC. An n-bit DAC can decode 1 part in 2n, therefore the LSB carries a weight of 2-n. For example, a DAC with 10-bit resolution can resolve 1 part in 210 or 0.097% of the full-scale output voltage when the binary input code is incremented by one LSB. Accuracy The accuracy of an R2R ladder is the percentage error in the output voltage and is usually expressed in terms of least significant bits. For example, a +/- ½ LSB.specification on an 8-bit ladder is the same as +/- 0.195% full scale accuracy. We define output error as the deviation from an ideal output voltage that would be provided by a perfect reference and DAC. We address absolute accuracy in this application note, this means that everything is referenced to an ideal DAC output-voltage range. For example, a 10 bit DAC code 1023 should produce an output of 1.023V with a reference voltage of 1.024V and any deviation from this is an error. 1. Automatic Circuit Calibration DAC – Air pressure sensor Electronic air pressure sensors are Microprocessor CH1 available at very reasonable cost and are D4 D2 D6 D7 D0 D5 D1 D3 used in numerous commercial Error Adjustment Test Point applications. Air pressure sensors are sensitive strain gauges configured as resistor bridges. One leg of the bridge is a Resistor Ladder Network diaphragm that compresses and expands with fluctuations in air pressure resulting in small resistance changes. Since the resistance change is small the system is required to have a very large gain. For Instrumentation Amplifier systems with a single power supply the instrumentation amplifier configuration provides good common-mode rejection Resistor Bridge ratio CMRR and minimises the number of passive components required to set the gain. The gain is set so that it provides maximum output voltage swing while avoiding amplifier saturation. System errors such as temperature drift and sensor offset can cause the output voltage to saturate and as a result it is necessary to provide a calibration mechanism. Calibration can be realised using potentiometers however they are undesirable in production designs. The part cost is higher than a fixed resistor and a pot requires human intervention thus it is preferable for adjustments to be made in software. Provided the current air pressure is known, then it is possible for the microprocessor to determine the calibration constants automatically and store them to memory. An R2R resistor ladder network controlled by the microprocessor forms a DAC that adjusts for the errors as shown in this example. 20K 20K 20K 20K 20K 20K 20K 20K 10K 10K 10K 10K 20K 10K 10K 10K R 14 R 15 R 13 R 12 R1 R6 R3 20K R7 C1 20K R 11 R4 20K 20K R5 R 10 C2 R8 R9 R2 2. LCD Backlight Dimmer – Slope generator DAC V CC Bright 100K UP / DOWN Push Button Control To Brightness Adjust 1 = UP 0 = DOWN Dim CLK P3 U/D C O UT 200K Q3 100K 100K 200K P2 Q2 100K 100K M.S.B P1 P0 R CLOCK 100K CLK P3 Q1 UP / DOWN Counter 100K MC14516B PE U/D 100K Q0 200K C IN 100K 200K Ladder Network 100K 200K C O UT 100K 200K 100K P2 Q2 100K 200K 100K P1 R Q1 UP / DOWN Counter P0 MC14516B 100K 200K Q3 L.S.B Backlighting is a key element in many liquid crystal display (LCD) applications. Due to the relatively low overall transmission of a typical LCD, the backlight is sometimes required to have extreme brightness. It should also possess a wide dimming range to facilitate use, depending on the amount of ambient light. LCD backlight controller IC’s require a brightness adjustment signal in the form of a linear control voltage. There are several ways of generating the “Brightness Adjust” voltage. The simplest is by using a potentiometer. Another method, shown in this example, is by using a digital UP/DOWN counter. In this method two push button switches are used to generate a logic level 1 for an “UP count” and a logic level 0 for a “DOWN count”. The UP/DOWN counters provide a digital output signal that is converted into an analogue signal using the R2R resistor ladder network. There are 256 brightness levels and setting the UP/DOWN counters pre-set inputs configures the brightness level at turn on. PE Q0 C IN 200K 3. Sine and DTMF Waveform Generation - Function generator DAC Many embedded applications require the generation of analogue signals. For example the generation of multiplexed frequencies (DTMF) for telephone dialling, controlling the speed of a motor, the generation of sound and complex waveforms as well as the generation of variable voltages in power supplies. Although separate digital to analogue converter IC’s exist the extra expense makes them prohibitive in cost sensitive designs. The example shown here demonstrates a DAC design using an R2R ladder and a microcontroller. To generate a single sine wave, the user creates a lookup table with the correct number of sample points. The software steps through each sample point and moves this value to the I/O port. The R2R ladder converts the digital signal to an analogue one. It is important that every sample point uses the same timing interval. Many telecomm applications, such as auto diallers, telephone keypads and security systems require DTMF for dialling and data transfer. Using the R2R ladder and seven sine lookup tables an entire 12-key keypad of DTMF patterns can be generated using a 3.579545 crystal. 3.57945 MHz 22pF C2 22pF C1 X1 Analogue Output OSC 1 V DD OSC 2 200K V DD RB MCLR RB RA RB 7 100K 200K 6 100K 3 PIC16C620 RA 2 PIC Microcontroller 200K 5 100K 200K RB 4 100K 200K RA RB 1 Ladder Network 3 100K 200K RA RB 0 2 100K 200K TOCLI RB 1 100K 200K GND RB 0 200K 4. Non-Linear Digital Dimmer - ADC The digital dimmer box is intended for stage illumination in theatres. It is simple and inexpensive to implement using a microcontroller and an R2R ladder. It is compatible with older analogue dimmer boxes and supports 4400-Watt loads. In stage illumination, dimming of each incandescent lamp is controlled by an analogue voltage (ranging from 0 to 10 volts) and is supplied by a remote console. To achieve linear perception, a dimmer box should exhibit a non-linear response to the control voltage. Older dimmer boxes employ analogue processing for the task of compensation. The digital approach uses a simple software look-up table concept to implement response compensation. As a result, a dedicated external analogue circuit is not required. The system control uses a microcontroller running at 12MHz and an 8-bit R2R resistor ladder network on port 2 as a digital to analogue converter. The R2R output provides a reference voltage (pin 33) for the analogue comparator on port P3. The analogue control voltage is connected to another comparator input (pin 31) and the analogue to digital conversion is completed by software using a successive approximation technique. The counter/timer generates a time delay between the zero crossing of the line voltage and the TRIAC’s trigger pulse. As a result, power is delivered to the load. At 12 MHz, it is possible to achieve delays from 0 to 8.33ms with the correct settings of the counter/timer prescaler, which corresponds to the phase-triggering range for an AC line frequency of 60Hz. V cc Control Voltage 0 to 10V R1 20k D1 1N 4148 R6 20k D2 1N 4148 12.0000 MHz 100nF C3 22pF C2 X1 7 R7 1k 11 22pF C1 6 XTAL2 P 00 15 20K 20K P 20 LOAD 10K LED 12 V cc 4400 W P 21 P 01 R 11 330R 6 Q1 P 22 P 02 20K 18 20K 1 10K P 23 U1 MAC 224A10 20K 17 10K 13 R 10 180R 16 10K 4 2 MO C 3020N P 24 1 20K 10K 6+6V/100mA R 14 18k 8 P 25 P 31 2 20K 3 20K 10K R 19 10k 230VAC D6 1N 4007 78L05 V1 100nF C5 10uF C4 D5 1N 4007 V0 G 1000uF C6 9 D4 1N 4148 D3 1N 4148 P 32 10 P 33 Microprocessor Z86E0812PSC AC LINE P 26 10K P 27 4 20K Resistor Ladder Network 5. R2R Analogue to Digital Converter - ADC This is an example of an 8-bit analogue to digital converter built using two cascaded binary up/down counters an op-amp and an R2R resistor ladder network. The analogue signal that needs to be converted into a digital signal is fed into the inverting input of the opamp. The op-amp output drives the up/down or “direction” pin of the binary counters until the R2R ladder output on the non-inverting opamp input equals the analogue input, at that point the counter state represents the digital equivalent of the analogue input. Adjusting the clock frequency sets the system resolution. P0 P1 P0 P3 P2 R PE U/D UP / DOWN Counter Q1 Q2 P2 P3 CLK MC14516B L.S.B C IN Q0 P1 R CLK MC14516B M.S.B PE UP / DOWN Counter C O UT Q3 C IN Q0 Q1 Q2 U/D C O UT Q3 D0 D1 D2 Digital Output D3 D4 Analogue Input D5 D6 D7 200K 200K 200K 100K 200K 100K 200K 100K 200K 100K 200K 100K Resistor Ladder Network 200K 100K 200K 100K