Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
university:courses:electronics:electronics-lab-14 [20 Sep 2019 16:08]
Pop Andreea [Unipolar output operation]
university:courses:electronics:electronics-lab-14 [23 Oct 2019 06:47]
Pop Andreea Updated links in Resources
Line 1: Line 1:
 ======Activity:​Digital to analog conversion====== ======Activity:​Digital to analog conversion======
 =====R-2R Resistor Ladder Digital to Analog Converter===== =====R-2R Resistor Ladder Digital to Analog Converter=====
-=====Objective:​=====+====Objective:​====
  
 The objective of this exercise is to explore the concepts of digital to analog conversion making use of the CMOS inverter as reference switches for a resistor ladder divider (used in DAC).  The objective of this exercise is to explore the concepts of digital to analog conversion making use of the CMOS inverter as reference switches for a resistor ladder divider (used in DAC). 
  
-=====Background:​=====+====Background:​====
  
 We will exploit the simple CMOS inverter logic gate as a pair of switches. The digital I/O signals of the ADALM2000 module can be configured as standard CMOS dividers with a +3.3 Volt supply (push-pull mode). In the simplest form, a CMOS output consists of one PMOS device, M<​sub>​1</​sub>​ and one NMOS device M<​sub>​2</​sub>​. Generally the CMOS fabrication process is designed such that the threshold voltage, V<​sub>​TH</​sub>,​ of the NMOS and PMOS devices are roughly equal i.e. complementary. The designer of the inverter then adjusts the width to length ratio, W/L, of the NMOS and PMOS devices such that their respective transconductance and thus their R<​sub>​ON</​sub>,​ is also equal. Only one of the two transistors is ever on at the same time connecting the Output to either V<​sub>​DD</​sub>​ or V<​sub>​SS</​sub>​. We can consider these two voltages to be the reference for out DAC. We will exploit the simple CMOS inverter logic gate as a pair of switches. The digital I/O signals of the ADALM2000 module can be configured as standard CMOS dividers with a +3.3 Volt supply (push-pull mode). In the simplest form, a CMOS output consists of one PMOS device, M<​sub>​1</​sub>​ and one NMOS device M<​sub>​2</​sub>​. Generally the CMOS fabrication process is designed such that the threshold voltage, V<​sub>​TH</​sub>,​ of the NMOS and PMOS devices are roughly equal i.e. complementary. The designer of the inverter then adjusts the width to length ratio, W/L, of the NMOS and PMOS devices such that their respective transconductance and thus their R<​sub>​ON</​sub>,​ is also equal. Only one of the two transistors is ever on at the same time connecting the Output to either V<​sub>​DD</​sub>​ or V<​sub>​SS</​sub>​. We can consider these two voltages to be the reference for out DAC.
Line 15: Line 15:
 When used in what is referred to as "​voltage mode" legs the R-2R resistor ladder, figure 2, are alternately driven to either of 2 reference voltage levels based on the digital code (D0-7). Digital 0 for V<​sub>​REF</​sub>​- and digital 1 for V<​sub>​REF</​sub>​+. Depending on the digital input code V<​sub>​LADDER</​sub>​ ( in figure 2 ) will be some fraction of the difference between the two reference levels. The negative of the two reference voltages (V<​sub>​REF</​sub>​-) is often ground (V<​sub>​SS</​sub>​). The positive reference voltage (V<​sub>​REF</​sub>​+) in our case here will be the positive supply (V<​sub>​DD</​sub>​) for the CMOS driver. ​ When used in what is referred to as "​voltage mode" legs the R-2R resistor ladder, figure 2, are alternately driven to either of 2 reference voltage levels based on the digital code (D0-7). Digital 0 for V<​sub>​REF</​sub>​- and digital 1 for V<​sub>​REF</​sub>​+. Depending on the digital input code V<​sub>​LADDER</​sub>​ ( in figure 2 ) will be some fraction of the difference between the two reference levels. The negative of the two reference voltages (V<​sub>​REF</​sub>​-) is often ground (V<​sub>​SS</​sub>​). The positive reference voltage (V<​sub>​REF</​sub>​+) in our case here will be the positive supply (V<​sub>​DD</​sub>​) for the CMOS driver. ​
  
