Ramp or sine signal is selected by switching the node name form INX to IN in the respective statements.
V3 INX 0 PULSE(-1.5 1.8 0 983.4m 983.4m 0 1966.8m)
V5 IN 0 SINE(0.181 1.521 19.32779948)
This simulation contains static CLK for simulating transfer characteristic.
VCLK1 CLK1 0 PULSE(-3 3 5u 100n 100n 19.9u 480u)
VCLK2 CLK2 0 PULSE(-3 3 30u 100n 100n 19.9u 60u)
VCLK3 CLK3 0 PULSE(-3 3 55u 100n 100n 19.9u 60u)
;VCLK1 CLK1 0 DC 3
;VCLK2 CLK2 0 DC 3
;VCLK3 CLK3 0 DC -3
Dynamic CLK statements (PULSE) are used for normal operation generating serially 8 bit at Dout.
Removing and inserting semicolons ; activates one or the other option.
Generating a positiv digital signal Dout from 0V to 3V requires R3 and R4 connected to VDDp.
On the left are the 2 switches selecting input voltage V(in) (CLK1) or V(res) (CLK3) from a pipeline stage operation.
The voltage Vin is saved as Vinx on sample and hold capacitor C1.
The comparator X3 generates data output Dout.
Vout = 2 * Vinx - Dout is generated by X1 and saved via a switch
on C2 (CLK2) as Voutx. Buffer X6 feeds VoutX as residue Vres back to the input for the next cycle.
CLK 1 is shortly activated to sample V(in) and generate the first Dout.
For the number of required bits CLK2 and then CLK 3 is activated generating the remaining bits.
Solution:
Static CLK residue ramp measurement
There was an error for static measurement:
VCLK3 DC has to be -3 V instead of 0 V to turn the switch off.
Figure: Static residue curve for the pipeline ADC
A dout signal 0V..2.6V is generated.
Input range for static simulation is from -1.4495 V up to 1.50 V.
These are the crossing points of V(voutx) = V(vinx).
There will be missing codes due to output voltages V(voutx) at the switching point of:
1.2444 V; -1.2444 V.
1.2444 V/ 1.5 V = 0.83 = 83%
Missing codes are expected.
Dynamic CLK ramp measurement
The simulation time is .
Figure: Dynamic ramp for the pipeline ADC
Simulation took 38 minuntes with maximum timestep 10u and all signals saved.
To extract input range V(vouty) was scaled (V(vouty)-0.88)*1.55 to be close to the V(in) range.
Input range -1.35 V..1.71 V
The input range is shifted compared to static simulation, probably due to some switch coupling.
For optimum data extraction the start and stop time of the ramp are measured: 43ms..958.9ms.