EETimes India - December 16, 2008 - (Page 7) In Focus | DSPs Use comparators for mixed-signal apps continued from page therefore intends to open the eyes of designers to the wealth of mixed-signal applications possible with this humble device. Sensor-to-digital conversion Most analogue sensors produce a change in resistance, inductance or capacitance that is proportional to the environmental factor they are measuring. A thermistor varies its resistance in proportion to the temperature, a humidity sensor varies its capacitance, and some proximity sensors even vary their inductance. The traditional method of conversion would have been to convert the resistance, capacitance or inductance into a voltage and then convert the voltage to a digital value with an ADC. However, what if we could convert the output of the sensor directly into a digital value? Here enters the voltage comparator. Using a simple relaxation oscillator, we can convert resistance, capacitance or inductance into a variable frequency and then measure that frequency using a timer peripheral (see figure 1). Besides the obvious advantages of simplicity, both circuits are also relatively immune to noise due to their inherent averaging of the incoming signal. Their resolution is also determined by the length of time over which the sample is counted. In both circuits, resistors R1, R2 and R3 provide hysteresis, shifting the trip level of the comparator up and down with the state of the comparator output. R4 and L1 in the left circuit set the frequency of operation, as do R4 and C1 in the right circuit. By replacing R4, C1 or L1 with a resistive, capacitive or inductive sensor, we create a variable-frequency oscillator in which the frequency is determined by the value of the sensor. The frequency is then converted to a digital value using Timer0 and Timer1. Timer1 counts at the frequency Figure 1: R/C/L sensor-to-digital converters. Figure 2: AND/OR and XOR circuits using comparators. Figure 3: Non-inverting and inverting op amp circuits. of the oscillation and Timer0 sets the sample period. When Timer0 rolls over, Timer1 is stopped and the result of the conversion is retrieved from Timer1. The resulting combination of a few external components, some software and a couple of internal timers gives the designer a simple method for measuring resistance, inductance or capacitance using a comparator. The designer can also extend the converter’s resolution by simply lengthening the period in which Timer1 is allowed to count. In addition, most new microcontrollers with on-chip comparators include a 2:1 or 4:1 analogue multiplexer on the inverting input. This allows the designers to multiplex the converter between as many as 4 sensors by simply adding an R4 for each of the sensors and routing the sensor/resistor junction to the various multiplexer inputs. Logic gates Producing logic gates is simply a matter of combining diode logic with a few resistors to create the necessary logic functions. Figure 2 shows the simple circuit that implements both the AND and OR functions, along with the slightly more complex XOR function. The circuit on the lef t in figure 2 is used for both AND and OR functions. To make it an AND, choose values for R3 and R4 that set the inverting input above VDD/2. To make it an OR function, choose values that set the inverting input slightly below VDD/2. R1 and continued on page EE Times-India | December 16-31, 2008 | www.eetindia.com http://www.eetindia.com/STATIC/REDIRECT/Newsletter_081216_EETI02.htm?ClickFromNewsletter_081216
Table of Contents Feed for the Digital Edition of EETimes India - December 16, 2008 EETimes India - December 16, 2008 Contents National Semiconductor Data Plane Processing Challenges DSP Design, Debug with DSPs TES 2008, NCMIPMV '08, ICACT '08, VLSI Conferene 2009, ICETiC 2009 EETimes India - December 16, 2008 EETimes India - December 16, 2008 - Contents (Page 1) EETimes India - December 16, 2008 - National Semiconductor (Page 2) EETimes India - December 16, 2008 - Data Plane Processing Challenges DSP (Page 3) EETimes India - December 16, 2008 - Data Plane Processing Challenges DSP (Page 4) EETimes India - December 16, 2008 - Data Plane Processing Challenges DSP (Page 5) EETimes India - December 16, 2008 - Design, Debug with DSPs (Page 6) EETimes India - December 16, 2008 - Design, Debug with DSPs (Page 7) EETimes India - December 16, 2008 - Design, Debug with DSPs (Page 8) EETimes India - December 16, 2008 - TES 2008, NCMIPMV '08, ICACT '08, VLSI Conferene 2009, ICETiC 2009 (Page 9) EETimes India - December 16, 2008 - TES 2008, NCMIPMV '08, ICACT '08, VLSI Conferene 2009, ICETiC 2009 (Page 10)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.