-=====Materials:​=====+====Materials:​====
 ADALM2000 Active Learning Module\\ ADALM2000 Active Learning Module\\
 Solder-less breadboard\\ Solder-less breadboard\\
Line 23: Line 23:
 1 - OP27 amplifier 1 - OP27 amplifier
  
-=====Directions:​=====+====Directions:​====
  
 Build the 8 bit resister ladder circuit shown in figure 2, preferably on your solder-less breadboard. The number of resistors normally supplied in the Analog Parts Kit is not sufficient to build the full 8 bit ladder. It is best to use 1% resistors for this project if you have access to them. Build the 8 bit resister ladder circuit shown in figure 2, preferably on your solder-less breadboard. The number of resistors normally supplied in the Analog Parts Kit is not sufficient to build the full 8 bit ladder. It is best to use 1% resistors for this project if you have access to them.
Line 33: Line 33:
 Connect the 8 digital outputs designated by the blue boxes, and the scope channel and AWG output designated by the green boxes to the resistor ladder circuit as shown. Remember to connect power to the op amp supply pins. Connect the 8 digital outputs designated by the blue boxes, and the scope channel and AWG output designated by the green boxes to the resistor ladder circuit as shown. Remember to connect power to the op amp supply pins.
  
-=====Hardware Setup:=====+====Hardware Setup:====
  
 {{ :​university:​courses:​electronics:​a14_f2_bb.JPG?​ |}} {{ :​university:​courses:​electronics:​a14_f2_bb.JPG?​ |}}
Line 39: Line 39:
 <WRAP centeralign > Figure 3 R-2R Resistor Ladder Circuit Breadboard Connections </​WRAP>​ <WRAP centeralign > Figure 3 R-2R Resistor Ladder Circuit Breadboard Connections </​WRAP>​
  
-=====Proceduce:=====+====Procedure:====
  
 With both R<​sub>​1</​sub>​ and R<​sub>​2</​sub>​ installed, set AWG1 to a DC voltage equal to the V<​sub>​REF</​sub>​+ of the DAC which will be the +3.3 Volt supply voltage of the CMOS digital outputs. This will produce a bipolar output voltage which will swing from -3.3V to +3.3V. Disconnect AWG1 and remove resistor R<​sub>​1</​sub>​ for a unipolar output voltage which will swing from 0 to +3.3V. With both R<​sub>​1</​sub>​ and R<​sub>​2</​sub>​ installed, set AWG1 to a DC voltage equal to the V<​sub>​REF</​sub>​+ of the DAC which will be the +3.3 Volt supply voltage of the CMOS digital outputs. This will produce a bipolar output voltage which will swing from -3.3V to +3.3V. Disconnect AWG1 and remove resistor R<​sub>​1</​sub>​ for a unipolar output voltage which will swing from 0 to +3.3V.
Line 73: Line 73:
 the loaded value can be transferred to the DAC register by strobing the LDAC pin. the loaded value can be transferred to the DAC register by strobing the LDAC pin.
 ===== Unipolar output operation===== ===== Unipolar output operation=====
-This mode of operation is the basic mode for AD5626. +This mode of operation is the basic mode for AD5626. ​You can verify the god functionality AD5626 according to the unipolar code table of the digital to analog convertor. 
-===Hardware setup=== + 
-Connect the pins of AD5626 as shown in figure ​7.+{{ :​university:​courses:​electronics:​unipolar_code_table.png?​400 |}} 
 +<WRAP centeralign > Figure 7.  Unipolar code table of AD5626</​WRAP>​ 
 +====Materials==== 
 +ADALM2000 Active Learning Module\\ 
 +Solder-less breadboard\\ 
 +Jumper wires\\ 
 +1 - AD5626 12-bit nanoDAC\\ 
 +1 - 2.2 KΩ resistor\\ 
 +1 - 0.001 uF capacitor\\ 
 +1 - 0.1 uF capacitor\\ 
 +1 - 10 uF capcitor\\ 
 + 
 +====Hardware setup==== 
 +Connect the pins of AD5626 as shown in figure ​8.
 {{ :​university:​courses:​electronics:​connections_ad5626.png?​600 |}} {{ :​university:​courses:​electronics:​connections_ad5626.png?​600 |}}
