Interface ElectronicsLaboratory 03GroupY, ***007, V |
The schematic shows a 4-bit ADC DAC simulation set up. Simulate a ramp testV2 in1 0 PULSE()Make sure the .save V(in1) V(vout) saves vout as last value, to be able to postprocess it. The simulation generates a file 4Bit_ADC_DAC_pipe.raw with simulated values. Unfortunately this file is binary coded and timesteps are varying. Extract the simulated values with Read Raw File . You can also calculate INL, DNL with any tool you like. Document and discuss INL and DNL values. Simulate a sine signal test.Extract the simulated values with Read Raw File . Calculate FFT, INL, DNL with FFT webpage and paste the extracted values from LTSPICE into the input field. Document and discuss FFT, INL, DNL and SNR values. |
4Bit_DAC_pipe.asc 4Bit_DAC_pipe.asy 4Bit_ADC_pipe.asc 4Bit_ADC_pipe.asy sample_hold.asc sample_hold.asy Switch.asc Switch.asy Version 4 SHEET 1 880 1532 WIRE 576 -272 496 -272 WIRE 96 -176 32 -176 WIRE 128 -176 96 -176 WIRE 144 -176 128 -176 WIRE 240 -176 224 -176 WIRE 256 -176 240 -176 WIRE 352 -176 336 -176 WIRE 368 -176 352 -176 WIRE 464 -176 448 -176 WIRE 496 -176 496 -272 WIRE 496 -176 464 -176 WIRE 528 -176 496 -176 WIRE 640 -176 608 -176 WIRE 640 -160 640 -176 WIRE 128 -144 128 -176 WIRE 240 -144 240 -176 WIRE 352 -144 352 -176 WIRE 464 -144 464 -176 WIRE 32 -128 32 -176 WIRE 640 -64 640 -96 WIRE 128 -32 128 -64 WIRE 240 -32 240 -64 WIRE 352 -32 352 -64 WIRE 464 -32 464 -64 WIRE 32 0 32 -48 WIRE 512 96 480 96 WIRE 288 128 256 128 WIRE 512 128 480 128 WIRE 128 160 80 160 WIRE 288 160 256 160 WIRE 512 160 480 160 WIRE 128 192 80 192 WIRE 288 192 256 192 WIRE 512 192 480 192 WIRE 688 192 640 192 WIRE 128 224 80 224 WIRE 288 224 256 224 WIRE 512 224 480 224 WIRE 288 256 256 256 WIRE 512 256 368 256 WIRE 368 272 368 256 WIRE 512 288 464 288 FLAG 80 160 CLK IOPIN 80 160 In FLAG 80 224 VDD IOPIN 80 224 In FLAG 368 272 0 FLAG 80 192 in1 IOPIN 80 192 In FLAG 288 256 RES1 FLAG 288 224 D3 FLAG 288 192 D2 FLAG 288 160 D1 FLAG 288 128 D0 FLAG 480 96 CLK FLAG 464 288 VDD FLAG 480 128 D0 FLAG 480 160 D1 FLAG 480 192 D2 FLAG 480 224 D3 FLAG 688 192 VoutX IOPIN 688 192 Out FLAG 32 0 0 FLAG 128 -32 D0 IOPIN 128 -32 In FLAG 640 -64 0 FLAG 640 -176 Voutfx FLAG 240 -32 D1 IOPIN 240 -32 In FLAG 352 -32 D2 IOPIN 352 -32 In FLAG 464 -32 D3 IOPIN 464 -32 In FLAG 576 -272 Vout IOPIN 576 -272 Out FLAG 96 -176 V0L FLAG 240 -176 V1L FLAG 352 -176 V2L SYMBOL 4Bit_DAC_pipe 576 192 R0 SYMATTR InstName X2 SYMBOL 4Bit_ADC_pipe 192 192 R0 SYMATTR InstName X4 SYMBOL res 16 -144 R0 SYMATTR InstName R1 SYMATTR Value 2k SYMBOL res 112 -160 R0 SYMATTR InstName R2 SYMATTR Value 2k SYMBOL res 128 -160 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R3 SYMATTR Value 1k SYMBOL res 624 -192 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R4 SYMATTR Value 10k SYMBOL cap 624 -160 R0 SYMATTR InstName C1 SYMATTR Value 1p SYMBOL res 224 -160 R0 SYMATTR InstName R5 SYMATTR Value 2k SYMBOL res 240 -160 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R6 SYMATTR Value 1.3k SYMBOL res 336 -160 R0 SYMATTR InstName R7 SYMATTR Value 2k SYMBOL res 464 -160 M270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R8 SYMATTR Value 1k SYMBOL res 448 -160 R0 SYMATTR InstName R9 SYMATTR Value 1.5k TEXT -8 312 Left 2 !VDD VDD 0 DC 1\nVCLK CLK 0 PULSE(0 1 0 1n 1n 79n 160n) TEXT 480 344 Left 2 !.tran 0 655.36u 0 1n TEXT 480 376 Left 2 !.options plotwinsize=0 TEXT 440 408 Left 2 !*.save V(vout) V(in1) V(clk) V(d*)\n.save V(vout) TEXT -8 368 Left 2 !V2 inX1 0 SINE(0.5 0.5 16784.66796875) TEXT -8 464 Left 2 !V1 in1 0 PULSE(0 1 0 655360n 655360n 0 1310720n) TEXT -40 56 Left 2 !.meas trans OUT00 FIND V(vout) AT=81.92us |
This video presents the download and run of LTSPICE files. Search for "Vollrath InEl" Open LTSPICE presentation. Go to "Scalable behavioral 4 Bit DAC", "Scalable behavioral 4 Bit ADC", "Test for 4 Bit ADC and DAC" slides and download circuits (.asc) and (.asy) presented to you after clicking on the circuit. Run the sine simulation and view V(in1),V(out). Create a pulse voltage source: V1 in1 0 PULSE(0 1 0 655.36u 655.36u 0 1310.72u) Run a ramp simulation. |
Duration 10:52 min |
This video presents the analysis of LTSPICE simulation files. Run the ADC DAC test simulation in LTSPICE with a ramp. Extract the simulated values with Read Raw File . Use analysis buttons to:
Extract the simulated values with Read Raw File . Use the integer values for a FFT analysis. |
Duration 13:48 min |
The FFT analysis is done with 4 Bits and 4096 points. Signal magnitude for frequency 11 gives 11.9 dB. Total noise gives -13.7 dB. First harmonic at 517 is -23.08 dB. So total noise is limiting signal to noise ratio and gives ENOB = (11.9-(-13.7)-1.76)/6.02 = 3.96 bits. |
![]() |
The schematic shows a 4-bit R2R DAC. We will use it in the ADC DAC simulation to see some errors. Create a symbol and hook it up to the ADC DAC test circuit from last week. Modify the resistance values. For example 1.5k, 2.5k, 1.3k, 1.7k. See first LTSPICE schematuc for used values. Simulate a ramp test. Extract the simulated values with Read Raw File . Calculate INL, DNL with any tool. Document and discuss INL and DNL values. Simulate a sine signal test. Extract the simulated values with Read Raw File . Calculate FFT, INL, DNL with FFT webpage and paste the extracted values from LTSPICE into the input field. Document and discuss FFT, INL, DNL and SNR values. |
Version 4 SHEET 1 1212 680 WIRE -48 -480 -128 -480 WIRE -528 -384 -592 -384 WIRE -496 -384 -528 -384 WIRE -480 -384 -496 -384 WIRE -384 -384 -400 -384 WIRE -368 -384 -384 -384 WIRE -272 -384 -288 -384 WIRE -256 -384 -272 -384 WIRE -160 -384 -176 -384 WIRE -128 -384 -128 -480 WIRE -128 -384 -160 -384 WIRE -96 -384 -128 -384 WIRE 16 -384 -16 -384 WIRE 16 -368 16 -384 WIRE -496 -352 -496 -384 WIRE -384 -352 -384 -384 WIRE -272 -352 -272 -384 WIRE -160 -352 -160 -384 WIRE -592 -336 -592 -384 WIRE 16 -272 16 -304 WIRE -496 -240 -496 -272 WIRE -384 -240 -384 -272 WIRE -272 -240 -272 -272 WIRE -160 -240 -160 -272 WIRE -592 -208 -592 -256 FLAG -592 -208 0 FLAG -496 -240 D0 IOPIN -496 -240 In FLAG 16 -272 0 FLAG 16 -384 Voutfx FLAG -384 -240 D1 IOPIN -384 -240 In FLAG -272 -240 D2 IOPIN -272 -240 In FLAG -160 -240 D3 IOPIN -160 -240 In FLAG -48 -480 Vout IOPIN -48 -480 Out FLAG -528 -384 V0L FLAG -384 -384 V1L FLAG -272 -384 V2L SYMBOL res -608 -352 R0 SYMATTR InstName R0 SYMATTR Value 2k SYMBOL res -512 -368 R0 SYMATTR InstName R1 SYMATTR Value 2k SYMBOL res -496 -368 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R5 SYMATTR Value 1k SYMBOL res 0 -400 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R8 SYMATTR Value 10k SYMBOL cap 0 -368 R0 SYMATTR InstName C2 SYMATTR Value 1p SYMBOL res -400 -368 R0 SYMATTR InstName R2 SYMATTR Value 2k SYMBOL res -384 -368 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R6 SYMATTR Value 1k SYMBOL res -288 -368 R0 SYMATTR InstName R3 SYMATTR Value 2k SYMBOL res -160 -368 M270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName R7 SYMATTR Value 1k SYMBOL res -176 -368 R0 SYMATTR InstName R4 SYMATTR Value 2k TEXT -392 -168 Left 2 !VD0 D0 0 PULSE(1 0 0 1n 1n 99n 200n)\nVD1 D1 0 PULSE(1 0 0 1n 1n 199n 400n)\nVD2 D2 0 PULSE(1 0 0 1n 1n 399n 800n)\nVD3 D3 0 PULSE(1 0 0 1n 1n 799n 1600n) TEXT -608 -160 Left 2 !.tran 2u Duration 6:34 min |
For LTSPICE raw file reading start time is 0, Stop time is 655.3us and time step is 160ns Map to integer range is 255. Signal level (11): 36.85 dB. Total noise: 17.44 dB. First harmonic (33): 14.76 dB. ENOB = (36.85 - 17.44 -1.76)/6.02 = 2.93 bits. |
![]() |
This FFT is done using 3 bit codes only. Signal to noise is unchanged. INL, DNL looks more reasonable, but goes up to 1. Signal level (11): 36.85 dB. Total noise: 17.44 dB. First harmonic (33): 14.76 dB. ENOB = (36.85 - 17.44 -1.76)/6.02 = 2.93 bits. |
![]() |
This video presents the analysis of LTSPICE simulation files with
a .measure statement. Run the ADC DAC test simulation in LTSPICE with a ramp. Insert SPICE directive: .meas trans OUT00 FIND V(vout) AT=81.92us After simulation "View","SPICE Error log" will show the result. Multiple measurement statements can be placed into a file. After simulation "File","Execute .MEAS script" generates the results. A 10-bit data converter should have about 16384 measurement values. Data extraction can be difficult and quite time consuming. |
Duration 5:55 min |
.meas tran out0 FIND V(vout) AT = 20.48us .meas tran out1 FIND V(vout) AT = 61.44us .meas tran out2 FIND V(vout) AT = 102.4us .meas tran out3 FIND V(vout) AT = 143.36us .meas tran out4 FIND V(vout) AT = 184.32us .meas tran out5 FIND V(vout) AT = 225.28us .meas tran out6 FIND V(vout) AT = 266.24us .meas tran out7 FIND V(vout) AT = 307.2us .meas tran out8 FIND V(vout) AT = 348.16us .meas tran out9 FIND V(vout) AT = 389.12us .meas tran out10 FIND V(vout) AT = 430.08us .meas tran out11 FIND V(vout) AT = 471.04us .meas tran out12 FIND V(vout) AT = 512us .meas tran out13 FIND V(vout) AT = 552.96us .meas tran out14 FIND V(vout) AT = 593.92us .meas tran out15 FIND V(vout) AT = 634.88us .meas tran out16 FIND V(vout) AT = 675.84usView LTSPICE log.
* C:\Users\vollratj\Documents\InEl_Laboratory\web_Template\web_Template\InEl_P2019\2019_GroupY\Measure.mout out0: V(vout)=0 at 2.048e-005 out1: V(vout)=0.0488599 at 6.144e-005 out2: V(vout)=0.0977199 at 0.0001024 out3: V(vout)=0.14658 at 0.00014336 out4: V(vout)=0.224756 at 0.00018432 out5: V(vout)=0.273616 at 0.00022528 out6: V(vout)=0.322476 at 0.00026624 out7: V(vout)=0.371336 at 0.0003072 out8: V(vout)=0.579805 at 0.00034816 out9: V(vout)=0.628664 at 0.00038912 out10: V(vout)=0.677524 at 0.00043008 out11: V(vout)=0.726384 at 0.00047104 out12: V(vout)=0.80456 at 0.000512 out13: V(vout)=0.85342 at 0.00055296 out14: V(vout)=0.90228 at 0.00059392 out15: V(vout)=0.95114 at 0.00063488 Measurement "out16" FAIL'ed
Version 4 SymbolType BLOCK RECTANGLE Normal -64 -120 64 120 WINDOW 0 0 -120 Bottom 2 PIN -64 -96 LEFT 8 PINATTR PinName CLK PINATTR SpiceOrder 1 PIN -64 -64 LEFT 8 PINATTR PinName D0 PINATTR SpiceOrder 2 PIN -64 -32 LEFT 8 PINATTR PinName D1 PINATTR SpiceOrder 3 PIN -64 0 LEFT 8 PINATTR PinName D2 PINATTR SpiceOrder 4 PIN -64 32 LEFT 8 PINATTR PinName D3 PINATTR SpiceOrder 5 PIN -64 64 LEFT 8 PINATTR PinName In1 PINATTR SpiceOrder 6 PIN -64 96 LEFT 8 PINATTR PinName VDD PINATTR SpiceOrder 7 PIN 64 0 RIGHT 8 PINATTR PinName Out PINATTR SpiceOrder 8
Version 4 SymbolType BLOCK RECTANGLE Normal -64 -88 64 88 WINDOW 0 0 -88 Bottom 2 PIN -64 -32 LEFT 8 PINATTR PinName CLK PINATTR SpiceOrder 1 PIN -64 0 LEFT 8 PINATTR PinName In1 PINATTR SpiceOrder 2 PIN -64 32 LEFT 8 PINATTR PinName VDD PINATTR SpiceOrder 3 PIN 64 -64 RIGHT 8 PINATTR PinName D0 PINATTR SpiceOrder 4 PIN 64 -32 RIGHT 8 PINATTR PinName D1 PINATTR SpiceOrder 5 PIN 64 0 RIGHT 8 PINATTR PinName D2 PINATTR SpiceOrder 6 PIN 64 32 RIGHT 8 PINATTR PinName D3 PINATTR SpiceOrder 7 PIN 64 64 RIGHT 8 PINATTR PinName Out PINATTR SpiceOrder 8
Version 4 SymbolType BLOCK LINE Normal 32 -16 32 -64 1 LINE Normal 16 -16 0 -16 LINE Normal 47 -16 16 -32 LINE Normal 81 -16 47 -16 LINE Normal 63 -5 63 -16 LINE Normal 78 -5 48 -5 LINE Normal 78 0 48 0 LINE Normal 63 11 63 0 LINE Normal 72 11 56 11 LINE Normal 65 20 72 11 LINE Normal 56 11 65 20 TEXT 14 16 Left 0 SH PIN 0 -16 NONE 8 PINATTR PinName P1 PINATTR SpiceOrder 1 PIN 80 -16 NONE 8 PINATTR PinName P2 PINATTR SpiceOrder 2 PIN 32 -64 NONE 8 PINATTR PinName clk PINATTR SpiceOrder 3 PIN 64 -32 NONE 8 PINATTR PinName VDD PINATTR SpiceOrder 4
Version 4 SymbolType BLOCK LINE Normal -16 0 -33 0 LINE Normal 16 0 -15 -16 LINE Normal 33 0 16 0 LINE Normal 0 -8 0 -46 LINE Normal -7 -31 0 -8 LINE Normal 0 -8 7 -32 PIN -32 0 NONE 8 PINATTR PinName in PINATTR SpiceOrder 1 PIN 32 0 NONE 8 PINATTR PinName out PINATTR SpiceOrder 2 PIN 0 -48 NONE 8 PINATTR PinName ctrl PINATTR SpiceOrder 3