Yesterday we covered the Dangerous DSO analog front end. This circuit divides our +/-10volt input to +/-0.5volts, and re-centers it between the 2volt and 3volt range the ADC can measure. Today we’ll simulate the circuit to get a better feel for how it works.
Dangerous DSO is a new logic analyzer/oscilloscope design we’ve been using in the lab. This is not a finished project, it will not be produced. We’re posting our current progress to get some feedback. Look for a new Dangerous DSO article every day this week. Don’t miss Part 1: There’s so much between 0 and 1, Part 2: Feed and water your ADC, and Part 3: Messing with the front end.
LTspice has a crappy schematic editor, second only to the Xilinx Webpack schematic entry program in suckage. Seriously. We managed to enter our front-end design with the default values from the Bitscope schematic.
Remember this diagram. We want to divide the +/-10volt input down to +/-0.5volts, then offset it 2volts.
Right click->run to simulate the design. A pretty graph appears that shows the voltage at various points in the circuit as the DSO input goes from -10volts to +10volts.
Input (green) goes from -10v to +10v. This is a simulation of voltage coming into the scope probe.
After the voltage divider (red) the signal is reduced to -0.5v at -10volts input and +0.5v at +10volts input. Perfect.
Output voltage (blue) shows what the ADC gets from the op-amp. 2v at -10volts, to 3.7v at +10volts. No good! We need to be centered in the 2volt-3volt measurement range of the ADC.
Fixing the gain
What’s going on? Gain. Remember from yesterday that the Bitscope ADC buffer stage multiplies the input by 1.667. Gain is determined by R1 and R2 in the simulated circuit.
This is exactly what we got, ~1.7Vp-p from our 1Vp-p signal.
We can compensate for the gain by adjusting the input voltage divider. We can also reduce the gain by changing the value of R1 and R2, but we can’t reduce it to 1 in the current circuit.
After a lot of experimenting we decided to increase the gain to 2x by setting R1 and R2 to the same value (220 ohms). The zero adjustment got really close to the edge of the pot with any 1.667 gain setup, 2x gain leaves lots of room to play.
A gain of 2 means we have to divide the input by an additional factor of 2. The 20Vp-p input is now divided to +/-0.25volts (0.5Vp-p). The op-amp then amplifies the signal by a factor of two and offsets it to the ADC measurement range. It probably does awful things to the signal, but we don’t care at this point.
For +/-10volt input we’re now using a .975M and .025M resistor divider. Most of the useful divider values are in the bottom 100K of the 1M resistor. It would be a lot easier to control the input range with a 900K fixed resistor and 100K trimmer.
Simulate the new values
This is a simulation of the front-end with the new values.
Input from the DSO probe (green) goes from -10v to +10v. Offset voltage (light blue) measured at R1 is constant at around 2.5v.
After the voltage divider (red) the signal is reduced to -0.25v at -10volts input and +0.25v at +10volts input. Perfect.
Output voltage (blue) from the op-amp is 2v at -10volts, to 3v at +10volts. Perfectly centered in the 2volt-3volt measurement range of the ADC.
Looks great, this will be the basis for tomorrow’s test.
There’s lots of other ways to handle the voltage offset. A second slow op-amp pair can first buffer, then invert, the 2.5volt common mode voltage from the ADC. That’s something to try on a future revision.
Still to come
Tomorrow concludes a week of Dangerous DSO. We’ll test the board with the updated gain values and a modified range divider.