-<WRAP centeralign > Figure ​7. Connections for Unipolar operation AD5626</​WRAP>​+<WRAP centeralign > Figure ​8. Connections for Unipolar operation AD5626</​WRAP>​
  
-{{ :​university:​courses:​electronics:​ad5626_bb_bb.png?​900 |}} +{{ :​university:​courses:​electronics:​ad5626_bb_bb.png?​6900 |}} 
-<WRAP centeralign > Figure ​8. AD5626 breadboard connections</​WRAP>​+<WRAP centeralign > Figure ​9. AD5626 breadboard connections</​WRAP>​
  
  
-===Procedure===+====Procedure====
 Open Scopy and enable the positive power supply to 5V. in Pattern generator you should configure the DAC input signals according to the timing diagram of AD5626 presented in datasheet. Open Scopy and enable the positive power supply to 5V. in Pattern generator you should configure the DAC input signals according to the timing diagram of AD5626 presented in datasheet.
-Start by configuring SPI signals. Create a group channel with DIO0, DIO1 and DIO2. If the connections were done as in figure 8 then DIO0 is the clock signal, DIO2 the data signal and DIO0 the /CS signal. ​+Start by configuring SPI signals. Create a group channel with DIO0, DIO1 and DIO2. If the connections were done as in figure 8 then DIO1 is the clock signal, DIO2 the data signal and DIO0 the /CS signal
 +Pay attention that the digital channels are in the right order when grouped as SPI (see figure 11)
 It is specified in datasheet that the clock width for both high and low states should be at least 30 ns. From this you can compute the clock period and therefore maximum frequency. ​ It is specified in datasheet that the clock width for both high and low states should be at least 30 ns. From this you can compute the clock period and therefore maximum frequency. ​
 Set the clock frequency to 1Mhz. Set CLK Polarity and CLK Phase to 1.  Set the clock frequency to 1Mhz. Set CLK Polarity and CLK Phase to 1. 
Line 94: Line 108:
  
 {{ :​university:​courses:​electronics:​timing_diagram.png?​900 |}}  {{ :​university:​courses:​electronics:​timing_diagram.png?​900 |}} 
-<WRAP centeralign > Figure ​9. AD5626 SPI timing diagram</​WRAP>​+<WRAP centeralign > Figure ​10. AD5626 SPI timing diagram</​WRAP>​
  
 Now you should configure /LDAC and /CLR signals. Now you should configure /LDAC and /CLR signals.
Line 108: Line 122:
  
 The last step is to open oscilloscope and connect channel 1 to the output of AD5626. Enable channel 1 measurements and enter a value in the "​Data"​ area of SPI. The last step is to open oscilloscope and connect channel 1 to the output of AD5626. Enable channel 1 measurements and enter a value in the "​Data"​ area of SPI.
-In figure ​11 you can see the output voltage if the data sent through SPI is 7FF.+In figure ​12 you can see the output voltage if the data sent through SPI is 7FF.
  
 {{ :​university:​courses:​electronics:​vout_ad5626.png?​900 |}} {{ :​university:​courses:​electronics:​vout_ad5626.png?​900 |}}
-<WRAP centeralign > Figure ​10. AD5626 output voltage for 7FF input.</​WRAP>​+<WRAP centeralign > Figure ​12. AD5626 output voltage for 7FF input.</​WRAP>​ 
 + 
 +===== Bipolar output operation===== 
 +Although the AD5626 has been designed for single-supply operation, bipolar operation is achievable using the circuit 
 +illustrated in Figure 13.  
 + 
 +{{ :​university:​courses:​electronics:​bipolar_output_circuit.png?​600 |}} 
 +<WRAP centeralign > Figure 13. Bipolar output operation without trim</​WRAP>​ 
 + 
 +This circuit can be used for applications that do not require high accuracy. ​ The output 
 +voltage is coded in offset binary and is given by: 
 +\\ 
 + <​WRAP centeralign>​ <​m> ​ Vo = 1mV*Digital Code * (R4/​(R3+R4))*(1+R2/​R1)-2.5*(R2/​R1) </m> </​WRAP>​ 
 + 
 +\\ 
 +For the  ±5V output range and the circuit values shown in the table in figure 13 the transfer equation becomes: 
 +\\ 
 + <​WRAP centeralign>​ <m> Vo=2.44 mV *Digital Code- 5V </m> </​WRAP> ​  
 +\\ 
 + 
 +====Materials==== 
 +ADALM2000 Active Learning Module\\ 
 +Solder-less breadboard\\ 
 +Jumper wires\\ 
 +1 - AD5626 12-bit nanoDAC\\ 
 +1 - 0.1 uF capacitor\\ 
 +1 - 1 KΩ resistor\\ 
 +1 - 20 KΩ resistor\\ 
 +2 - 10 KΩ resistors\\ 
 +1 - 47 KΩ resistor\\ 
 +1 - 470 KΩ resistor\\ 
 +====Hardware setup==== 
 +Build the circuit presented in figure 13 on your solderless breadboard.  
 +{{ :​university:​courses:​electronics:​ad5626_bipolar_bb.png?​900 |}} 
 +<WRAP centeralign > Figure 14. AD5626 Bipolar output operation breadboard connections</​WRAP>​ 
 + 
 +====Procedure==== 
 +You can configure the DAC for unipolar output operation as described above. For the voltage reference use the channel 1 of the Signal generator ​ set for constant 2.5V . 
 +On the second channel of the oscilloscope visualize the voltage at the output of the opamp. 
 +You can visualize both the voltages for unipolar operation and bipolar operation at the same time on the oscilloscope. 
 + 
 +{{ :​university:​courses:​electronics:​output_for_000.png?​900 |}} 
 +<WRAP centeralign > Figure 15. Unipolar and  Bipolar output voltage for 000 input</​WRAP>​ 
 + 
 +{{ :​university:​courses:​electronics:​output_for_800.png?​900 |}} 
 +<WRAP centeralign > Figure 16. Unipolar and  Bipolar output voltage for 800 input</​WRAP>​
  
 +{{ :​university:​courses:​electronics:​output_for_fff.png?​900 |}}
 +<WRAP centeralign > Figure 17. Unipolar and  Bipolar output voltage for FFF input</​WRAP>​
 =====Questions:​===== =====Questions:​=====
  
Line 130: Line 191:
 **Resources:​** **Resources:​**
   * Fritzing files: [[ https://​minhaskamal.github.io/​DownGit/#/​home?​url=https://​github.com/​analogdevicesinc/​education_tools/​tree/​master/​m2k/​fritzing/​dac_bb | dac_bb]]   * Fritzing files: [[ https://​minhaskamal.github.io/​DownGit/#/​home?​url=https://​github.com/​analogdevicesinc/​education_tools/​tree/​master/​m2k/​fritzing/​dac_bb | dac_bb]]
-  * LTspice files: [[ https://​minhaskamal.github.io/​DownGit/#/​home?​url=https://​github.com/​analogdevicesinc/​education_tools/​tree/​master/​m2k/​ltspice/​dac_ltspice | dac_ltspice]]+  * LTspice files: [[https://​minhaskamal.github.io/​DownGit/#/​home?​url=https://​github.com/​analogdevicesinc/​education_tools/​tree/​master/​m2k/​ltspice/​dac_ltspice | dac_ltspice]]
 </​WRAP>​ </​WRAP>​
  
university/courses/electronics/electronics-lab-14.txt · Last modified: 25 Jun 2020 22:07 (external edit)